mirror of
https://github.com/tbabej/taskwiki.git
synced 2025-08-19 06:43:06 +02:00
VimwikiTask: Make constructors return references to the object itself
This commit is contained in:
parent
d87fa9536c
commit
2d24b288e4
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue