Commit ce423fe6 authored by Jacek Sowiński's avatar Jacek Sowiński

Add %k (tags minus due:, t:) and %x (completion)

Also fix Unicode error for %K when tag contains special characters.
parent e294c590
......@@ -155,8 +155,14 @@ class PrettyPrinterFormatFilter(PrettyPrinterFilter):
'I': lambda t: filler(str(self.todolist.number(t)), 3),
# list of tags (spaces)
'K': lambda t: ' '.join(['{}:{}'.format(tag, value)
for tag, value in sorted(p_todo.tags())]),
'K': lambda t: ' '.join([u('{}:{}').format(tag, value)
for tag, value in sorted(p_todo.tags()) if
tag not in config().hidden_tags()]),
# list of tags (spaces) without due: and t:
'k': lambda t: ' '.join([u('{}:{}').format(tag, value)
for tag, value in sorted(p_todo.tags()) if
tag not in config().hidden_tags() + [config().tag_start(), config().tag_due()]]),
# priority
'p': lambda t: t.priority() if t.priority() else '',
......@@ -170,6 +176,9 @@ class PrettyPrinterFormatFilter(PrettyPrinterFilter):
# relative start date
'T': lambda t: humanize_date(t.start_date()) if t.start_date() else '',
# completed
'x': lambda t: 'x ' + t.completion_date().isoformat() if t.is_completed() else '',
# literal %
'%': lambda _: '%',
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment