X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/5ba0e1105517f8b0e22b0bcf5c79f40a0fb644d9..d66fcc9dcef74ab7cafee718cbb9fa78fec92d03:/tasklib/filters.py diff --git a/tasklib/filters.py b/tasklib/filters.py index 1899d1d..0a74c3c 100644 --- a/tasklib/filters.py +++ b/tasklib/filters.py @@ -1,7 +1,36 @@ -from tasklib.serializing import SerializingObject +import abc +import six +from .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. """