* src/RelLib.py: gramps id fixes.

* src/ReadXML.py: gramps id fixes.
* src/plugins/ReadGedcom.py: gramps id fixes.


svn: r3243
This commit is contained in:
Alex Roitman
2004-06-29 02:33:25 +00:00
parent 191312c95a
commit 4a3b978f9e
4 changed files with 21 additions and 14 deletions

View File

@ -2984,17 +2984,20 @@ class GrampsDB:
else:
return None
def try_to_find_person_from_gramps_id(self,val):
def find_person_from_gramps_id(self,val,trans):
"""finds a Person in the database from the passed gramps' ID.
If no such Person exists, a new Person is added to the database."""
person = Person()
data = self.idtrans.get(str(val))
if data:
person = Person()
person.unserialize(cPickle.loads(data))
return person
else:
return None
intid = Utils.create_id()
person.set_id(intid)
person.set_gramps_id(val)
self.add_person_as(person,trans)
return person
def find_person_from_id(self,val,trans):
"""finds a Person in the database from the passed gramps' ID.