diff --git a/po/POTFILES.in b/po/POTFILES.in index b0e8129a2..2bfea12ff 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -479,6 +479,7 @@ src/Filters/_SearchBar.py src/Filters/_SearchFilter.py # Filters.Rules package +src/Filters/Rules/_ChangedSinceBase.py src/Filters/Rules/_Everything.py src/Filters/Rules/_HasAttributeBase.py src/Filters/Rules/_HasEventBase.py @@ -496,6 +497,7 @@ src/Filters/Rules/_Rule.py src/Filters/Rules/_HasMarkerBase.py # Filters.Rules.Person package +src/Filters/Rules/Person/_ChangedSince.py src/Filters/Rules/Person/_Disconnected.py src/Filters/Rules/Person/_Everyone.py src/Filters/Rules/Person/_FamilyWithIncompleteEvent.py @@ -568,6 +570,7 @@ src/Filters/Rules/Person/_SearchName.py # Filters.Rules.Family package src/Filters/Rules/Family/__init__.py src/Filters/Rules/Family/_AllFamilies.py +src/Filters/Rules/Family/_ChangedSince.py src/Filters/Rules/Family/_ChildHasIdOf.py src/Filters/Rules/Family/_ChildHasNameOf.py src/Filters/Rules/Family/_FamilyPrivate.py @@ -600,6 +603,7 @@ src/Filters/Rules/Family/_RegExpIdOf.py # Filters.Rules.Event package src/Filters/Rules/Event/_AllEvents.py +src/Filters/Rules/Event/_ChangedSince.py src/Filters/Rules/Event/_EventPrivate.py src/Filters/Rules/Event/_HasAttribute.py src/Filters/Rules/Event/_HasData.py @@ -619,6 +623,7 @@ src/Filters/Rules/Event/__init__.py # Filters.Rules.Place package src/Filters/Rules/Place/_AllPlaces.py +src/Filters/Rules/Place/_ChangedSince.py src/Filters/Rules/Place/_HasGallery.py src/Filters/Rules/Place/_HasIdOf.py src/Filters/Rules/Place/_HasNoLatOrLon.py @@ -636,6 +641,7 @@ src/Filters/Rules/Place/__init__.py # Filters.Rules.Source package src/Filters/Rules/Source/_AllSources.py +src/Filters/Rules/Source/_ChangedSince.py src/Filters/Rules/Source/_HasGallery.py src/Filters/Rules/Source/_HasIdOf.py src/Filters/Rules/Source/_HasNote.py @@ -650,6 +656,7 @@ src/Filters/Rules/Source/__init__.py # Filters.Rules.MediaObject package src/Filters/Rules/MediaObject/_AllMedia.py +src/Filters/Rules/MediaObject/_ChangedSince.py src/Filters/Rules/MediaObject/_HasAttribute.py src/Filters/Rules/MediaObject/_HasIdOf.py src/Filters/Rules/MediaObject/_HasMedia.py @@ -663,6 +670,7 @@ src/Filters/Rules/MediaObject/__init__.py # Filters.Rules.Repository package src/Filters/Rules/Repository/_AllRepos.py +src/Filters/Rules/Repository/_ChangedSince.py src/Filters/Rules/Repository/_HasIdOf.py src/Filters/Rules/Repository/_HasNoteMatchingSubstringOf.py src/Filters/Rules/Repository/_HasNoteRegexp.py @@ -675,6 +683,7 @@ src/Filters/Rules/Repository/__init__.py # Filters.Rules.Note package src/Filters/Rules/Note/_AllNotes.py +src/Filters/Rules/Note/_ChangedSince.py src/Filters/Rules/Note/_HasIdOf.py src/Filters/Rules/Note/_HasMarkerOf.py src/Filters/Rules/Note/_MatchesSubstringOf.py diff --git a/src/Filters/Rules/Event/Makefile.am b/src/Filters/Rules/Event/Makefile.am index d34e2d383..86d1d1006 100644 --- a/src/Filters/Rules/Event/Makefile.am +++ b/src/Filters/Rules/Event/Makefile.am @@ -3,6 +3,7 @@ pkgdatadir = $(datadir)/@PACKAGE@/Filters/Rules/Event pkgdata_PYTHON = \ + _ChangedSince.py\ _MatchesFilter.py\ _EventPrivate.py\ _HasNoteRegexp.py\ diff --git a/src/Filters/Rules/Event/_ChangedSince.py b/src/Filters/Rules/Event/_ChangedSince.py new file mode 100644 index 000000000..4bc0ab1fe --- /dev/null +++ b/src/Filters/Rules/Event/_ChangedSince.py @@ -0,0 +1,26 @@ +#------------------------------------------------------------------------- +# +# Standard Python modules +# +#------------------------------------------------------------------------- +from gettext import gettext as _ + +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- +from Filters.Rules._ChangedSinceBase import ChangedSinceBase + +#------------------------------------------------------------------------- +# +# ChangedSince +# +#------------------------------------------------------------------------- +class ChangedSince(ChangedSinceBase): + """Rule that checks for an event changed since a specific time.""" + + name = _('Events changed before ') + description = _("Matches event records changed before a specified " + "date/time (yyyy-mm-dd hh:mm:ss) or in the range, if a second " + "date/time is given") diff --git a/src/Filters/Rules/Event/__init__.py b/src/Filters/Rules/Event/__init__.py index 378035a27..c3734dbec 100644 --- a/src/Filters/Rules/Event/__init__.py +++ b/src/Filters/Rules/Event/__init__.py @@ -43,6 +43,7 @@ from _MatchesPersonFilter import MatchesPersonFilter from _MatchesSourceFilter import MatchesSourceFilter from _HasAttribute import HasAttribute from _HasData import HasData +from _ChangedSince import ChangedSince editor_rule_list = [ AllEvents, @@ -62,4 +63,5 @@ editor_rule_list = [ MatchesSourceFilter, HasAttribute, HasData, + ChangedSince ] diff --git a/src/Filters/Rules/Family/Makefile.am b/src/Filters/Rules/Family/Makefile.am index aa16d5946..b1bd228a8 100644 --- a/src/Filters/Rules/Family/Makefile.am +++ b/src/Filters/Rules/Family/Makefile.am @@ -4,6 +4,7 @@ pkgdatadir = $(datadir)/@PACKAGE@/Filters/Rules/Family pkgdata_PYTHON = \ _AllFamilies.py\ + _ChangedSince.py\ _FamilyPrivate.py\ _HasEvent.py\ _HasAttribute.py\ diff --git a/src/Filters/Rules/Family/_ChangedSince.py b/src/Filters/Rules/Family/_ChangedSince.py new file mode 100644 index 000000000..befdfff49 --- /dev/null +++ b/src/Filters/Rules/Family/_ChangedSince.py @@ -0,0 +1,26 @@ +#------------------------------------------------------------------------- +# +# Standard Python modules +# +#------------------------------------------------------------------------- +from gettext import gettext as _ + +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- +from Filters.Rules._ChangedSinceBase import ChangedSinceBase + +#------------------------------------------------------------------------- +# +# ChangedSince +# +#------------------------------------------------------------------------- +class ChangedSince(ChangedSinceBase): + """Rule that checks for families changed since a specific time.""" + + name = _('Families changed before ') + description = _("Matches family records changed before a specified " + "date-time (yyyy-mm-dd hh:mm:ss) or in the range, if a second " + "date-time is given") diff --git a/src/Filters/Rules/Family/__init__.py b/src/Filters/Rules/Family/__init__.py index 8fd9c4db6..c34bfb03d 100644 --- a/src/Filters/Rules/Family/__init__.py +++ b/src/Filters/Rules/Family/__init__.py @@ -55,6 +55,7 @@ from _MotherHasNameOf import MotherHasNameOf from _MotherHasIdOf import MotherHasIdOf from _ChildHasNameOf import ChildHasNameOf from _ChildHasIdOf import ChildHasIdOf +from _ChangedSince import ChangedSince editor_rule_list = [ AllFamilies, @@ -80,4 +81,5 @@ editor_rule_list = [ MotherHasIdOf, ChildHasNameOf, ChildHasIdOf, + ChangedSince, ] diff --git a/src/Filters/Rules/Makefile.am b/src/Filters/Rules/Makefile.am index 5aaaf9488..ac0857e33 100644 --- a/src/Filters/Rules/Makefile.am +++ b/src/Filters/Rules/Makefile.am @@ -5,6 +5,7 @@ SUBDIRS = Person Family Event Place Source MediaObject Repository Note pkgdatadir = $(datadir)/@PACKAGE@/Filters/Rules pkgdata_PYTHON = \ + _ChangedSinceBase.py\ _Everything.py\ _HasEventBase.py\ _HasAttributeBase.py\ diff --git a/src/Filters/Rules/MediaObject/Makefile.am b/src/Filters/Rules/MediaObject/Makefile.am index 4b482ae4d..1be7ccfaa 100644 --- a/src/Filters/Rules/MediaObject/Makefile.am +++ b/src/Filters/Rules/MediaObject/Makefile.am @@ -4,6 +4,7 @@ pkgdatadir = $(datadir)/@PACKAGE@/Filters/Rules/MediaObject pkgdata_PYTHON = \ _AllMedia.py\ + _ChangedSince.py\ _HasIdOf.py\ _HasMedia.py\ _HasNoteMatchingSubstringOf.py\ diff --git a/src/Filters/Rules/MediaObject/_ChangedSince.py b/src/Filters/Rules/MediaObject/_ChangedSince.py new file mode 100644 index 000000000..502abcb8d --- /dev/null +++ b/src/Filters/Rules/MediaObject/_ChangedSince.py @@ -0,0 +1,26 @@ +#------------------------------------------------------------------------- +# +# Standard Python modules +# +#------------------------------------------------------------------------- +from gettext import gettext as _ + +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- +from Filters.Rules._ChangedSinceBase import ChangedSinceBase + +#------------------------------------------------------------------------- +# +# ChangedSince +# +#------------------------------------------------------------------------- +class ChangedSince(ChangedSinceBase): + """Rule that checks for media objects changed since a specific time""" + + name = _('Media objects changed before ') + description = _("Matches media objects changed before a specified " + "date:time (yyyy-mm-dd hh:mm:ss) or in the range, if a second " + "date:time is given") diff --git a/src/Filters/Rules/MediaObject/__init__.py b/src/Filters/Rules/MediaObject/__init__.py index 46711c26a..788c3edae 100644 --- a/src/Filters/Rules/MediaObject/__init__.py +++ b/src/Filters/Rules/MediaObject/__init__.py @@ -34,6 +34,7 @@ from _MediaPrivate import MediaPrivate from _MatchesFilter import MatchesFilter from _HasMedia import HasMedia from _HasAttribute import HasAttribute +from _ChangedSince import ChangedSince editor_rule_list = [ AllMedia, @@ -45,4 +46,5 @@ editor_rule_list = [ MediaPrivate, MatchesFilter, HasAttribute, + ChangedSince, ] diff --git a/src/Filters/Rules/Note/Makefile.am b/src/Filters/Rules/Note/Makefile.am index 054b2b0b2..b45053f3e 100644 --- a/src/Filters/Rules/Note/Makefile.am +++ b/src/Filters/Rules/Note/Makefile.am @@ -4,6 +4,7 @@ pkgdatadir = $(datadir)/@PACKAGE@/Filters/Rules/Note pkgdata_PYTHON = \ _AllNotes.py\ + _ChangedSince.py\ _HasIdOf.py\ _HasMarkerOf.py\ _MatchesSubstringOf.py\ diff --git a/src/Filters/Rules/Note/_ChangedSince.py b/src/Filters/Rules/Note/_ChangedSince.py new file mode 100644 index 000000000..b82231515 --- /dev/null +++ b/src/Filters/Rules/Note/_ChangedSince.py @@ -0,0 +1,26 @@ +#------------------------------------------------------------------------- +# +# Standard Python modules +# +#------------------------------------------------------------------------- +from gettext import gettext as _ + +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- +from Filters.Rules._ChangedSinceBase import ChangedSinceBase + +#------------------------------------------------------------------------- +# +# ChangedSince +# +#------------------------------------------------------------------------- +class ChangedSince(ChangedSinceBase): + """Rule that checks for notes changed since a specific time.""" + + name = _('Notes changed before ') + description = _("Matches note records changed since a specified " + "date-time (yyyy-mm-dd hh:mm:ss) or in the range, if a second " + "date-time is given") diff --git a/src/Filters/Rules/Note/__init__.py b/src/Filters/Rules/Note/__init__.py index ea01536f9..c0ef5511f 100644 --- a/src/Filters/Rules/Note/__init__.py +++ b/src/Filters/Rules/Note/__init__.py @@ -35,6 +35,7 @@ from _HasReferenceCountOf import HasReferenceCountOf from _NotePrivate import NotePrivate from _MatchesFilter import MatchesFilter from _HasNote import HasNote +from _ChangedSince import ChangedSince editor_rule_list = [ AllNotes, @@ -47,4 +48,5 @@ editor_rule_list = [ HasReferenceCountOf, NotePrivate, MatchesFilter, + ChangedSince, ] diff --git a/src/Filters/Rules/Person/Makefile.am b/src/Filters/Rules/Person/Makefile.am index 9a9cb9a15..b1906d279 100644 --- a/src/Filters/Rules/Person/Makefile.am +++ b/src/Filters/Rules/Person/Makefile.am @@ -3,6 +3,7 @@ pkgdatadir = $(datadir)/@PACKAGE@/Filters/Rules/Person pkgdata_PYTHON = \ + _ChangedSince.py\ _Disconnected.py \ _Everyone.py \ _FamilyWithIncompleteEvent.py \ diff --git a/src/Filters/Rules/Person/_ChangedSince.py b/src/Filters/Rules/Person/_ChangedSince.py new file mode 100644 index 000000000..02ccd5dbb --- /dev/null +++ b/src/Filters/Rules/Person/_ChangedSince.py @@ -0,0 +1,26 @@ +#------------------------------------------------------------------------- +# +# Standard Python modules +# +#------------------------------------------------------------------------- +from gettext import gettext as _ + +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- +from Filters.Rules._ChangedSinceBase import ChangedSinceBase + +#------------------------------------------------------------------------- +# +# ChangedSince +# +#------------------------------------------------------------------------- +class ChangedSince(ChangedSinceBase): + """Rule that checks for persons changed since a specific time.""" + + name = _('Persons changed after ') + description = _("Matches person records changed after a specified " + "date-time (yyyy-mm-dd hh:mm:ss) or in the range, if a second " + "date-time is given") diff --git a/src/Filters/Rules/Person/__init__.py b/src/Filters/Rules/Person/__init__.py index 20a9a4d2b..e492240e2 100644 --- a/src/Filters/Rules/Person/__init__.py +++ b/src/Filters/Rules/Person/__init__.py @@ -98,7 +98,7 @@ from _SearchName import SearchName from _RegExpName import RegExpName from _MatchIdOf import MatchIdOf from _RegExpIdOf import RegExpIdOf - +from _ChangedSince import ChangedSince #------------------------------------------------------------------------- # @@ -168,5 +168,6 @@ editor_rule_list = [ HasNoteMatchingSubstringOf, RegExpIdOf, Disconnected, + ChangedSince, ] diff --git a/src/Filters/Rules/Place/Makefile.am b/src/Filters/Rules/Place/Makefile.am index 99aa0170e..c5097315a 100644 --- a/src/Filters/Rules/Place/Makefile.am +++ b/src/Filters/Rules/Place/Makefile.am @@ -4,6 +4,7 @@ pkgdatadir = $(datadir)/@PACKAGE@/Filters/Rules/Place pkgdata_PYTHON = \ _AllPlaces.py\ + _ChangedSince.py\ _HasIdOf.py\ _HasNoLatOrLon.py\ _InLatLonNeighborhood.py\ diff --git a/src/Filters/Rules/Place/_ChangedSince.py b/src/Filters/Rules/Place/_ChangedSince.py new file mode 100644 index 000000000..e41d01cfb --- /dev/null +++ b/src/Filters/Rules/Place/_ChangedSince.py @@ -0,0 +1,26 @@ +#------------------------------------------------------------------------- +# +# Standard Python modules +# +#------------------------------------------------------------------------- +from gettext import gettext as _ + +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- +from Filters.Rules._ChangedSinceBase import ChangedSinceBase + +#------------------------------------------------------------------------- +# +# ChangedSince +# +#------------------------------------------------------------------------- +class ChangedSince(ChangedSinceBase): + """Rules that checks for places changed since a specific time.""" + + name = ('Places changed after ') + description = _("Matches place records changed after a specified " + "date-time (yyyy-mm-dd hh:mm:ss) or in the range, if a second " + "date-time is given") diff --git a/src/Filters/Rules/Place/__init__.py b/src/Filters/Rules/Place/__init__.py index 8c7eb28ee..d138b382c 100644 --- a/src/Filters/Rules/Place/__init__.py +++ b/src/Filters/Rules/Place/__init__.py @@ -39,6 +39,7 @@ from _HasPlace import HasPlace from _HasNoLatOrLon import HasNoLatOrLon from _InLatLonNeighborhood import InLatLonNeighborhood from _MatchesEventFilter import MatchesEventFilter +from _ChangedSince import ChangedSince editor_rule_list = [ AllPlaces, @@ -55,4 +56,5 @@ editor_rule_list = [ HasNoLatOrLon, InLatLonNeighborhood, MatchesEventFilter, + ChangedSince, ] diff --git a/src/Filters/Rules/Repository/Makefile.am b/src/Filters/Rules/Repository/Makefile.am index 7d3927c00..8d54903be 100644 --- a/src/Filters/Rules/Repository/Makefile.am +++ b/src/Filters/Rules/Repository/Makefile.am @@ -4,6 +4,7 @@ pkgdatadir = $(datadir)/@PACKAGE@/Filters/Rules/Repository pkgdata_PYTHON = \ _AllRepos.py\ + _ChangedSince.py\ _HasIdOf.py\ _HasNoteMatchingSubstringOf.py\ _HasNoteRegexp.py\ diff --git a/src/Filters/Rules/Repository/_ChangedSince.py b/src/Filters/Rules/Repository/_ChangedSince.py new file mode 100644 index 000000000..2f9aec638 --- /dev/null +++ b/src/Filters/Rules/Repository/_ChangedSince.py @@ -0,0 +1,26 @@ +#------------------------------------------------------------------------- +# +# Standard Python modules +# +#------------------------------------------------------------------------- +from gettext import gettext as _ + +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- +from Filters.Rules._ChangedSinceBase import ChangedSinceBase + +#------------------------------------------------------------------------- +# +# ChangedSince +# +#------------------------------------------------------------------------- +class ChangedSince(ChangedSinceBase): + """Rule that checks for repositories changed since a specific time.""" + + name = _('Repositories changed after ') + description = _("Matches repository records changed after a specified " + "date/time (yyyy-mm-dd hh:mm:ss) or in the range, if a second " + "date/time is given") diff --git a/src/Filters/Rules/Repository/__init__.py b/src/Filters/Rules/Repository/__init__.py index 986c82eed..c7b42f5ce 100644 --- a/src/Filters/Rules/Repository/__init__.py +++ b/src/Filters/Rules/Repository/__init__.py @@ -33,6 +33,7 @@ from _HasReferenceCountOf import HasReferenceCountOf from _RepoPrivate import RepoPrivate from _MatchesFilter import MatchesFilter from _HasRepo import HasRepo +from _ChangedSince import ChangedSince editor_rule_list = [ AllRepos, @@ -43,4 +44,5 @@ editor_rule_list = [ HasReferenceCountOf, RepoPrivate, MatchesFilter, + ChangedSince, ] diff --git a/src/Filters/Rules/Source/Makefile.am b/src/Filters/Rules/Source/Makefile.am index 50b695c6a..e01d623b1 100644 --- a/src/Filters/Rules/Source/Makefile.am +++ b/src/Filters/Rules/Source/Makefile.am @@ -3,6 +3,7 @@ pkgdatadir = $(datadir)/@PACKAGE@/Filters/Rules/Source pkgdata_PYTHON = \ + _ChangedSince.py\ _MatchesFilter.py\ _SourcePrivate.py\ _RegExpIdOf.py\ diff --git a/src/Filters/Rules/Source/_ChangedSince.py b/src/Filters/Rules/Source/_ChangedSince.py new file mode 100644 index 000000000..85941dd5e --- /dev/null +++ b/src/Filters/Rules/Source/_ChangedSince.py @@ -0,0 +1,26 @@ +#------------------------------------------------------------------------- +# +# Standard Python modules +# +#------------------------------------------------------------------------- +from gettext import gettext as _ + +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- +from Filters.Rules._ChangedSinceBase import ChangedSinceBase + +#------------------------------------------------------------------------- +# +# ChangedSince +# +#------------------------------------------------------------------------- +class ChangedSince(ChangedSinceBase): + """Rule that checks for sources changed since a specific time.""" + + name = _('Sources changed after ') + description = _("Matches source records changed after a specified " + "date-time (yyyy-mm-dd hh:mm:ss) or in the range, if a second " + "date-time is given") diff --git a/src/Filters/Rules/Source/__init__.py b/src/Filters/Rules/Source/__init__.py index 092fa2675..d4902fcc9 100644 --- a/src/Filters/Rules/Source/__init__.py +++ b/src/Filters/Rules/Source/__init__.py @@ -36,6 +36,7 @@ from _HasReferenceCountOf import HasReferenceCountOf from _SourcePrivate import SourcePrivate from _MatchesFilter import MatchesFilter from _HasSource import HasSource +from _ChangedSince import ChangedSince editor_rule_list = [ AllSources, @@ -48,4 +49,5 @@ editor_rule_list = [ HasReferenceCountOf, SourcePrivate, MatchesFilter, + ChangedSince, ] diff --git a/src/Filters/Rules/_ChangedSinceBase.py b/src/Filters/Rules/_ChangedSinceBase.py new file mode 100644 index 000000000..e00fb3a7a --- /dev/null +++ b/src/Filters/Rules/_ChangedSinceBase.py @@ -0,0 +1,82 @@ +#------------------------------------------------------------------------- +# +# Standard Python modules +# +#------------------------------------------------------------------------- +from gettext import gettext as _ +import re +import time + +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- +from Filters.Rules import Rule + +#------------------------------------------------------------------------- +# +# ChangedSince +# +#------------------------------------------------------------------------- +class ChangedSinceBase(Rule): + """ + Rule that checks for primary objects changed since a specific time. + """ + + labels = [ _('Changed after:'), _('but before:') ] + name = _('Objects changed after ') + description = _("Matches object records changed after a specified " + "date/time (yyyy-mm-dd hh:mm:ss) or in range, if a second " + "date/time is given") + category = _('General filters') + + def add_time(self, date): + if re.search("\d.*\s+\d{1,2}:\d{2}:\d{2}", date): + return date + elif re.search("\d.*\s+\d{1,2}:\d{2}", date): + return date + ":00" + elif re.search("\d.*\s+\d{1,2}", date): + return date + ":00:00" + elif re.search("\d{4}-\d{1,2}-\d{1,2}", date): + return date + " 00:00:00" + elif re.search("\d{4}-\d{1,2}", date): + return date + "-01 00:00:00" + elif re.search("\d{4}", date): + return date + "-01-01 00:00:00" + else: + return date + + def time_str_to_sec(self, time_str): + time_sec = None + iso_date_time = self.add_time(time_str) + try: + time_tup = time.strptime(iso_date_time, "%Y-%m-%d %H:%M:%S") + time_sec = time.mktime(time_tup) + except ValueError: + from QuestionDialog import WarningDialog + WarningDialog(_("Wrong format of date-time"), + _("Only date-times in the iso format of yyyy-mm-dd " + "hh:mm:ss, where the time part is optional, are " + "accepted. %s does not satisfy.") % iso_date_time) + return time_sec + + def prepare(self, db): + self.since = None + self.before = None + if self.list[0]: + self.since = self.time_str_to_sec(self.list[0]) + if self.list[1]: + self.before = self.time_str_to_sec(self.list[1]) + + def apply(self, db, obj): + obj_time = obj.get_change_time() + if self.since: + if obj_time < self.since: + return False + if self.before: + return obj_time < self.before + return True + if self.before: + return obj_time < self.before + return False diff --git a/src/Filters/Rules/__init__.py b/src/Filters/Rules/__init__.py index de141bd3f..c374315ef 100644 --- a/src/Filters/Rules/__init__.py +++ b/src/Filters/Rules/__init__.py @@ -34,6 +34,7 @@ from Filters.Rules._IsPrivate import IsPrivate from Filters.Rules._HasTextMatchingSubstringOf import HasTextMatchingSubstringOf from Filters.Rules._HasTextMatchingRegexpOf import HasTextMatchingRegexpOf from Filters.Rules._MatchesFilterBase import MatchesFilterBase +from Filters.Rules._ChangedSinceBase import ChangedSinceBase from Filters.Rules import (Person, Family, Event, Source, Place, MediaObject, Repository, Note)