Commit 241aa3e9 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Let ListCommand print UIDs.

parent d7ff4f48
......@@ -145,6 +145,16 @@ class ListCommandTest(CommandTest.CommandTest):
self.assertEquals(self.output, " 2 (D) Bar @Context1 +Project2 p:1\n")
self.assertEquals(self.errors, "")
def test_list16(self):
config("data/todolist-uid.conf")
command = ListCommand.ListCommand([], self.todolist, self.out, self.error)
command.execute()
self.assertFalse(self.todolist.is_dirty())
self.assertEquals(self.output, "6iu (C) Foo @Context2 Not@Context +Project1 Not+Project\ntil (C) Drink beer @ home\n c5 (C) 13 + 29 = 42\nxvb (D) Bar @Context1 +Project2 p:1\n")
self.assertEquals(self.errors, "")
def test_help(self):
command = ListCommand.ListCommand(["help"], self.todolist, self.out, self.error)
command.execute()
......
......@@ -200,7 +200,10 @@ class TodoListBase(object):
A filter for the pretty printer to append the todo number to the
printed todo.
"""
return lambda p_todo_str, p_todo: "%3d %s" % (self.number(p_todo), p_todo_str)
if config().identifiers() == 'text':
return lambda p_todo_str, p_todo: "%3s %s" % (self._todo_id_map[p_todo], p_todo_str)
else:
return lambda p_todo_str, p_todo: "%3d %s" % (self.number(p_todo), p_todo_str)
def _update_todo_ids(self):
# the idea is to have a hash that is independent of the position of the
......
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