From: Tomas Babej Date: Sat, 8 Aug 2015 17:22:16 +0000 (+0200) Subject: backends: Introduce a Backend base class X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/commitdiff_plain/9c20e0ae392ba353109d7bea344032c56cff1136?ds=inline backends: Introduce a Backend base class --- diff --git a/tasklib/backends.py b/tasklib/backends.py new file mode 100644 index 0000000..1bebafd --- /dev/null +++ b/tasklib/backends.py @@ -0,0 +1,29 @@ +import abc + +class Backend(object): + + @abc.abstractmethod + def filter_tasks(self, filter_obj): + """Returns a list of Task objects matching the given filter""" + pass + + @abc.abstractmethod + def save_task(self, task): + pass + + @abc.abstractmethod + def delete_task(self, task): + pass + + @abc.abstractmethod + def start_task(self, task): + pass + + @abc.abstractmethod + def stop_task(self, task): + pass + + @abc.abstractmethod + def sync(self): + """Syncs the backend database with the taskd server""" + pass