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): ...@@ -155,8 +155,14 @@ class PrettyPrinterFormatFilter(PrettyPrinterFilter):
'I': lambda t: filler(str(self.todolist.number(t)), 3), 'I': lambda t: filler(str(self.todolist.number(t)), 3),
# list of tags (spaces) # list of tags (spaces)
'K': lambda t: ' '.join(['{}:{}'.format(tag, value) 'K': lambda t: ' '.join([u('{}:{}').format(tag, value)
for tag, value in sorted(p_todo.tags())]), 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 # priority
'p': lambda t: t.priority() if t.priority() else '', 'p': lambda t: t.priority() if t.priority() else '',
...@@ -170,6 +176,9 @@ class PrettyPrinterFormatFilter(PrettyPrinterFilter): ...@@ -170,6 +176,9 @@ class PrettyPrinterFormatFilter(PrettyPrinterFilter):
# relative start date # relative start date
'T': lambda t: humanize_date(t.start_date()) if t.start_date() else '', '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 % # literal %
'%': lambda _: '%', '%': 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