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()
return self
@classmethod
def from_task(cls, cache, task):
self = cls(cache)
self._task = task
self.update_from_task()
return self
@property
def task(self):
# Return the corresponding task if alrady set