* src/AddrEdit.py: use new label scheme for tabs that uses an
icon to indicate used tabs * src/AttrEdit.py: use new label scheme for tabs that uses an icon to indicate used tabs * src/NameEdit.py: use new label scheme for tabs * src/Date.py: incorporate instance check form gramps20 branch * src/EditPerson.py: add additional fields for name edit, handle lds page better, adapt to new label scheme * src/GrampsDbBase.py: fix typos * src/GrampsGEDDB.py: fix undo handling * src/GrampsInMemDB.py: fix undo handling * src/GrampsXMLDB.py: fix undo handling * src/PeopleView.py: don't reselect an already selected person * src/Utils.py: new tab scheme * src/edit_person.glade new tab scheme * src/gramps_main.py: 1->True, 0->False replacements * src/DbPrompter.py: bring up to date with gramps20 branch * src/DisplayModels.py: bring up to date with gramps20 branch * src/ReadGedcom.py: bring up to date with gramps20 branch * src/Relationship.py: bring up to date with gramps20 branch svn: r4406
This commit is contained in:
@@ -464,36 +464,36 @@ class GrampsDbBase(GrampsDBCallback.GrampsDBCallback):
|
||||
|
||||
def _find_from_handle(self,handle,transaction,class_type,dmap,add_func):
|
||||
obj = class_type()
|
||||
val = str(handle)
|
||||
if dmap.get(val):
|
||||
obj.unserialize(dmap.get(val))
|
||||
handle = str(handle)
|
||||
if dmap.get(handle):
|
||||
obj.unserialize(dmap.get(handle))
|
||||
else:
|
||||
obj.set_handle(val)
|
||||
obj.set_handle(handle)
|
||||
add_func(obj,transaction)
|
||||
return obj
|
||||
|
||||
def find_person_from_handle(self,val,transaction):
|
||||
def find_person_from_handle(self,handle,transaction):
|
||||
"""
|
||||
Finds a Person in the database from the passed GRAMPS ID.
|
||||
If no such Person exists, a new Person is added to the database.
|
||||
"""
|
||||
return self._find_from_handle(val,transaction,Person,
|
||||
return self._find_from_handle(handle,transaction,Person,
|
||||
self.person_map,self.add_person)
|
||||
|
||||
def find_source_from_handle(self,val,transaction):
|
||||
def find_source_from_handle(self,handle,transaction):
|
||||
"""
|
||||
Finds a Source in the database from the passed GRAMPS ID.
|
||||
If no such Source exists, a new Source is added to the database.
|
||||
"""
|
||||
return self._find_from_handle(val,transaction,Source,
|
||||
return self._find_from_handle(handle,transaction,Source,
|
||||
self.source_map,self.add_source)
|
||||
|
||||
def find_event_from_handle(self,val,transaction):
|
||||
def find_event_from_handle(self,handle,transaction):
|
||||
"""
|
||||
Finds a Event in the database from the passed GRAMPS ID.
|
||||
If no such Event exists, a new Event is added to the database.
|
||||
"""
|
||||
return self._find_from_handle(val,transaction,Event,
|
||||
return self._find_from_handle(handle,transaction,Event,
|
||||
self.event_map,self.add_event)
|
||||
|
||||
def find_object_from_handle(self,val,transaction):
|
||||
@@ -501,7 +501,7 @@ class GrampsDbBase(GrampsDBCallback.GrampsDBCallback):
|
||||
Finds an MediaObject in the database from the passed GRAMPS ID.
|
||||
If no such MediaObject exists, a new Object is added to the database."""
|
||||
|
||||
return self._find_from_handle(val,transaction,MediaObject,
|
||||
return self._find_from_handle(handle,transaction,MediaObject,
|
||||
self.media_map,self.add_object)
|
||||
|
||||
def find_place_from_handle(self,val,transaction):
|
||||
@@ -509,15 +509,15 @@ class GrampsDbBase(GrampsDBCallback.GrampsDBCallback):
|
||||
Finds a Place in the database from the passed GRAMPS ID.
|
||||
If no such Place exists, a new Place is added to the database.
|
||||
"""
|
||||
return self._find_from_handle(val,transaction,Place,
|
||||
return self._find_from_handle(handle,transaction,Place,
|
||||
self.place_map,self.add_place)
|
||||
|
||||
def find_family_from_handle(self,val,transaction):
|
||||
def find_family_from_handle(self,handle,transaction):
|
||||
"""
|
||||
Finds a Family in the database from the passed gramps' ID.
|
||||
If no such Family exists, a new Family is added to the database.
|
||||
"""
|
||||
return self._find_from_handle(val,transaction,Family,
|
||||
return self._find_from_handle(handle,transaction,Family,
|
||||
self.family_map,self.add_family)
|
||||
|
||||
def get_person_from_gramps_id(self,val):
|
||||
@@ -1251,6 +1251,7 @@ class Transaction:
|
||||
self.first = None
|
||||
self.last = None
|
||||
self.batch = False
|
||||
self.length = 0
|
||||
|
||||
self.person_add = []
|
||||
self.person_del = []
|
||||
@@ -1330,3 +1331,4 @@ class Transaction:
|
||||
if self.last and self.first:
|
||||
return self.last - self.first + 1
|
||||
return 0
|
||||
|
||||
|
Reference in New Issue
Block a user