mirror of
https://github.com/tbabej/taskwiki.git
synced 2025-08-23 02:23:07 +02:00
VimwikiTask: Track dependency in a extra attribute, since Task object may not be saved yet
This commit is contained in:
parent
b32dc605f8
commit
24936aee5f
1 changed files with 9 additions and 0 deletions
|
@ -97,6 +97,11 @@ class VimwikiTask(object):
|
|||
self.completed = self.completed_mark is 'X'
|
||||
self.line_number = position
|
||||
|
||||
# We need to track depedency set in a extra attribute, since
|
||||
# this may be a new task, and hence it need not to be saved yet.
|
||||
# We circumvent this problem by iteration order in the TaskCache
|
||||
self.add_dependencies = set()
|
||||
|
||||
# First set the task attribute to None, then try to load it, if possible
|
||||
self.task = None
|
||||
|
||||
|
@ -111,6 +116,10 @@ class VimwikiTask(object):
|
|||
|
||||
self.parent = self.find_parent_task()
|
||||
|
||||
# Make parent task dependant on this task
|
||||
if self.parent:
|
||||
self.parent.add_dependencies |= set([self])
|
||||
|
||||
def save_to_tw(self):
|
||||
|
||||
# Push the values to the Task
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue