Commits

Ilkka Laukkanen  committed 6610749

Backed out changeset 6f2f86df2bec

  • Participants
  • Parent commits 6f2f86d

Comments (0)

Files changed (4)

File features/steps.py

 
 @step(u'Then the listing is empty')
 def then_the_listing_is_empty(step):
-    assert_equals(world.output, u"""
+    assert_equals(world.output, """
 --
-TODO: 0 of 0 tasks shown""")
+TODO: 0 of 0 tasks shown
+""")
 
 
 @step(u'Then the listing contains my todo')
 def then_the_listing_contains_my_todo(step):
-    assert_equals(world.output, u"""1 Get more milk
+    assert_equals(world.output, """1 Get more milk
 --
-TODO: 1 of 1 task shown""")
+TODO: 1 of 1 task shown
+""")
 
 
 @step(u'Then the listing contains just those todos containing that string')
 def then_the_listing_contains_just_those_todos_containing_that_string(step):
-    assert_equals(world.output, u"""1 (A) First todo @contextY +projectF
+    assert_equals(world.output, """1 (A) First todo @contextY +projectF
 5 (B) Fifth todo +projectF
 --
-TODO: 2 of 5 tasks shown""")
+TODO: 2 of 5 tasks shown
+""")
 
 
 @step(u'^Then the listing should be sorted by priority descending$')
 def then_the_listing_should_be_sorted_By_priority_descending(step):
-    assert_equals(world.output, u"""1 (A) First todo @contextY +projectF
+    assert_equals(world.output, """1 (A) First todo @contextY +projectF
 2 (A) Another A-prio todo @contextY +projectG
 5 (B) Fifth todo +projectF
 4 (C) Fourth todo +projectX @contextX
 3 Third todo @contextY
 --
-TODO: 5 of 5 tasks shown""")
+TODO: 5 of 5 tasks shown
+""")
 
 
 ############################

File todopy/todopy/formatter.py

         return 'white'
 
     def format_todo(self, todo):
-        return self.formatter(u"{} {}".format(todo.id, todo.todo), self.color_for(todo.priority()))
+        return self.formatter("{} {}".format(todo.id, todo.todo), self.color_for(todo.priority()))
 
     def format(self, model):
         shown = len(model)
         for todo in model:
             formatted.append(self.format_todo(todo))
         suffix = '' if shown == 1 else 's'
-        return u"\n".join(formatted) + u"""
+        return "\n".join(formatted) + """
 --
-TODO: {} of {} task{} shown""".format(shown, total, suffix)
+TODO: {} of {} task{} shown
+""".format(shown, total, suffix)

File todopy/todopy/model.py

 class Todo(object):
     """Class representing single todo.
 
-    >>> t = Todo(1, u"My todo")
+    >>> t = Todo(1, "My todo")
     >>> t.id
     1
     >>> t.todo
-    u'My todo'
+    'My todo'
     """
 
     PRIORITY_REGEX = r'^\(([A-Z])\)\s+'
     def append(self, text):
         """Append string to todo text, separated by a space.
 
-        >>> t = Todo(2, u"My")
-        >>> t.append(u'todo')
+        >>> t = Todo(2, "My")
+        >>> t.append('todo')
         >>> t.todo
-        u'My todo'
+        'My todo'
         """
         self.todo += " " + text.strip()
 
 
         Takes care to keep priority in correct place
 
-        >>> t = Todo(2, u"(A) todo")
-        >>> t.prepend(u'My')
+        >>> t = Todo(2, "(A) todo")
+        >>> t.prepend('My')
         >>> t.todo
-        u'(A) My todo'
+        '(A) My todo'
         """
         if self.priority():
             self.todo = "(" + self.priority() + ") " + \
     def set_priority(self, priority):
         """Set priority, or remove if None.
 
-        >>> t = Todo(1, u"My todo")
+        >>> t = Todo(1, "My todo")
         >>> t.set_priority('A')
         >>> t.todo
-        u'(A) My todo'
+        '(A) My todo'
         >>> t.set_priority(None)
         >>> t.todo
-        u'My todo'
+        'My todo'
         """
         if priority:
             if re.match(Todo.PRIORITY_REGEX, self.todo):
     def priority(self):
         """Get priority.
 
-        >>> t = Todo(1, u"My todo")
+        >>> t = Todo(1, "My todo")
         >>> t.priority()
         >>> t.set_priority('A')
         >>> t.priority()
         """
         match = re.match(Todo.PRIORITY_REGEX, self.todo)
         if match:
-            return str(match.group(1))
+            return match.group(1)
         return None
 
     def set_done(self, done=True):
         """Change 'done' state of this todo.
 
-        >>> t = Todo(1, u"(A) My todo")
+        >>> t = Todo(1, "(A) My todo")
         >>> t.set_done()
         >>> t.todo
-        u'x My todo'
+        'x My todo'
         """
         if done:
             if not self.done():
     >>> m = Model()
     >>> len(m)
     0
-    >>> m.add(u"My todo")
+    >>> m.add("My todo")
     >>> len(m)
     1
     >>> m[0].todo
-    u'My todo'
+    'My todo'
     >>> m[0].id
     1
     >>> m[1]

File todopy/todopy/reader.py

                 return self
             def next(self):
                 try:
-                    return self.f.next().strip().decode('utf-8')
+                    return self.f.next().strip()
                 except StopIteration:
                     self.f.close()
                     raise StopIteration()