* 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

@ -261,7 +261,7 @@ class GrampsDbBase:
def get_person_from_handle(self,val):
"""finds a Person in the database from the passed gramps' ID.
If no such Person exists, a new Person is added to the database."""
If no such Person exists, None is returned."""
data = self.person_map.get(str(val))
if data:
@ -302,8 +302,8 @@ class GrampsDbBase:
return None
def get_event_from_handle(self,handle):
"""finds a Place in the database from the passed gramps' ID.
If no such Place exists, None is returned."""
"""finds a Event in the database from the passed gramps' ID.
If no such Event exists, None is returned."""
data = self.event_map.get(str(handle))
if data:
@ -313,8 +313,8 @@ class GrampsDbBase:
return None
def get_family_from_handle(self,handle):
"""finds a Place in the database from the passed gramps' ID.
If no such Place exists, None is returned."""
"""finds a Family in the database from the passed gramps' ID.
If no such Family exists, None is returned."""
data = self.family_map.get(str(handle))
if data:
@ -358,16 +358,20 @@ class GrampsDbBase:
def find_event_from_handle(self,val):
"""
Finds a Family in the database from the passed GRAMPS ID.
If no such Family exists, a new Family is added to the database.
Finds a Event in the database from the passed GRAMPS ID.
If no such Event exists, a new Event is added to the database.
"""
event = Event()
data = self.event_map.get(str(val))
if data:
event = Event()
event.unserialize(data)
return event
else:
return None
event.set_handle(val)
if transaction:
transaction.add(EVENT_KEY,val,None)
self.event_map[str(val)] = event.serialize()
self.emap_index = self.emap_index + 1
return event
def find_object_from_handle(self,handle,transaction):
"""