X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/5ba0e1105517f8b0e22b0bcf5c79f40a0fb644d9..3e74cb3326bf929fe57ac726997256f3780ba46f:/tasklib/filters.py diff --git a/tasklib/filters.py b/tasklib/filters.py index 1899d1d..7b44e98 100644 --- a/tasklib/filters.py +++ b/tasklib/filters.py @@ -1,7 +1,35 @@ +import abc from tasklib.serializing import SerializingObject -class TaskFilter(SerializingObject): +class TaskFilter(object): + """ + Abstract base class that defines interface of a TaskFilter. + """ + + @abc.abstractmethod + def add_filter(self, arg): + """ + Processes an non-keyword filter. + """ + pass + + @abc.abstractmethod + def add_filter_param(self, key, value): + """ + Processes a keyword filter. + """ + pass + + @abc.abstractmethod + def clone(self): + """ + Returns a new deep copy of itself. + """ + pass + + +class TaskWarriorFilter(TaskFilter, SerializingObject): """ A set of parameters to filter the task list with. """