* src/ReadGedcom.py (parse_record): Get objects from handles;

(handle_source): Refer to handle, not the object;
(parse_source): Use gramps id (not handle) to form the title.
* src/GrampsDbBase.py (get_person_from_handle): Typo;
(find_event_from_handle): Correctly create new event if not found.
* src/Sources.py (draw): Correctly sort, use gramps id when
displaying sources; (redraw): Use gramps id in the list view.


svn: r3461
This commit is contained in:
Alex Roitman
2004-08-21 18:13:18 +00:00
parent 4a41bfa1a0
commit 55a76f77e1
4 changed files with 38 additions and 21 deletions

View File

@ -454,7 +454,7 @@ class GedcomParser:
if note:
self.source.set_note(note)
if not self.source.get_title():
self.source.set_title("No title - ID %s" % self.source.get_handle())
self.source.set_title("No title - ID %s" % self.source.get_gramps_id())
self.db.commit_source(self.source, self.trans)
self.backup()
return
@ -501,17 +501,21 @@ class GedcomParser:
self.family = self.find_or_create_family(matches[1])
self.parse_family()
if self.addr != None:
father = self.family.get_father_handle()
father_handle = self.family.get_father_handle()
father = self.db.get_person_from_handle(father_handle)
if father:
father.add_address(self.addr)
self.db.commit_person(father, self.trans)
mother = self.family.get_mother_handle()
mother_handle = self.family.get_mother_handle()
mother = self.db.get_person_from_handle(mother_handle)
if mother:
mother.add_address(self.addr)
self.db.commit_person(mother, self.trans)
for child in self.family.get_child_handle_list():
child.add_address(self.addr)
self.db.commit_person(child, self.trans)
for child_handle in self.family.get_child_handle_list():
child = self.db.get_person_from_handle(child_handle)
if child:
child.add_address(self.addr)
self.db.commit_person(child, self.trans)
self.db.commit_family(self.family, self.trans)
del self.family
elif matches[2] == "INDI":
@ -1751,7 +1755,7 @@ class GedcomParser:
s.set_note(matches[2] + self.parse_continue_data(level))
self.ignore_sub_junk(level+1)
else:
source_ref.set_base_handle(self.find_or_create_source(matches[2][1:-1]))
source_ref.set_base_handle(self.find_or_create_source(matches[2][1:-1]).get_handle())
self.parse_source_reference(source_ref,level)
return source_ref