]> 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: Make modified property non-private
authorTomas Babej <tomasbabej@gmail.com>
Thu, 15 Jan 2015 21:08:13 +0000 (22:08 +0100)
committerTomas Babej <tomasbabej@gmail.com>
Fri, 16 Jan 2015 07:05:42 +0000 (08:05 +0100)
This is actually useful to have open to public. For modify hooks,
you get two lines of input(original and modified version), so it's
quite useful to have a convenient way of checking whether the
task you got is modified or not.

tasklib/task.py

index f21ea43110fab8488a21bcb134f03d603cb993dc..ec3de29dc28f4c8887b14721c468c861b15a893a 100644 (file)
@@ -280,7 +280,7 @@ class Task(TaskResource):
                 yield key
 
     @property
-    def _is_modified(self):
+    def modified(self):
         return bool(list(self._modified_fields))
 
     @property
@@ -373,7 +373,7 @@ class Task(TaskResource):
         self.refresh(only_fields=['status'])
 
     def save(self):
-        if self.saved and not self._is_modified:
+        if self.saved and not self.modified:
             return
 
         args = [self['uuid'], 'modify'] if self.saved else ['add']