* src/plugins/Verify.py (on_apply_clicked): Append warnings

to errors instead of overwriting; determine actual dates of burial
and baptism; (get_year): Correctly compare calendar names.
* src/plugins/rel_it.py: removed translatable strings (should be
already italian).
* src/plugins/IndivComplete.py (_get_report_filters):
Set both ancestor and descendant filters to be inclusive.
* src/plugins/RelGraph.py (get_report_filters):
Set both ancestor and descendant filters to be inclusive.
* src/plugins/TimeLine.py (_get_report_filters):
Set both ancestor and descendant filters to be inclusive.
* src/plugins/WebPage.py (get_report_filters):
Set both ancestor and descendant filters to be inclusive.
* src/plugins/WriteFtree.py (__init__):
Set both ancestor and descendant filters to be inclusive.
* src/plugins/Ancestors.py (person_name): Use translated name type.


svn: r3454
This commit is contained in:
Alex Roitman 2004-08-20 21:55:29 +00:00
parent fe4427adf8
commit 37b30dbc2c
9 changed files with 46 additions and 21 deletions

View File

@ -47,6 +47,23 @@
* src/plugins/TimeLine.py: Use self.doc.string_width() method. * src/plugins/TimeLine.py: Use self.doc.string_width() method.
* src/plugins/eval.glade: HIG compliance. * src/plugins/eval.glade: HIG compliance.
* src/plugins/Verify.py (on_apply_clicked): Append warnings
to errors instead of overwriting; determine actual dates of burial
and baptism; (get_year): Correctly compare calendar names.
* src/plugins/rel_it.py: removed translatable strings (should be
already italian).
* src/plugins/IndivComplete.py (_get_report_filters):
Set both ancestor and descendant filters to be inclusive.
* src/plugins/RelGraph.py (get_report_filters):
Set both ancestor and descendant filters to be inclusive.
* src/plugins/TimeLine.py (_get_report_filters):
Set both ancestor and descendant filters to be inclusive.
* src/plugins/WebPage.py (get_report_filters):
Set both ancestor and descendant filters to be inclusive.
* src/plugins/WriteFtree.py (__init__):
Set both ancestor and descendant filters to be inclusive.
* src/plugins/Ancestors.py (person_name): Use translated name type.
2004-08-20 Tim Waugh <twaugh@redhat.com> 2004-08-20 Tim Waugh <twaugh@redhat.com>
* src/RelLib.py (Event.are_equal): Fixed comparison with None. * src/RelLib.py (Event.are_equal): Fixed comparison with None.

View File

@ -671,7 +671,7 @@ class ComprehensiveAncestorsReport (Report.Report):
type = primary.get_type () type = primary.get_type ()
if type != 'Birth Name': if type != 'Birth Name':
name += ' (%s)' % type name += ' (%s)' % const.NameTypesMap.find_value (type)
name += self.cite_sources (primary.get_source_references ()) name += self.cite_sources (primary.get_source_references ())
return name return name

View File

@ -729,11 +729,11 @@ def _get_report_filters(person):
des = GenericFilter.GenericFilter() des = GenericFilter.GenericFilter()
des.set_name(_("Descendants of %s") % name) des.set_name(_("Descendants of %s") % name)
des.add_rule(GenericFilter.IsDescendantOf([person.get_handle()])) des.add_rule(GenericFilter.IsDescendantOf([person.get_handle(),1]))
ans = GenericFilter.GenericFilter() ans = GenericFilter.GenericFilter()
ans.set_name(_("Ancestors of %s") % name) ans.set_name(_("Ancestors of %s") % name)
ans.add_rule(GenericFilter.IsAncestorOf([person.get_handle()])) ans.add_rule(GenericFilter.IsAncestorOf([person.get_handle(),1]))
all = GenericFilter.GenericFilter() all = GenericFilter.GenericFilter()
all.set_name(_("Entire Database")) all.set_name(_("Entire Database"))

View File

@ -151,7 +151,7 @@ class RelGraphDialog(Report.ReportDialog):
des = GenericFilter.GenericFilter() des = GenericFilter.GenericFilter()
des.set_name(_("Descendants of %s") % name) des.set_name(_("Descendants of %s") % name)
des.add_rule(GenericFilter.IsDescendantOf([self.person.get_handle()])) des.add_rule(GenericFilter.IsDescendantOf([self.person.get_handle(),1]))
fam = GenericFilter.GenericFilter() fam = GenericFilter.GenericFilter()
fam.set_name(_("Descendant family members of %s") % name) fam.set_name(_("Descendant family members of %s") % name)
@ -159,7 +159,7 @@ class RelGraphDialog(Report.ReportDialog):
ans = GenericFilter.GenericFilter() ans = GenericFilter.GenericFilter()
ans.set_name(_("Ancestors of %s") % name) ans.set_name(_("Ancestors of %s") % name)
ans.add_rule(GenericFilter.IsAncestorOf([self.person.get_handle()])) ans.add_rule(GenericFilter.IsAncestorOf([self.person.get_handle(),1]))
com = GenericFilter.GenericFilter() com = GenericFilter.GenericFilter()
com.set_name(_("People with common ancestor with %s") % name) com.set_name(_("People with common ancestor with %s") % name)

View File

@ -375,11 +375,11 @@ def _get_report_filters(person):
des = GenericFilter.GenericFilter() des = GenericFilter.GenericFilter()
des.set_name(_("Descendants of %s") % name) des.set_name(_("Descendants of %s") % name)
des.add_rule(GenericFilter.IsDescendantOf([person.get_handle()])) des.add_rule(GenericFilter.IsDescendantOf([person.get_handle(),1]))
ans = GenericFilter.GenericFilter() ans = GenericFilter.GenericFilter()
ans.set_name(_("Ancestors of %s") % name) ans.set_name(_("Ancestors of %s") % name)
ans.add_rule(GenericFilter.IsAncestorOf([person.get_handle()])) ans.add_rule(GenericFilter.IsAncestorOf([person.get_handle(),1]))
com = GenericFilter.GenericFilter() com = GenericFilter.GenericFilter()
com.set_name(_("People with common ancestor with %s") % name) com.set_name(_("People with common ancestor with %s") % name)

View File

@ -40,7 +40,6 @@ import cStringIO
# GNOME/GTK modules # GNOME/GTK modules
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
from gnome.ui import *
import gtk import gtk
import gtk.glade import gtk.glade
@ -118,7 +117,7 @@ class Verify:
event = self.db.find_event_from_handle(event_handle) event = self.db.find_event_from_handle(event_handle)
dateObj = event.get_date_object() dateObj = event.get_date_object()
if dateObj: if dateObj:
if dateObj.get_calendar().NAME != Gregorian.Gregorian: if dateObj.get_calendar().NAME != Gregorian.NAME:
dateObj.set_calendar(Gregorian.Gregorian) dateObj.set_calendar(Gregorian.Gregorian)
year = dateObj.get_year() year = dateObj.get_year()
return year return year
@ -156,6 +155,16 @@ class Verify:
bapyear = 0 bapyear = 0
dyear = self.get_year( person.get_death_handle() ) dyear = self.get_year( person.get_death_handle() )
buryear = 0 buryear = 0
for event_handle in person.get_event_list():
if event_handle:
event = self.db.find_event_from_handle(event_handle)
event_name = event.get_name().lower()
if event.get_name() == "burial":
buryear = get_year( event )
elif event_name == "baptism":
bapyear = get_year( event )
if byear>0 and bapyear>0: if byear>0 and bapyear>0:
if byear > bapyear: if byear > bapyear:
if person.get_gender() == RelLib.Person.male: if person.get_gender() == RelLib.Person.male:
@ -450,7 +459,7 @@ class Verify:
if error: if error:
text = _("ERRORS:\n") + error.getvalue() + "\n" text = _("ERRORS:\n") + error.getvalue() + "\n"
if warn: if warn:
text = _("WARNINGS:\n") + warn.getvalue() text = text + _("WARNINGS:\n") + warn.getvalue()
error.close() error.close()
warn.close() warn.close()

View File

@ -1217,7 +1217,7 @@ class WebReportDialog(Report.ReportDialog):
des = GenericFilter.GenericFilter() des = GenericFilter.GenericFilter()
des.set_name(_("Direct Descendants of %s") % name) des.set_name(_("Direct Descendants of %s") % name)
des.add_rule(GenericFilter.IsDescendantOf([self.person.get_handle()])) des.add_rule(GenericFilter.IsDescendantOf([self.person.get_handle(),1]))
df = GenericFilter.GenericFilter() df = GenericFilter.GenericFilter()
df.set_name(_("Descendant Families of %s") % name) df.set_name(_("Descendant Families of %s") % name)
@ -1225,7 +1225,7 @@ class WebReportDialog(Report.ReportDialog):
ans = GenericFilter.GenericFilter() ans = GenericFilter.GenericFilter()
ans.set_name(_("Ancestors of %s") % name) ans.set_name(_("Ancestors of %s") % name)
ans.add_rule(GenericFilter.IsAncestorOf([self.person.get_handle()])) ans.add_rule(GenericFilter.IsAncestorOf([self.person.get_handle(),1]))
return [all,des,df,ans] return [all,des,df,ans]

View File

@ -109,11 +109,11 @@ class FtreeWriter:
des = GenericFilter.GenericFilter() des = GenericFilter.GenericFilter()
des.set_name(_("Descendants of %s") % person.get_primary_name().get_name()) des.set_name(_("Descendants of %s") % person.get_primary_name().get_name())
des.add_rule(GenericFilter.IsDescendantOf([person.get_handle()])) des.add_rule(GenericFilter.IsDescendantOf([person.get_handle(),1]))
ans = GenericFilter.GenericFilter() ans = GenericFilter.GenericFilter()
ans.set_name(_("Ancestors of %s") % person.get_primary_name().get_name()) ans.set_name(_("Ancestors of %s") % person.get_primary_name().get_name())
ans.add_rule(GenericFilter.IsAncestorOf([person.get_handle()])) ans.add_rule(GenericFilter.IsAncestorOf([person.get_handle(),1]))
com = GenericFilter.GenericFilter() com = GenericFilter.GenericFilter()
com.set_name(_("People with common ancestor with %s") % com.set_name(_("People with common ancestor with %s") %

View File

@ -34,7 +34,6 @@
import RelLib import RelLib
import Relationship import Relationship
import types import types
from gettext import gettext as _
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -71,13 +70,13 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def get_parents (self,level): def get_parents (self,level):
if level>len(_level)-1: if level>len(_level)-1:
return _("remote ancestors") return "remote ancestors"
else: else:
return "%si genitori" % _level[level] return "%si genitori" % _level[level]
def get_father (self,level, gender="o"): def get_father (self,level, gender="o"):
if level>len(_level)-1: if level>len(_level)-1:
return _("remote ancestor") return "remote ancestor"
elif level == 0: return "" elif level == 0: return ""
elif level == 1: return "padre" elif level == 1: return "padre"
elif level == 2: return "nonn%s" % gender elif level == 2: return "nonn%s" % gender
@ -90,7 +89,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
def get_son (self, level, gender="o"): def get_son (self, level, gender="o"):
if level>len(_level)-1: if level>len(_level)-1:
return _("remote descendant") return "remote descendant"
elif level == 0: return "" elif level == 0: return ""
elif level == 1: return "figli%s" % gender elif level == 1: return "figli%s" % gender
elif level == 2: return "nipote" elif level == 2: return "nipote"
@ -102,7 +101,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
def get_uncle (self, level, gender="o"): def get_uncle (self, level, gender="o"):
if level>len(_level)-1: if level>len(_level)-1:
return _("remote ancestor") return "remote ancestor"
elif level == 0: return "" elif level == 0: return ""
elif level == 1: return "fratello" elif level == 1: return "fratello"
elif level == 2: return "zi%s" % gender elif level == 2: return "zi%s" % gender
@ -115,7 +114,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
def get_nephew (self,level, gender="o"): def get_nephew (self,level, gender="o"):
if level>len(_level)-1: if level>len(_level)-1:
return _("remote descendant") return "remote descendant"
elif level == 0: return "" elif level == 0: return ""
elif level == 1: return "nipote" elif level == 1: return "nipote"
elif level == 2: return "pronipote" elif level == 2: return "pronipote"
@ -126,7 +125,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
def get_male_cousin (self,levelA, levelB, gender="o"): def get_male_cousin (self,levelA, levelB, gender="o"):
if levelA+levelB>len(_level): if levelA+levelB>len(_level):
return _("remote relative") return "remote relative"
else: else:
return "cugin%s di %so grado (%i-%i)" \ return "cugin%s di %so grado (%i-%i)" \
% (gender, _level[levelA+levelB-1], levelA, levelB) % (gender, _level[levelA+levelB-1], levelA, levelB)