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()
|
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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue