VimwikiTask: Make constructors return references to the object itself

This commit is contained in:
Tomas Babej 2015-03-16 00:39:37 +01:00
parent d87fa9536c
commit 2d24b288e4

View file

@ -85,12 +85,16 @@ class VimwikiTask(object):
self['project'] = self.find_project() self['project'] = self.find_project()
return self
@classmethod @classmethod
def from_task(cls, cache, task): def from_task(cls, cache, task):
self = cls(cache) self = cls(cache)
self._task = task self._task = task
self.update_from_task() self.update_from_task()
return self
@property @property
def task(self): def task(self):
# Return the corresponding task if alrady set # Return the corresponding task if alrady set