From 9c20e0ae392ba353109d7bea344032c56cff1136 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Sat, 8 Aug 2015 19:22:16 +0200 Subject: [PATCH] backends: Introduce a Backend base class --- tasklib/backends.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tasklib/backends.py 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 -- 2.39.5