Cleanup in location saving. Don't write locations if they are empty
svn: r408
This commit is contained in:
parent
45081a072c
commit
d6d24d4169
@ -213,6 +213,27 @@ def dump_name(g,label,name,index=1):
|
|||||||
|
|
||||||
g.write('%s</%s>\n' % (sp,label))
|
g.write('%s</%s>\n' % (sp,label))
|
||||||
|
|
||||||
|
def dump_location(g,loc):
|
||||||
|
"Writes the location information to the output file"
|
||||||
|
city = fix(loc.get_city())
|
||||||
|
state = fix(loc.get_state())
|
||||||
|
country = fix(loc.get_country())
|
||||||
|
county = fix(loc.get_county())
|
||||||
|
|
||||||
|
if not city and not state and not county and not country:
|
||||||
|
return
|
||||||
|
|
||||||
|
g.write(' <location')
|
||||||
|
if city:
|
||||||
|
g.write(' city="%s"' % city)
|
||||||
|
if county:
|
||||||
|
g.write(' county="%s"' % county)
|
||||||
|
if state:
|
||||||
|
g.write(' state="%s"' % state)
|
||||||
|
if country:
|
||||||
|
g.write(' country="%s"' % country)
|
||||||
|
g.write('/>\n')
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
@ -449,24 +470,9 @@ def exportData(database, filename, callback):
|
|||||||
if place.get_longitude() != "" or place.get_latitude() != "":
|
if place.get_longitude() != "" or place.get_latitude() != "":
|
||||||
g.write(' <coord long="%s" lat=%s"/>\n' % \
|
g.write(' <coord long="%s" lat=%s"/>\n' % \
|
||||||
(fix(place.get_longitude()),fix(place.get_latitude())))
|
(fix(place.get_longitude()),fix(place.get_latitude())))
|
||||||
loc = place.get_main_location()
|
dump_location(g,place.get_main_location())
|
||||||
city = fix(loc.get_city())
|
|
||||||
state = fix(loc.get_state())
|
|
||||||
country = fix(loc.get_country())
|
|
||||||
county = fix(loc.get_county())
|
|
||||||
if city or state or country or county:
|
|
||||||
g.write(' <location city="%s"' % city)
|
|
||||||
g.write(' county="%s" state="%s"' % (county,state))
|
|
||||||
g.write(' country="%s"/>\n' % country)
|
|
||||||
for loc in place.get_alternate_locations():
|
for loc in place.get_alternate_locations():
|
||||||
city = fix(loc.get_city())
|
dump_location(g,loc)
|
||||||
state = fix(loc.get_state())
|
|
||||||
country = fix(loc.get_country())
|
|
||||||
county = fix(loc.get_county())
|
|
||||||
if city or state or country or county:
|
|
||||||
g.write(' <location')
|
|
||||||
g.write(' city="%s" county="%s"' % (city,county))
|
|
||||||
g.write(' state="%s" country="%s"/>\n' % (state,country))
|
|
||||||
for photo in place.getPhotoList():
|
for photo in place.getPhotoList():
|
||||||
path = photo.getPath()
|
path = photo.getPath()
|
||||||
l = len(fileroot)
|
l = len(fileroot)
|
||||||
|
Binary file not shown.
@ -137,14 +137,19 @@ class AncestorReport:
|
|||||||
for child in family.getChildList():
|
for child in family.getChildList():
|
||||||
self.doc.start_paragraph("ChildList")
|
self.doc.start_paragraph("ChildList")
|
||||||
t= child.getPrimaryName().getRegularName()
|
t= child.getPrimaryName().getRegularName()
|
||||||
|
#print "getBirth()", child.getBirth().__dict__
|
||||||
if child.getBirth().getDate() != "" and \
|
if child.getBirth().getDate() != "" and \
|
||||||
child.getBirth().getPlaceName() != "":
|
child.getBirth().getPlaceName() != "":
|
||||||
t= t+ " Born: "+child.getBirth().getDate() + \
|
#print child.getBirth().getPlace().__dict__
|
||||||
|
t= t+ " Born: "+child.getBirth().getDate() + \
|
||||||
" "+child.getBirth().getPlaceName()
|
" "+child.getBirth().getPlaceName()
|
||||||
if child.getDeath().getPlaceName() != "":
|
#print "getDeath()", child.getDeath().__dict__
|
||||||
if child.getDeath().getDate() != "" or child.getDeath().getPlaceName() != "":
|
if child.getDeath().getPlace() != None:
|
||||||
t= t+ " Died: "+child.getDeath().getDate() + \
|
#print child.getDeath().getPlace().__dict__
|
||||||
" "+child.getDeath().getPlaceName()
|
if child.getDeath().getDate() != "" or \
|
||||||
|
child.getDeath().getPlaceName() != "":
|
||||||
|
t= t+ " Died: "+child.getDeath().getDate() + \
|
||||||
|
" "+child.getDeath().getPlaceName()
|
||||||
self.doc.write_text(_(t))
|
self.doc.write_text(_(t))
|
||||||
self.doc.end_paragraph()
|
self.doc.end_paragraph()
|
||||||
|
|
||||||
@ -168,11 +173,13 @@ class AncestorReport:
|
|||||||
self.doc.end_bold()
|
self.doc.end_bold()
|
||||||
|
|
||||||
# Check birth record
|
# Check birth record
|
||||||
print person.getPrimaryName().getRegularName()
|
#print person.getPrimaryName().getRegularName()
|
||||||
birth = person.getBirth()
|
birth = person.getBirth()
|
||||||
if birth:
|
if birth:
|
||||||
date = birth.getDateObj().get_start_date()
|
date = birth.getDateObj().get_start_date()
|
||||||
place = birth.getPlaceName()
|
if birth.getPlaceName() != "":
|
||||||
|
place = birth.getPlaceName()
|
||||||
|
else: place= ""
|
||||||
if place[-1:] == '.':
|
if place[-1:] == '.':
|
||||||
place = place[:-1]
|
place = place[:-1]
|
||||||
t= ""
|
t= ""
|
||||||
@ -182,15 +189,15 @@ class AncestorReport:
|
|||||||
t= "on %s" % date.getDate()
|
t= "on %s" % date.getDate()
|
||||||
else:
|
else:
|
||||||
t= "in the year %s" % date.getYear()
|
t= "in the year %s" % date.getYear()
|
||||||
elif rptOptions.dateBlank == reportOptions.Yes:
|
elif rptOptions.blankDate == reportOptions.Yes:
|
||||||
t= "on _______________"
|
t= "on _______________"
|
||||||
if place != "":
|
if place != "":
|
||||||
t= t + " in %s" % place
|
t= t + " in %s" % place
|
||||||
elif rptOptions.placeBlank == reportOptions.Yes:
|
elif rptOptions.blankPlace == reportOptions.Yes:
|
||||||
t= t + " in _____________________"
|
t= t + " in _____________________"
|
||||||
|
|
||||||
if t != "":
|
if t != "":
|
||||||
self.doc.write_text(_(" was born " + t + "."))
|
self.doc.write_text(_(" was born " + t + "."))
|
||||||
else: self.doc.write_text(_("."))
|
else: self.doc.write_text(_("."))
|
||||||
|
|
||||||
t= ""
|
t= ""
|
||||||
@ -212,12 +219,12 @@ class AncestorReport:
|
|||||||
t= t + ("on %s" % date.getDate())
|
t= t + ("on %s" % date.getDate())
|
||||||
else:
|
else:
|
||||||
t= t + ("in the year %s" % date.getDate())
|
t= t + ("in the year %s" % date.getDate())
|
||||||
elif rptOptions.dateBlank == reportOptions.Yes:
|
elif rptOptions.blankDate == reportOptions.Yes:
|
||||||
t= "on ______________"
|
t= "on ______________"
|
||||||
|
|
||||||
if place != "":
|
if place != "":
|
||||||
t= t + (" in %s") % place
|
t= t + (" in %s") % place
|
||||||
elif rptOptions.placeBlank == reportOptions.Yes:
|
elif rptOptions.blankPlace == reportOptions.Yes:
|
||||||
t= t + (" in _____________")
|
t= t + (" in _____________")
|
||||||
|
|
||||||
if buried:
|
if buried:
|
||||||
@ -235,7 +242,7 @@ class AncestorReport:
|
|||||||
t = t + " in %s" % place
|
t = t + " in %s" % place
|
||||||
else:
|
else:
|
||||||
t = t + "in the year %s" % date.getDate()
|
t = t + "in the year %s" % date.getDate()
|
||||||
elif rptOptions.dateBlank == reportOptions.Yes:
|
elif rptOptions.blankDate == reportOptions.Yes:
|
||||||
t= t + " on ___________"
|
t= t + " on ___________"
|
||||||
if place != "":
|
if place != "":
|
||||||
t = t + " in %s" % place
|
t = t + " in %s" % place
|
||||||
@ -301,13 +308,14 @@ class AncestorReport:
|
|||||||
rptOptions.fullDate == reportOptions.Yes:
|
rptOptions.fullDate == reportOptions.Yes:
|
||||||
t= t + " on "+date.getDate()
|
t= t + " on "+date.getDate()
|
||||||
else: t= t + " in the year %s" % date.getYear()
|
else: t= t + " in the year %s" % date.getYear()
|
||||||
elif rptOptions.dateBlank == reportOptions.Yes:
|
elif rptOptions.blankDate == reportOptions.Yes:
|
||||||
t= t + " on __________"
|
t= t + " on __________"
|
||||||
else: t= t + " on __________"
|
else: t= t + " on __________"
|
||||||
|
|
||||||
if marriage.getPlaceName() != "":
|
if marriage.getPlace() != None and \
|
||||||
|
marriage.getPlaceName() != "":
|
||||||
t= t + " in " + marriage.getPlaceName()
|
t= t + " in " + marriage.getPlaceName()
|
||||||
elif rptOptions.placeBlank == reportOptions.Yes:
|
elif rptOptions.blankPlace == reportOptions.Yes:
|
||||||
t= t + " in ____________"
|
t= t + " in ____________"
|
||||||
self.doc.write_text(_(t+"."))
|
self.doc.write_text(_(t+"."))
|
||||||
|
|
||||||
@ -576,9 +584,9 @@ from Plugins import register_report
|
|||||||
|
|
||||||
register_report(
|
register_report(
|
||||||
report,
|
report,
|
||||||
_("Produces a detailed textual ancestral report"),
|
_("Detailed Ancestral Report"),
|
||||||
category=_("Generate Files"),
|
category=_("Generate Files"),
|
||||||
description= _("Detailed Ancestral Report"),
|
description= _("Produces a detailed ancestral report"),
|
||||||
xpm= get_xpm_image()
|
xpm= get_xpm_image()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -624,11 +632,11 @@ class reportOptions:
|
|||||||
#Include source notes
|
#Include source notes
|
||||||
#self.noSourceNotes= reportOptions.Yes
|
#self.noSourceNotes= reportOptions.Yes
|
||||||
|
|
||||||
#Replace missing with ___________
|
#Replace missing Place with ___________
|
||||||
self.placeBlank= reportOptions.Yes
|
self.blankPlace= reportOptions.Yes
|
||||||
|
|
||||||
#Replace missing dates with __________
|
#Replace missing dates with __________
|
||||||
self.dateBlank= reportOptions.Yes
|
self.blankDate= reportOptions.Yes
|
||||||
|
|
||||||
#Omit country code
|
#Omit country code
|
||||||
#self.noCountryInfo= reportOptions.No
|
#self.noCountryInfo= reportOptions.No
|
||||||
|
1389
gramps/src/po/de.po
1389
gramps/src/po/de.po
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user