From 5d6af8923f87b5746ba0b4ea2063a12e4ae94a3d Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sun, 19 Jul 2015 11:32:37 -0400 Subject: [PATCH] 8725: Create Filter from the [xxxxx] selected, in Clipboard (and add use_regex) --- gramps/gui/makefilter.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gramps/gui/makefilter.py b/gramps/gui/makefilter.py index ca3d5ae47..23623a2a5 100644 --- a/gramps/gui/makefilter.py +++ b/gramps/gui/makefilter.py @@ -35,7 +35,7 @@ def make_filter(dbstate, uistate, objclass, gramps_ids, title=None): >>> make_filter(dbstate, uistate, 'Person', ['I0003', ...]) """ FilterClass = GenericFilterFactory(objclass) - rule = getattr(getattr(rules, objclass),'RegExpIdOf') + rule = getattr(getattr(rules, objclass.lower()),'RegExpIdOf') filter = FilterClass() if title is None: title = _("Filter %s from Clipboard") % objclass @@ -48,7 +48,9 @@ def make_filter(dbstate, uistate, objclass, gramps_ids, title=None): 'month': struct_time.tm_mon, 'day': struct_time.tm_mday}) re = "|".join(["^%s$" % gid for gid in sorted(gramps_ids)]) - filter.add_rule(rule([re])) + re_rule = rule([re]) + re_rule.use_regex = True + filter.add_rule(re_rule) filterdb = FilterList(CUSTOM_FILTERS) filterdb.load() EditFilter(objclass, dbstate, uistate, [],