From 12fd97eaab22238934b4e7a3ccd7dce64435d878 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Sun, 11 Aug 2013 14:12:24 +0000 Subject: [PATCH] Automatic update for old rules using regular expressions svn: r22854 --- gramps/gen/filters/_filterparser.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gramps/gen/filters/_filterparser.py b/gramps/gen/filters/_filterparser.py index 4a116aaf7..8c59ff719 100644 --- a/gramps/gen/filters/_filterparser.py +++ b/gramps/gen/filters/_filterparser.py @@ -155,6 +155,18 @@ class FilterParser(handler.ContentHandler): self.a = self.a[0:2] + [self.a[3]] + [self.a[2]] + [self.a[6]] + \ [''] + [self.a[4]] + ['', ''] + [self.a[5]] + \ ['', '0'] + # New regular expression code in v3.4 + if (self.r in (rules.person.HasNameOf, + rules.family.FatherHasNameOf, + rules.family.MotherHasNameOf, + rules.family.ChildHasNameOf) + and len(self.a) == 12): + self.use_regex = self.a[11] == '1' + self.a = self.a[:11] + if (self.r == rules.person.HasTextMatchingSubstringOf + and len(self.a) == 3): + self.use_regex = self.a[2] == '1' + self.a = self.a[:2] #------------------------------------------------------------------------- #