diff --git a/src/ExportOptions.py b/src/ExportOptions.py index a0f3aa776..25e3e8055 100644 --- a/src/ExportOptions.py +++ b/src/ExportOptions.py @@ -39,7 +39,7 @@ from gen.ggettext import gettext as _ from gen.ggettext import ngettext import config from gen.display.name import displayer as name_displayer -from gen.filters import GenericFilter, Rules +from gen.filters import GenericFilter, rules from gui.utils import ProgressMeter class Progress(object): @@ -422,21 +422,21 @@ class WriterOptionBox(object): des = GenericFilter() # feature request 2356: avoid genitive form des.set_name(_("Descendants of %s") % name) - des.add_rule(Rules.Person.IsDescendantOf([gramps_id, 1])) + des.add_rule(rules.person.IsDescendantOf([gramps_id, 1])) df = GenericFilter() # feature request 2356: avoid genitive form df.set_name(_("Descendant Families of %s") % name) - df.add_rule(Rules.Person.IsDescendantFamilyOf([gramps_id, 1])) + df.add_rule(rules.person.IsDescendantFamilyOf([gramps_id, 1])) ans = GenericFilter() # feature request 2356: avoid genitive form ans.set_name(_("Ancestors of %s") % name) - ans.add_rule(Rules.Person.IsAncestorOf([gramps_id, 1])) + ans.add_rule(rules.person.IsAncestorOf([gramps_id, 1])) com = GenericFilter() com.set_name(_("People with common ancestor with %s") % name) - com.add_rule(Rules.Person.HasCommonAncestorWith([gramps_id])) + com.add_rule(rules.person.HasCommonAncestorWith([gramps_id])) return [des, df, ans, com] diff --git a/src/gen/filters/_filterparser.py b/src/gen/filters/_filterparser.py index 1eee152b3..85352caae 100644 --- a/src/gen/filters/_filterparser.py +++ b/src/gen/filters/_filterparser.py @@ -139,11 +139,11 @@ class FilterParser(handler.ContentHandler): Upgrade argument lists to latest version. """ # HasPlace rule has extra locality field in v3.3 - if self.r == Rules.Place.HasPlace and len(self.a) == 8: + if self.r == rules.place.HasPlace and len(self.a) == 8: self.a = self.a[0:2] + [u''] + self.a[4:8] + [self.a[3]] + \ [self.a[2]] # HasNameOf rule has new fields for surnames in v3.3 - if self.r == Rules.Person.HasNameOf and len(self.a) == 7: + if self.r == rules.person.HasNameOf and len(self.a) == 7: self.a = self.a[0:2] + [self.a[3]] + [self.a[2]] + [self.a[6]] + \ [u''] + [self.a[4]] + [u'', u''] + [self.a[5]] + \ [u'', u'0'] diff --git a/src/gen/plug/report/utils.py b/src/gen/plug/report/utils.py index 7592a200f..6722c42a5 100644 --- a/src/gen/plug/report/utils.py +++ b/src/gen/plug/report/utils.py @@ -247,7 +247,7 @@ def get_person_filters(person, include_single=True): @param include_single: include a filter to include the single person @type person: boolean """ - from gen.filters import GenericFilter, Rules, CustomFilters + from gen.filters import GenericFilter, rules, CustomFilters from gen.display.name import displayer as name_displayer if person: @@ -261,30 +261,30 @@ def get_person_filters(person, include_single=True): if include_single: filt_id = GenericFilter() filt_id.set_name(name) - filt_id.add_rule(Rules.Person.HasIdOf([gramps_id])) + filt_id.add_rule(rules.person.HasIdOf([gramps_id])) all = GenericFilter() all.set_name(_("Entire Database")) - all.add_rule(Rules.Person.Everyone([])) + all.add_rule(rules.person.Everyone([])) des = GenericFilter() # feature request 2356: avoid genitive form des.set_name(_("Descendants of %s") % name) - des.add_rule(Rules.Person.IsDescendantOf([gramps_id, 1])) + des.add_rule(rules.person.IsDescendantOf([gramps_id, 1])) df = GenericFilter() # feature request 2356: avoid genitive form df.set_name(_("Descendant Families of %s") % name) - df.add_rule(Rules.Person.IsDescendantFamilyOf([gramps_id, 1])) + df.add_rule(rules.person.IsDescendantFamilyOf([gramps_id, 1])) ans = GenericFilter() # feature request 2356: avoid genitive form ans.set_name(_("Ancestors of %s") % name) - ans.add_rule(Rules.Person.IsAncestorOf([gramps_id, 1])) + ans.add_rule(rules.person.IsAncestorOf([gramps_id, 1])) com = GenericFilter() com.set_name(_("People with common ancestor with %s") % name) - com.add_rule(Rules.Person.HasCommonAncestorWith([gramps_id])) + com.add_rule(rules.person.HasCommonAncestorWith([gramps_id])) if include_single: the_filters = [filt_id, all, des, df, ans, com] diff --git a/src/plugins/lib/libgedcom.py b/src/plugins/lib/libgedcom.py index a3a5de5c7..6c2d6a11b 100644 --- a/src/plugins/lib/libgedcom.py +++ b/src/plugins/lib/libgedcom.py @@ -120,7 +120,7 @@ from gen.updatecallback import UpdateCallback import gen.mime import LdsUtils import Utils -import gen.datehandler._dateparser as DateParser +from gen.datehandler._dateparser import DateParser from gen.db.dbconst import EVENT_KEY from QuestionDialog import WarningDialog from gen.lib.const import IDENTICAL, DIFFERENT