]> git.madduck.net Git - etc/taskwarrior.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

backends: Introduce a Backend base class
authorTomas Babej <tomasbabej@gmail.com>
Sat, 8 Aug 2015 17:22:16 +0000 (19:22 +0200)
committerTomas Babej <tomasbabej@gmail.com>
Sat, 8 Aug 2015 17:22:16 +0000 (19:22 +0200)
tasklib/backends.py [new file with mode: 0644]

diff --git a/tasklib/backends.py b/tasklib/backends.py
new file mode 100644 (file)
index 0000000..1bebafd
--- /dev/null
@@ -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