From: Tomas Babej Date: Thu, 15 Jan 2015 21:08:13 +0000 (+0100) Subject: Task: Make modified property non-private X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/commitdiff_plain/b7186a04cfecae9de25444ac9137f01f11d64db9?ds=sidebyside;hp=-c Task: Make modified property non-private 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. --- b7186a04cfecae9de25444ac9137f01f11d64db9 diff --git a/tasklib/task.py b/tasklib/task.py index f21ea43..ec3de29 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -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']