From 8afdb56aee16694afbcfd86e3b817757493f5313 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Sun, 22 Aug 2004 16:30:43 +0000 Subject: [PATCH] * src/WriteGedcom.py (GedcomWriter.export_data): Write individuals out in GRAMPS ID order. svn: r3476 --- ChangeLog | 3 +++ src/WriteGedcom.py | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index cfa89f594..3c10e7488 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-08-22 Tim Waugh + * src/WriteGedcom.py (GedcomWriter.export_data): Write individuals + out in GRAMPS ID order. + * src/ReadXML.py (GrampsParser.start_object): Set GRAMPS ID. * src/WriteXML.py (write_xml_data): Fixed typo causing XML export to diff --git a/src/WriteGedcom.py b/src/WriteGedcom.py index bfbdd77ad..ce5f6b77b 100644 --- a/src/WriteGedcom.py +++ b/src/WriteGedcom.py @@ -682,11 +682,16 @@ class GedcomWriter: self.writeln('2 CONT Not Provided') pkeys = self.plist.keys() - pkeys.sort() + sorted = [] + for key in pkeys: + person = self.db.get_person_from_handle (key) + tuple = (person.get_gramps_id (), person) + sorted.append (tuple) + sorted.sort() nump = float(len(self.plist)) index = 0.0 - for key in pkeys: - self.write_person(self.db.get_person_from_handle(key)) + for (gramps_id, person) in sorted: + self.write_person(person) index = index + 1 #if index%100 == 0 and not self.cl: # self.pbar.set_fraction(index/nump)