diff --git a/ChangeLog b/ChangeLog index 4a5a8bc8a..3be95c520 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-08-16 Alex Roitman + * src/plugins/Verify.py (Disconnected): Add verification rule; + (Verify.run_tool): Use the new rule. + * src/Filters/Rules/Person/_Disconnected.py (apply): Fix rule. + 2006-08-15 Don Allingham * src/GrampsDb/_WriteGedcom.py: support for AGE, CAUSE, and AGENCY * src/GrampsDb/_ReadGedcom.py: support for AGE, CAUSE, and AGENCY diff --git a/src/Filters/Rules/Person/_Disconnected.py b/src/Filters/Rules/Person/_Disconnected.py index c33dbc0f7..b2d92a785 100644 --- a/src/Filters/Rules/Person/_Disconnected.py +++ b/src/Filters/Rules/Person/_Disconnected.py @@ -48,5 +48,5 @@ class Disconnected(Rule): 'to any other person in the database') def apply(self,db,person): - return (len(person.get_main_parents_family_handle()) + return (len(person.get_parent_family_handle_list()) + len(person.get_family_handle_list()) == 0) diff --git a/src/plugins/Verify.py b/src/plugins/Verify.py index 5efe1dcc2..726d16ab9 100644 --- a/src/plugins/Verify.py +++ b/src/plugins/Verify.py @@ -379,6 +379,7 @@ class Verify(Tool.Tool, ManagedWindow, UpdateCallback): MarriedOften(self.db,person,wedder), OldUnmarried(self.db,person,oldunm,estimate_age), TooManyChildren(self.db,person,mxchilddad,mxchildmom), + Disconnected(self.db,person), ] for rule in rule_list: @@ -1448,6 +1449,16 @@ class LargeChildrenAgeDiff(FamilyRule): def get_message(self): return _("Large age differences between children") +class Disconnected(PersonRule): + ID = 28 + SEVERITY = Rule.WARNING + def broken(self): + return (len(self.obj.get_parent_family_handle_list()) + + len(self.obj.get_family_handle_list()) == 0) + + def get_message(self): + return _("Disconnected individual") + #------------------------------------------------------------------------- # #