2007-02-07 Zsolt Foldvari <zfoldvar@users.sourceforge.net>

* src/GrampsDbUtils/_WriteGedcom.py (export_data): more complete SUBM
	record on export.



svn: r8072
This commit is contained in:
Zsolt Foldvari 2007-02-07 10:40:56 +00:00
parent 04d8c46637
commit 0ae91eac93
2 changed files with 38 additions and 29 deletions

View File

@ -1,3 +1,7 @@
2007-02-07 Zsolt Foldvari <zfoldvar@users.sourceforge.net>
* src/GrampsDbUtils/_WriteGedcom.py (export_data): more complete SUBM
record on export.
2007-02-06 Brian Matherly <brian@gramps-project.org> 2007-02-06 Brian Matherly <brian@gramps-project.org>
* src/docgen/PdfDoc.py: provide a more useful error when reportlab crashes * src/docgen/PdfDoc.py: provide a more useful error when reportlab crashes

View File

@ -533,6 +533,7 @@ class GedcomWriter(UpdateCallback):
date = time.ctime(time.time()).split() date = time.ctime(time.time()).split()
# HEADER
self.writeln("0 HEAD") self.writeln("0 HEAD")
self.writeln("1 SOUR GRAMPS") self.writeln("1 SOUR GRAMPS")
self.writeln("2 VERS %s" % const.version) self.writeln("2 VERS %s" % const.version)
@ -553,39 +554,39 @@ class GedcomWriter(UpdateCallback):
self.writeln("2 VERS 5.5") self.writeln("2 VERS 5.5")
self.writeln('2 FORM LINEAGE-LINKED') self.writeln('2 FORM LINEAGE-LINKED')
self.gnu_fdl() self.gnu_fdl()
self.writeln("0 @SUBM@ SUBM")
owner = self.db.get_researcher()
if owner.get_name():
self.writeln("1 NAME %s" % self.cnvtxt(owner.get_name()))
else:
self.writeln('1 NAME Not Provided')
if owner.get_address(): # SUBMITTER RECORD
cnt = 0 owner = self.db.get_researcher()
self.writeln("1 ADDR %s" % self.cnvtxt(owner.get_address())) (name,addr,city,stae,ctry,post,phon,mail) = owner.get()
if owner.get_city(): if name == '': name = u'Not Provided'
self.writeln("2 CONT %s" % self.cnvtxt(owner.get_city())) if addr == '': addr = u'Not Provided'
cnt = 1 if city == '': city = u'City (not provided)'
if owner.get_state(): if post == '': post = u'Postal code (not provided)'
self.writeln("2 CONT %s" % self.cnvtxt(owner.get_state())) if ctry == '': ctry = u'Country (not provided)'
cnt = 1
if owner.get_postal_code(): self.writeln("0 @SUBM@ SUBM")
self.writeln("2 CONT %s" % self.writeln("1 NAME %s" % self.cnvtxt(name))
self.cnvtxt(owner.get_postal_code())) self.writeln("1 ADDR %s" % self.cnvtxt(addr))
cnt = 1 self.writeln("2 CONT %s, %s" % (self.cnvtxt(city), self.cnvtxt(post)))
if owner.get_country(): self.writeln("2 CONT %s" % self.cnvtxt(ctry))
self.writeln("2 CONT %s" % self.cnvtxt(owner.get_country())) self.writeln("2 ADR1 %s" % self.cnvtxt(addr))
cnt = 1 self.writeln("2 ADR2 %s, %s" % (self.cnvtxt(city), self.cnvtxt(post)))
if cnt == 0: if city != u'City (not provided)':
self.writeln('2 CONT Not Provided') self.writeln("2 CITY %s" % self.cnvtxt(city))
if owner.get_phone(): if stae != '':
self.writeln("1 PHON %s" % self.cnvtxt(owner.get_phone())) self.writeln("2 STAE %s" % self.cnvtxt(stae))
else: if post != u'Postal code (not provided)':
self.writeln('1 ADDR Not Provided') self.writeln("2 POST %s" % self.cnvtxt(post))
self.writeln('2 CONT Not Provided') if ctry != u'Country (not provided)':
self.writeln("2 CTRY %s" % self.cnvtxt(ctry))
if phon != '':
self.writeln("1 PHON %s" % self.cnvtxt(phon))
if mail != '':
self.writeln("1 PHON %s" % self.cnvtxt(mail))
self.set_total(len(self.plist) + len(self.flist)) self.set_total(len(self.plist) + len(self.flist))
# INDIVIDUAL RECORDS
sorted = [] sorted = []
for handle in self.plist: for handle in self.plist:
person = self.db.get_person_from_handle (handle) person = self.db.get_person_from_handle (handle)
@ -596,11 +597,15 @@ class GedcomWriter(UpdateCallback):
self.write_person(person) self.write_person(person)
self.update() self.update()
# FAM RECORDS
self.write_families() self.write_families()
# SOURCE and REPOSITORY RECORDS
if self.source_refs: if self.source_refs:
self.write_sources() self.write_sources()
self.write_repos() self.write_repos()
# TRAILER
self.writeln("0 TRLR") self.writeln("0 TRLR")
self.g.close() self.g.close()
return 1 return 1