From: Tomas Babej Date: Sat, 8 Aug 2015 22:45:26 +0000 (+0200) Subject: backends: Make the filter_class an abstractproperty X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/commitdiff_plain/3e74cb3326bf929fe57ac726997256f3780ba46f backends: Make the filter_class an abstractproperty --- diff --git a/tasklib/backends.py b/tasklib/backends.py index fe24fd2..0d01470 100644 --- a/tasklib/backends.py +++ b/tasklib/backends.py @@ -22,7 +22,10 @@ VERSION_2_4_5 = six.u('2.4.5') class Backend(object): - filter_class = TaskWarriorFilter + @abc.abstractproperty + def filter_class(self): + """Returns the TaskFilter class used by this backend""" + pass @abc.abstractmethod def filter_tasks(self, filter_obj): @@ -208,6 +211,10 @@ class TaskWarrior(object): "datetime, its type is not supported: {}" .format(type(value))) + @property + def filter_class(self): + return TaskWarriorFilter + # Public interface def get_config(self):