Commit 314b21a1 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Add %r format flag to print the raw todo.txt items

parent 2e92fa6a
...@@ -675,6 +675,19 @@ C - ...@@ -675,6 +675,19 @@ C -
4 (C) 4 (C)
5 ( ) 5 ( )
6 ( ) 6 ( )
"""
self.assertEqual(self.output, result)
def test_list_format45(self):
command = ListCommand(["-x", "-F", "%r"], self.todolist, self.out, self.error)
command.execute()
result = """(D) 2015-08-31 Bar @Context1 +Project2 due:2015-09-30 t:2015-09-29
(Z) 2015-11-06 Lorem ipsum dolorem sit amet. Red @fox +jumped over the lazy:bar and jar due:2015-11-08 t:2015-11-07
(C) 2015-07-12 Foo @Context2 Not@Context +Project1 Not+Project
(C) Baz @Context1 +Project1 key:value
Drink beer @ home id:1 p:2 ical:foobar
x 2014-12-12 Completed but with date:2014-12-12
""" """
self.assertEqual(self.output, result) self.assertEqual(self.output, result)
......
...@@ -176,6 +176,9 @@ class ListFormatParser(object): ...@@ -176,6 +176,9 @@ class ListFormatParser(object):
# priority (or placeholder space) # priority (or placeholder space)
'P': lambda t: t.priority() if t.priority() else ' ', 'P': lambda t: t.priority() if t.priority() else ' ',
# raw text
'r': lambda t: t.source(),
# text # text
's': lambda t: t.text(), 's': lambda t: t.text(),
......
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