taskwiki: Display used defaults in TaskWikiInspect

This commit is contained in:
Tomas Babej 2015-04-02 20:59:14 +02:00
parent b5475d0889
commit 4d63fed581
2 changed files with 9 additions and 0 deletions

View file

@ -218,6 +218,7 @@ class Meta(object):
"ViewPort inspection:\n" "ViewPort inspection:\n"
"--------------------\n" "--------------------\n"
"Filter used: {0}\n" "Filter used: {0}\n"
"Defaults used: {5}\n"
"Matching taskwarrior tasks: {1}\n" "Matching taskwarrior tasks: {1}\n"
"Displayed tasks: {2}\n" "Displayed tasks: {2}\n"
"Tasks to be added: {3}\n" "Tasks to be added: {3}\n"
@ -237,6 +238,7 @@ class Meta(object):
len(port.tasks), len(port.tasks),
', '.join(map(unicode, to_add)), ', '.join(map(unicode, to_add)),
', '.join(map(unicode, to_del)), ', '.join(map(unicode, to_del)),
port.raw_defaults,
) )
# Show in the split # Show in the split

View file

@ -70,6 +70,13 @@ class ViewPort(object):
def raw_filter(self): def raw_filter(self):
return ' '.join(self.taskfilter) return ' '.join(self.taskfilter)
@property
def raw_defaults(self):
return ', '.join(
'{0}:{1}'.format(key, value)
for key, value in self.defaults.iteritems()
)
@property @property
def viewport_tasks(self): def viewport_tasks(self):
return set(t.task for t in self.tasks) return set(t.task for t in self.tasks)