* src/PedView.py (build_detail_string), src/FamilyView.py (load_family): Dont crash on strange signal race condition, that leaves database in corrupt state before sending "active-changed"

* src/plugins/ImportGeneWeb.py (read_children_lines): Properly add birth event; (parse_person): Remove brackets from name; (get_or_create_place): Fix typo


svn: r4506
This commit is contained in:
Martin Hawlisch 2005-05-07 13:22:28 +00:00
parent 932cc1b45f
commit 87d879dc6a
4 changed files with 23 additions and 12 deletions

View File

@ -1,3 +1,11 @@
2005-05-07 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/PedView.py (build_detail_string), src/FamilyView.py (load_family):
Dont crash on strange signal race condition, that leaves database in
corrupt state before sending "active-changed"
* src/plugins/ImportGeneWeb.py (read_children_lines): Properly add
birth event; (parse_person): Remove brackets from name;
(get_or_create_place): Fix typo
2005-05-06 Alex Roitman <shura@gramps-project.org>
* acinclude.m4: Copy macro for GCONF configuration from gconf2-dev;
add --disable-mime-install and --enable-packager-mode arguments.

View File

@ -968,6 +968,9 @@ class FamilyView:
if self.parent.active_person:
handle = self.parent.active_person.get_handle()
self.person = self.parent.db.get_person_from_handle(handle)
if not self.person:
self.clear()
return
splist = self.person.get_family_handle_list()
else:
self.person = None

View File

@ -802,10 +802,10 @@ def build_detail_string(db,person):
else:
for event_handle in person.get_event_list():
event = db.get_event_from_handle(event_handle)
if event.get_name() == "Baptism":
if event and event.get_name() == "Baptism":
detail_text += format_event(db, _BAPT, event)
break
if event.get_name() == "Christening":
if event and event.get_name() == "Christening":
detail_text += format_event(db, _CHRI, event)
break
@ -815,10 +815,10 @@ def build_detail_string(db,person):
else:
for event_handle in person.get_event_list():
event = db.get_event_from_handle(event_handle)
if event.get_name() == "Burial":
if event and event.get_name() == "Burial":
detail_text += format_event(db, _BURI, event)
break
if event.get_name() == "Cremation":
if event and event.get_name() == "Cremation":
detail_text += format_event(db, _CREM, event)
break

View File

@ -86,9 +86,8 @@ def importData(database, filename, cb=None):
#-------------------------------------------------------------------------
#
#
#
# For a description of the file format see
# http://cristal.inria.fr/~ddr/GeneWeb/en/gwformat.htm
#-------------------------------------------------------------------------
class GeneWebParser:
def __init__(self, dbase, file):
@ -255,7 +254,8 @@ class GeneWebParser:
birth_handle = child.get_birth_handle()
birth = self.db.get_event_from_handle(birth_handle)
if not birth:
birth = RelLib.Event()
birth = self.create_event("Birth")
child.set_birth_handle(birth.get_handle())
birth.set_place_handle(self.current_child_birthplace_handle)
self.db.commit_event(birth,self.trans)
if self.current_child_source_handle:
@ -450,14 +450,14 @@ class GeneWebParser:
while idx < len(fields) and personDataRe.match(fields[idx]):
if fields[idx][0] == '(':
#print "Public Name: %s" % fields[idx]
public_name = self.decode(fields[idx])
public_name = self.decode(fields[idx][1:-1])
idx = idx + 1
elif fields[idx][0] == '{':
#print "Firstsname Alias: %s" % fields[idx]
firstname_aliases.append(self.decode(fields[idx]))
firstname_aliases.append(self.decode(fields[idx][1:-1]))
idx = idx + 1
elif fields[idx][0] == '[':
#print "Titles: %s" % fields[idx]
print "TODO: Titles: %s" % fields[idx]
idx = idx + 1
elif fields[idx] == '#nick':
idx = idx + 1
@ -672,7 +672,7 @@ class GeneWebParser:
def get_or_create_place(self,place_name):
place = None
if place_name in self.pkeys:
person = self.db.get_place_from_handle(self.pkeys[place_name])
place = self.db.get_place_from_handle(self.pkeys[place_name])
else:
place = RelLib.Place()
place.set_title(place_name)