* src/plugins/Verify.py (on_apply_clicked): Use gramps id for
display; (get_year): Corrections. svn: r3464
This commit is contained in:
parent
e2359e9c19
commit
9406b8fdcf
@ -28,6 +28,9 @@
|
||||
* src/GrampsDbBase.py (find_event_from_handle):
|
||||
Add transaction argument
|
||||
|
||||
* src/plugins/Verify.py (on_apply_clicked): Use gramps id for
|
||||
display; (get_year): Corrections.
|
||||
|
||||
2004-08-20 Don Allingham <dallingham@users.sourceforge.net>
|
||||
* src/gramps_main.py: update family display after EditPerson
|
||||
* src/EditPerson.py: fix callback
|
||||
|
@ -117,7 +117,7 @@ class Verify:
|
||||
event = self.db.get_event_from_handle(event_handle)
|
||||
dateObj = event.get_date_object()
|
||||
if dateObj:
|
||||
if dateObj.get_calendar().NAME != Gregorian.NAME:
|
||||
if dateObj.get_calendar().NAME != Gregorian.Gregorian.NAME:
|
||||
dateObj.set_calendar(Gregorian.Gregorian)
|
||||
year = dateObj.get_year()
|
||||
return year
|
||||
@ -147,7 +147,7 @@ class Verify:
|
||||
|
||||
for person_handle in personList:
|
||||
person = self.db.get_person_from_handle(person_handle)
|
||||
idstr = "%s (%s)" % (person.get_primary_name().get_name(),person_handle)
|
||||
idstr = "%s (%s)" % (person.get_primary_name().get_name(),person.get_gramps_id())
|
||||
|
||||
# individual checks
|
||||
ageatdeath = 0
|
||||
@ -161,9 +161,9 @@ class Verify:
|
||||
event = self.db.get_event_from_handle(event_handle)
|
||||
event_name = event.get_name().lower()
|
||||
if event.get_name() == "burial":
|
||||
buryear = get_year( event )
|
||||
buryear = self.get_year( event.get_handle() )
|
||||
elif event_name == "baptism":
|
||||
bapyear = get_year( event )
|
||||
bapyear = self.get_year( event.get_handle() )
|
||||
|
||||
if byear>0 and bapyear>0:
|
||||
if byear > bapyear:
|
||||
@ -292,11 +292,11 @@ class Verify:
|
||||
father = self.db.get_person_from_handle(father_handle)
|
||||
if mother_handle and father_handle:
|
||||
if ( mother.get_gender() == father.get_gender() ) and mother.get_gender() != RelLib.Person.unknown:
|
||||
warn.write( _("Homosexual marriage: %s in family %s.\n") % ( idstr, family.get_handle() ) )
|
||||
warn.write( _("Homosexual marriage: %s in family %s.\n") % ( idstr, family.get_gramps_id() ) )
|
||||
if father_handle == person.get_handle() and person.get_gender() == RelLib.Person.female:
|
||||
error.write( _("Female husband: %s in family %s.\n") % ( idstr, family.get_handle() ) )
|
||||
error.write( _("Female husband: %s in family %s.\n") % ( idstr, family.get_gramps_id() ) )
|
||||
if mother_handle == person.get_handle() and person.get_gender() == RelLib.Person.male:
|
||||
error.write( _("Male wife: %s in family %s.\n") % ( idstr, family.get_handle() ) )
|
||||
error.write( _("Male wife: %s in family %s.\n") % ( idstr, family.get_gramps_id() ) )
|
||||
if father_handle == person.get_handle():
|
||||
spouse_id = mother_handle
|
||||
else:
|
||||
@ -306,12 +306,12 @@ class Verify:
|
||||
if person.get_gender() == RelLib.Person.male and \
|
||||
person.get_primary_name().get_surname() == spouse.get_primary_name().get_surname():
|
||||
warn.write( _("Husband and wife with the same surname: %s in family %s, and %s.\n") % (
|
||||
idstr,family.get_handle(), spouse.get_primary_name().get_name() ) )
|
||||
idstr,family.get_gramps_id(), spouse.get_primary_name().get_name() ) )
|
||||
sdyear = self.get_year( spouse.get_death_handle() )
|
||||
sbyear = self.get_year( spouse.get_birth_handle() )
|
||||
if abs(sbyear-byear) > hwdif:
|
||||
warn.write( _("Large age difference between husband and wife: %s in family %s, and %s.\n") % (
|
||||
idstr,family.get_handle(), spouse.get_primary_name().get_name() ) )
|
||||
idstr,family.get_gramps_id(), spouse.get_primary_name().get_name() ) )
|
||||
|
||||
if sdyear == 0:
|
||||
sdyear = 0 # burial year
|
||||
@ -384,9 +384,9 @@ class Verify:
|
||||
wdwyear = maryear-prev_sdyear
|
||||
if wdwyear > lngwdw:
|
||||
if person.get_gender() == RelLib.Person.male:
|
||||
warn.write( _("Long widowhood: %s was a widower %d years before, family %s.\n") % (idstr, wdwyear, family.get_handle() ) )
|
||||
warn.write( _("Long widowhood: %s was a widower %d years before, family %s.\n") % (idstr, wdwyear, family.get_gramps_id() ) )
|
||||
if person.get_gender() == RelLib.Person.female:
|
||||
warn.write( _("Long widowhood: %s was a widow %d years before, family %s.\n") % (idstr, wdwyear, family.get_handle() ) )
|
||||
warn.write( _("Long widowhood: %s was a widow %d years before, family %s.\n") % (idstr, wdwyear, family.get_gramps_id() ) )
|
||||
|
||||
if fnum==nfam and dyear>0 and sdyear>0:
|
||||
wdwyear = dyear - sdyear
|
||||
@ -414,46 +414,46 @@ class Verify:
|
||||
'male_name' : idstr, 'bage' : bage, 'fam' : family.get_handle(), 'child' : child.get_primary_name().get_name() } )
|
||||
if person.get_gender() == RelLib.Person.female:
|
||||
warn.write( _("Old mother: %(female_name)s at age of %(bage)d in family %(fam)s had a child %(child)s.\n") % {
|
||||
'female_name' : idstr, 'bage' : bage, 'fam' : family.get_handle(), 'child' : child.get_primary_name().get_name() } )
|
||||
'female_name' : idstr, 'bage' : bage, 'fam' : family.get_gramps_id(), 'child' : child.get_primary_name().get_name() } )
|
||||
if bage < 0:
|
||||
if person.get_gender() == RelLib.Person.male:
|
||||
error.write( _("Unborn father: %(male_name)s born %(byear)d, in family %(fam)s had a child %(child)s born %(cbyear)d.\n") % {
|
||||
'male_name' : idstr, 'byear' : byear, 'fam' : family.get_handle(), 'child' : child.get_primary_name().get_name(), 'cbyear' : cbyear } )
|
||||
'male_name' : idstr, 'byear' : byear, 'fam' : family.get_gramps_id(), 'child' : child.get_primary_name().get_name(), 'cbyear' : cbyear } )
|
||||
if person.get_gender() == RelLib.Person.female:
|
||||
error.write( _("Unborn mother: %(female_name)s born %(byear)d, in family %(fam)s had a child %(child)s born %(cbyear)d.\n") % {
|
||||
'female_name' : idstr, 'byear' : byear, 'fam' : family.get_handle(), 'child' : child.get_primary_name().get_name(), 'cbyear' : cbyear } )
|
||||
'female_name' : idstr, 'byear' : byear, 'fam' : family.get_gramps_id(), 'child' : child.get_primary_name().get_name(), 'cbyear' : cbyear } )
|
||||
else:
|
||||
if bage < yngpar:
|
||||
if person.get_gender() == RelLib.Person.male:
|
||||
warn.write( _("Young father: %(male_name)s at the age of %(bage)d in family %(fam)s had a child %(child)s.\n") % {
|
||||
'male_name' : idstr, 'bage' : bage, 'fam' : family.get_handle(), 'child' : child.get_primary_name().get_name() } )
|
||||
'male_name' : idstr, 'bage' : bage, 'fam' : family.get_gramps_id(), 'child' : child.get_primary_name().get_name() } )
|
||||
if person.get_gender() == RelLib.Person.female:
|
||||
warn.write( _("Young mother: %(female_name)s at the age of %(bage)d in family %(fam)s had a child %(child)s.\n") % {
|
||||
'female_name' : idstr, 'bage' : bage, 'fam' : family.get_handle(), 'child' : child.get_primary_name().get_name() } )
|
||||
'female_name' : idstr, 'bage' : bage, 'fam' : family.get_gramps_id(), 'child' : child.get_primary_name().get_name() } )
|
||||
if dyear>0 and cbyear>dyear:
|
||||
if cbyear-1>dyear:
|
||||
if person.get_gender() == RelLib.Person.male:
|
||||
error.write( _("Dead father: %(male_name)s died %(dyear)d, but in family %(fam)s had a child %(child)s born %(cbyear)d.\n") % {
|
||||
'male_name' : idstr, 'dyear' : dyear, 'fam' : family.get_handle(), 'child' : child.get_primary_name().get_name(), 'cbyear' : cbyear} )
|
||||
'male_name' : idstr, 'dyear' : dyear, 'fam' : family.get_gramps_id(), 'child' : child.get_primary_name().get_name(), 'cbyear' : cbyear} )
|
||||
if person.get_gender() == RelLib.Person.female:
|
||||
error.write( _("Dead mother: %(female_name)s died %(dyear)d, but in family %(fam)s had a child %(child)s born %(cbyear)d.\n") % {
|
||||
'female_name' : idstr, 'dyear' : dyear, 'fam' : family.get_handle(), 'child' : child.get_primary_name().get_name(), 'cbyear' : cbyear} )
|
||||
'female_name' : idstr, 'dyear' : dyear, 'fam' : family.get_gramps_id(), 'child' : child.get_primary_name().get_name(), 'cbyear' : cbyear} )
|
||||
else:
|
||||
if person.get_gender() == RelLib.Person.male:
|
||||
warn.write( _("Dead father: %(male_name)s died %(dyear)d, but in family %(fam)s had a child %(child)s born %(cbyear)d.\n") % {
|
||||
'male_name' : idstr, 'dyear' : dyear, 'fam' : family.get_handle(), 'child' : child.get_primary_name().get_name(), 'cbyear' : cbyear} )
|
||||
'male_name' : idstr, 'dyear' : dyear, 'fam' : family.get_gramps_id(), 'child' : child.get_primary_name().get_name(), 'cbyear' : cbyear} )
|
||||
if person.get_gender() == RelLib.Person.female:
|
||||
warn.write( _("Dead mother: %(female_name)s died %(dyear)d, but in family %(fam)s had a child %(child)s born %(cbyear)d.\n") % {
|
||||
'female_name' : idstr, 'dyear' : dyear, 'fam' : family.get_handle(), 'child' : child.get_primary_name().get_name(), 'cbyear' : cbyear} )
|
||||
'female_name' : idstr, 'dyear' : dyear, 'fam' : family.get_gramps_id(), 'child' : child.get_primary_name().get_name(), 'cbyear' : cbyear} )
|
||||
|
||||
if cbyears:
|
||||
cbyears.sort()
|
||||
if (cbyears[-1] - cbyears[0]) > cbspan:
|
||||
warn.write(_("Large year span for all children: family %s.\n") % family.get_handle() )
|
||||
warn.write(_("Large year span for all children: family %s.\n") % family.get_gramps_id() )
|
||||
if len(cbyears) > 1:
|
||||
cby_diff = [ cbyears[i+1]-cbyears[i] for i in range(len(cbyears)-1) ]
|
||||
if max(cby_diff) > cspace:
|
||||
warn.write(_("Large age differences between children: family %s.\n") % family.get_handle() )
|
||||
warn.write(_("Large age differences between children: family %s.\n") % family.get_gramps_id() )
|
||||
|
||||
text = ""
|
||||
if error:
|
||||
|
Loading…
Reference in New Issue
Block a user