2004-08-23 Tim Waugh <twaugh@redhat.com>

* src/WriteGedcom.py (GedcomWriter.write_sources): Write sources
        in ID order for easier change tracking.


svn: r3483
This commit is contained in:
Tim Waugh 2004-08-23 11:26:24 +00:00
parent d13e98ce19
commit cf7a0649c1
2 changed files with 9 additions and 1 deletions

View File

@ -1,4 +1,7 @@
2004-08-23 Tim Waugh <twaugh@redhat.com>
* src/WriteGedcom.py (GedcomWriter.write_sources): Write sources
in ID order for easier change tracking.
* src/WriteXML.py (XmlWriter.write_xml_data): Use GRAMPS ID not DB
handle.
(XmlWriter.dump_source_ref): Likewise.

View File

@ -825,9 +825,14 @@ class GedcomWriter:
def write_sources(self):
nump = float(len(self.slist))
index = 0.0
sorted = []
for key in self.slist.keys():
source = self.db.get_source_from_handle(key)
self.writeln("0 @%s@ SOUR" % self.sid(source.get_gramps_id()))
tuple = (self.sid (source.get_gramps_id ()), source)
sorted.append (tuple)
sorted.sort ()
for (source_id, source) in sorted:
self.writeln("0 @%s@ SOUR" % source_id)
if source.get_title():
self.writeln("1 TITL %s" % fmtline(self.cnvtxt(source.get_title()),248,1,self.nl))
if source.get_author():