]> 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:

Task: Allow setting attributes via keyword arguments
authorTomas Babej <tomasbabej@gmail.com>
Fri, 19 Dec 2014 07:58:12 +0000 (08:58 +0100)
committerTomas Babej <tomasbabej@gmail.com>
Thu, 25 Dec 2014 22:51:11 +0000 (23:51 +0100)
tasklib/task.py

index 09535881550207dff67ed436f1a438f15b7a5949..170fc77e545bf076a5d1d6d6ed6977178fc2fe34 100644 (file)
@@ -95,9 +95,13 @@ class Task(TaskResource):
         """
         pass
 
         """
         pass
 
-    def __init__(self, warrior, data={}):
+    def __init__(self, warrior, data={}, **kwargs):
         self.warrior = warrior
         self.warrior = warrior
-        self._load_data(data)
+
+        # We keep data for backwards compatibility
+        kwargs.update(data)
+
+        self._load_data(kwargs)
         self._modified_fields = set()
 
     def __unicode__(self):
         self._modified_fields = set()
 
     def __unicode__(self):