From 37b30dbc2ca7f3a08990b1d306098ca74dadae5e Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Fri, 20 Aug 2004 21:55:29 +0000 Subject: [PATCH] * 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 --- ChangeLog | 17 +++++++++++++++++ src/plugins/Ancestors.py | 2 +- src/plugins/IndivComplete.py | 4 ++-- src/plugins/RelGraph.py | 4 ++-- src/plugins/TimeLine.py | 4 ++-- src/plugins/Verify.py | 15 ++++++++++++--- src/plugins/WebPage.py | 4 ++-- src/plugins/WriteFtree.py | 4 ++-- src/plugins/rel_it.py | 13 ++++++------- 9 files changed, 46 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 59d752d7a..61d440d75 100644 --- a/ChangeLog +++ b/ChangeLog @@ -47,6 +47,23 @@ * src/plugins/TimeLine.py: Use self.doc.string_width() method. * 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 * src/RelLib.py (Event.are_equal): Fixed comparison with None. diff --git a/src/plugins/Ancestors.py b/src/plugins/Ancestors.py index 437b22c47..ff06b0497 100644 --- a/src/plugins/Ancestors.py +++ b/src/plugins/Ancestors.py @@ -671,7 +671,7 @@ class ComprehensiveAncestorsReport (Report.Report): type = primary.get_type () if type != 'Birth Name': - name += ' (%s)' % type + name += ' (%s)' % const.NameTypesMap.find_value (type) name += self.cite_sources (primary.get_source_references ()) return name diff --git a/src/plugins/IndivComplete.py b/src/plugins/IndivComplete.py index 507433f52..21f7f9f6b 100644 --- a/src/plugins/IndivComplete.py +++ b/src/plugins/IndivComplete.py @@ -729,11 +729,11 @@ def _get_report_filters(person): des = GenericFilter.GenericFilter() 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.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.set_name(_("Entire Database")) diff --git a/src/plugins/RelGraph.py b/src/plugins/RelGraph.py index 8ba531e18..4c41ff51a 100644 --- a/src/plugins/RelGraph.py +++ b/src/plugins/RelGraph.py @@ -151,7 +151,7 @@ class RelGraphDialog(Report.ReportDialog): des = GenericFilter.GenericFilter() 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.set_name(_("Descendant family members of %s") % name) @@ -159,7 +159,7 @@ class RelGraphDialog(Report.ReportDialog): ans = GenericFilter.GenericFilter() 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.set_name(_("People with common ancestor with %s") % name) diff --git a/src/plugins/TimeLine.py b/src/plugins/TimeLine.py index 95ee1f12c..1d83518cc 100644 --- a/src/plugins/TimeLine.py +++ b/src/plugins/TimeLine.py @@ -375,11 +375,11 @@ def _get_report_filters(person): des = GenericFilter.GenericFilter() 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.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.set_name(_("People with common ancestor with %s") % name) diff --git a/src/plugins/Verify.py b/src/plugins/Verify.py index 0d38d52fb..8525f0e42 100644 --- a/src/plugins/Verify.py +++ b/src/plugins/Verify.py @@ -40,7 +40,6 @@ import cStringIO # GNOME/GTK modules # #------------------------------------------------------------------------ -from gnome.ui import * import gtk import gtk.glade @@ -118,7 +117,7 @@ class Verify: event = self.db.find_event_from_handle(event_handle) dateObj = event.get_date_object() if dateObj: - if dateObj.get_calendar().NAME != Gregorian.Gregorian: + if dateObj.get_calendar().NAME != Gregorian.NAME: dateObj.set_calendar(Gregorian.Gregorian) year = dateObj.get_year() return year @@ -156,6 +155,16 @@ class Verify: bapyear = 0 dyear = self.get_year( person.get_death_handle() ) 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 > bapyear: if person.get_gender() == RelLib.Person.male: @@ -450,7 +459,7 @@ class Verify: if error: text = _("ERRORS:\n") + error.getvalue() + "\n" if warn: - text = _("WARNINGS:\n") + warn.getvalue() + text = text + _("WARNINGS:\n") + warn.getvalue() error.close() warn.close() diff --git a/src/plugins/WebPage.py b/src/plugins/WebPage.py index 2e942102c..16d81bddb 100644 --- a/src/plugins/WebPage.py +++ b/src/plugins/WebPage.py @@ -1217,7 +1217,7 @@ class WebReportDialog(Report.ReportDialog): des = GenericFilter.GenericFilter() 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.set_name(_("Descendant Families of %s") % name) @@ -1225,7 +1225,7 @@ class WebReportDialog(Report.ReportDialog): ans = GenericFilter.GenericFilter() 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] diff --git a/src/plugins/WriteFtree.py b/src/plugins/WriteFtree.py index aa06c06b1..df6b58453 100644 --- a/src/plugins/WriteFtree.py +++ b/src/plugins/WriteFtree.py @@ -109,11 +109,11 @@ class FtreeWriter: des = GenericFilter.GenericFilter() 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.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.set_name(_("People with common ancestor with %s") % diff --git a/src/plugins/rel_it.py b/src/plugins/rel_it.py index 3358207bb..00c4820c3 100644 --- a/src/plugins/rel_it.py +++ b/src/plugins/rel_it.py @@ -34,7 +34,6 @@ import RelLib import Relationship import types -from gettext import gettext as _ #------------------------------------------------------------------------- @@ -71,13 +70,13 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): #------------------------------------------------------------------------- def get_parents (self,level): if level>len(_level)-1: - return _("remote ancestors") + return "remote ancestors" else: return "%si genitori" % _level[level] def get_father (self,level, gender="o"): if level>len(_level)-1: - return _("remote ancestor") + return "remote ancestor" elif level == 0: return "" elif level == 1: return "padre" elif level == 2: return "nonn%s" % gender @@ -90,7 +89,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): def get_son (self, level, gender="o"): if level>len(_level)-1: - return _("remote descendant") + return "remote descendant" elif level == 0: return "" elif level == 1: return "figli%s" % gender elif level == 2: return "nipote" @@ -102,7 +101,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): def get_uncle (self, level, gender="o"): if level>len(_level)-1: - return _("remote ancestor") + return "remote ancestor" elif level == 0: return "" elif level == 1: return "fratello" elif level == 2: return "zi%s" % gender @@ -115,7 +114,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): def get_nephew (self,level, gender="o"): if level>len(_level)-1: - return _("remote descendant") + return "remote descendant" elif level == 0: return "" elif level == 1: return "nipote" elif level == 2: return "pronipote" @@ -126,7 +125,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): def get_male_cousin (self,levelA, levelB, gender="o"): if levelA+levelB>len(_level): - return _("remote relative") + return "remote relative" else: return "cugin%s di %so grado (%i-%i)" \ % (gender, _level[levelA+levelB-1], levelA, levelB)