(XmlWriter.write_family_handle): Use GRAMPS ID not DB handle.

(XmlWriter.write_xml_data): Sort family IDs before writing.


svn: r3472
This commit is contained in:
Tim Waugh 2004-08-22 12:45:47 +00:00
parent 049599ca95
commit 20bf8f7799
2 changed files with 14 additions and 7 deletions

View File

@ -1,9 +1,11 @@
2004-08-22 Tim Waugh <twaugh@redhat.com> 2004-08-22 Tim Waugh <twaugh@redhat.com>
* src/WriteXML.py (write_xml_data): Fixed typo causing XML export to * src/WriteXML.py (write_xml_data): Fixed typo causing XML export to
omit all place definitions. omit all place definitions.
(XmlWriter.write_xml_data): Sort person handles before writing. (XmlWriter.write_xml_data): Sort person IDs before writing.
(XmlWriter.write_xml_data): Fixed people output by preventing (XmlWriter.write_xml_data): Fixed people output by preventing
confusion between handles and GRAMPS IDs. confusion between handles and GRAMPS IDs.
(XmlWriter.write_family_handle): Use GRAMPS ID not DB handle.
(XmlWriter.write_xml_data): Sort family IDs before writing.
* src/RelLib.py (probably_alive): Fixed typo (bug #1012347). * src/RelLib.py (probably_alive): Fixed typo (bug #1012347).

View File

@ -198,9 +198,8 @@ class XmlWriter:
date = string.split(time.ctime(time.time())) date = string.split(time.ctime(time.time()))
owner = self.db.get_researcher() owner = self.db.get_researcher()
familyList = self.db.get_family_handles()
person_len = self.db.get_number_of_people() person_len = self.db.get_number_of_people()
family_len = len(familyList) family_len = len(self.db.get_family_handles())
source_len = len(self.db.get_source_handles()) source_len = len(self.db.get_source_handles())
place_len = len(self.db.get_place_handles()) place_len = len(self.db.get_place_handles())
objList = self.db.get_media_object_handles() objList = self.db.get_media_object_handles()
@ -325,9 +324,15 @@ class XmlWriter:
if family_len > 0: if family_len > 0:
self.g.write(" <families>\n") self.g.write(" <families>\n")
familyList.sort () keys = self.db.get_family_handles()
for key in self.db.get_family_handles(): sorted_keys = []
family = self.db.get_family_from_handle(key) for key in keys:
family = self.db.get_family_from_handle(key)
tuple = (family.get_gramps_id (), family)
sorted_keys.append (tuple)
sorted_keys.sort ()
for (gramps_id, family) in sorted_keys:
if self.callback and count % delta == 0: if self.callback and count % delta == 0:
self.callback(float(count)/float(total)) self.callback(float(count)/float(total))
count = count + 1 count = count + 1
@ -548,7 +553,7 @@ class XmlWriter:
rel = family.get_relationship() rel = family.get_relationship()
comp = family.get_complete_flag() comp = family.get_complete_flag()
sp = " " * index sp = " " * index
self.g.write('%s<family id="%s"' % (sp,family.get_handle())) self.g.write('%s<family id="%s"' % (sp,family.get_gramps_id()))
if comp: if comp:
self.g.write(' complete="1"') self.g.write(' complete="1"')
if rel != "": if rel != "":