From: Gerald B. <ger...@gm...> - 2008-12-30 13:43:16
|
It is a bug in date.py. I have been working on it off and on but hope to finish up soon. On 12/30/08, Jérôme <rom...@ya...> wrote: > Hi, > > > I tested 'trunk' and this only occurs with 3.0.4 ... > I guess Doug made changes on trunk (date.py) which ignore negative values ! > > To reproduce it on stable branch, maybe: > 1. to add a birth date : 1794 month day > 2. set French Republican/Revolutionar calendar on Date Editor for birth > (year should be something like 1/2 or 3) > 2. add a death date : 1850 month day > > 2-1850 = -1848 ! > > > Note: seems that your plugin 'enlighted' few errors (seizure issue) on > my data, thanks ! It will be great if we could add it on Verify.py > plugin (tool). > > *Person married at youngest age* > Seems I used the same date for birth and marriage, the 'Verify data' > tool was not able to find this mistake on my data ... > > I tried to add rules, but I do not understand why there is too much > values :( Maybe related to type attribute on date (about, before, after) > like sidebar filter on dates ? > > > Index: Verify.py > =================================================================== > --- Verify.py (révision 11533) > +++ Verify.py (copie de travail) > @@ -409,6 +409,8 @@ > UnknownGender(self.db,person), > MultipleParents(self.db,person), > MarriedOften(self.db,person,wedder), > + MarriageAtBirth(self.db, person), > + MarriageAtDeath(self.db, person), > OldUnmarried(self.db,person, oldunm,estimate_age), > TooManyChildren(self.db,person,mxchilddad,mxchildmom), > Disconnected(self.db,person), > > @@ -1567,7 +1572,37 @@ > > def get_message(self): > return _("Invalid death date") > + > +class MarriageAtBirth(PersonRule): > + ID = 31 > + SEVERITY = Rule.ERROR > + def __init__(self, db, obj,): > + PersonRule.__init__(self, db, obj) > > + def broken(self): > + marr_date = get_marriage_date(self.db, self.obj) > + birth_date = get_birth_date(self.db, self.obj) > + if birth_date == marr_date: > + return True > + > + def get_message(self): > + return _("Marriage at birth") > + > +class MarriageAtDeath(PersonRule): > + ID = 32 > + SEVERITY = Rule.ERROR > + def __init__(self, db, obj,): > + PersonRule.__init__(self, db, obj) > + > + def broken(self): > + marr_date = get_marriage_date(self.db, self.obj) > + death_date = get_death_date(self.db, self.obj) > + if death_date == marr_date: > + return True > + > + def get_message(self): > + return _("Marriage at death") > + > > > Reinhard Müller a écrit : >> Hi, >> >> Am Montag, den 29.12.2008, 19:06 +0100 schrieb Jérôme: >>> I just need to add a test because dates could use "non-default" >>> calendars. A diff between two dates using differents calendars returns >>> a wrong value. :( >> >> Hm. I just subtract the date objects - I would have expected the >> subtraction routine to handle this. Is this a bug in date.py? >> >> Thanks, >> Reinhard > -- Sent from my mobile device |