* src/RelLib/_Source.py: fix fast unserialize()

* src/RelLib/_Place.py: fix fast unserialize()
	* src/GrampsDbUtils/_WriteGedcom.py: double pass on progress bar
	
2007-08-29  Don Allingham  <don@gramps-project.org>


svn: r8891
This commit is contained in:
Don Allingham 2007-08-30 04:27:30 +00:00
parent 5588a61f03
commit 90e3ff34cb
4 changed files with 21 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2007-08-29 Don Allingham <don@gramps-project.org>
* src/RelLib/_Source.py: fix fast unserialize()
* src/RelLib/_Place.py: fix fast unserialize()
* src/GrampsDbUtils/_WriteGedcom.py: double pass on progress bar
2007-08-29 Don Allingham <don@gramps-project.org> 2007-08-29 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_GrampsDBDir.py: fast unserialize() * src/GrampsDb/_GrampsDBDir.py: fast unserialize()
* src/Editors/_EditPerson.py: fast unserialize() * src/Editors/_EditPerson.py: fast unserialize()

View File

@ -321,8 +321,6 @@ class GedcomWriter(UpdateCallback):
ErrorDialog(_("Could not create %s") % filename) ErrorDialog(_("Could not create %s") % filename)
return 0 return 0
self.set_total(len(self.db.get_person_handles()) + len(self.db.get_family_handles()))
self.__write_header(filename) self.__write_header(filename)
self.__write_submitter() self.__write_submitter()
self.__write_individuals() self.__write_individuals()
@ -435,13 +433,23 @@ class GedcomWriter(UpdateCallback):
""" """
INDIVIDUAL RECORDS INDIVIDUAL RECORDS
""" """
phandles = self.db.get_person_handles()
hcnt = len(phandles)
self.reset()
self.set_total(hcnt)
sorted = [] sorted = []
for handle in self.db.get_person_handles(): for handle in phandles:
person = self.db.get_person_from_handle (handle) person = self.db.get_person_from_handle (handle)
data = (person.get_gramps_id (), handle) data = (person.get_gramps_id (), handle)
sorted.append (data) sorted.append (data)
self.update()
sorted.sort() sorted.sort()
self.set_total(hcnt + len(self.db.get_family_handles()))
self.reset()
for data in sorted: for data in sorted:
self.__write_person(self.db.get_person_from_handle(data[1])) self.__write_person(self.db.get_person_from_handle(data[1]))
self.update() self.update()

View File

@ -129,7 +129,8 @@ class Place(SourceBase, NoteBase, MediaBase, UrlBase, PrimaryObject):
self.main_loc = new.instance(Location, None).unserialize(main_loc) self.main_loc = new.instance(Location, None).unserialize(main_loc)
self.alt_loc = [new.instance(Location, None).unserialize(al) self.alt_loc = [new.instance(Location, None).unserialize(al)
for al in alt_loc] for al in alt_loc]
self.marker = new.instance(MarkerType, None).unserialize(marker) self.marker = new.instance(MarkerType, None)
self.marker.unserialize(marker)
UrlBase.unserialize(self, urls) UrlBase.unserialize(self, urls)
MediaBase.unserialize(self, media_list) MediaBase.unserialize(self, media_list)
SourceBase.unserialize(self, source_list) SourceBase.unserialize(self, source_list)

View File

@ -52,6 +52,7 @@ class Source(MediaBase, NoteBase, PrimaryObject):
PrimaryObject.__init__(self) PrimaryObject.__init__(self)
MediaBase.__init__(self) MediaBase.__init__(self)
NoteBase.__init__(self) NoteBase.__init__(self)
self.marker = MarkerType()
self.title = "" self.title = ""
self.author = "" self.author = ""
self.pubinfo = "" self.pubinfo = ""
@ -81,7 +82,8 @@ class Source(MediaBase, NoteBase, PrimaryObject):
self.abbrev, self.change, self.datamap, reporef_list, self.abbrev, self.change, self.datamap, reporef_list,
marker, self.private) = data marker, self.private) = data
self.marker = new.instance(MarkerType, None).unserialize(marker) self.marker = new.instance(MarkerType, None)
self.marker.unserialize(marker)
NoteBase.unserialize(self, note_list) NoteBase.unserialize(self, note_list)
MediaBase.unserialize(self, media_list) MediaBase.unserialize(self, media_list)
self.reporef_list = [new.instance(RepoRef, None).unserialize(rr) self.reporef_list = [new.instance(RepoRef, None).unserialize(rr)