efbdbc2fc8a0

Rearrange some functions.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 28 Aug 2009 20:57:58 -0400
parents be695300145b
children d5dc52a44e57
branches/tags (none)
files t.py

Changes

--- a/t.py	Fri Aug 28 20:57:08 2009 -0400
+++ b/t.py	Fri Aug 28 20:57:58 2009 -0400
@@ -120,6 +120,15 @@
         
         task['text'] = text
     
+    def finish_task(self, prefix):
+        """Mark the task with the given prefix as finished.
+        
+        If more than one task matches the prefix an AmbiguousPrefix exception
+        will be raised.
+        
+        """
+        self.tasks.pop(self[prefix]['id'])
+    
     def print_list(self, kind='tasks', verbose=False):
         """Print out a nicely formatted list of unfinished tasks."""
         tasks = dict(getattr(self, kind).items())
@@ -131,15 +140,6 @@
         for t in tasks.values():
             print ('%-' + str(plen) + 's - %s') % (t[label], t['text'])
     
-    def finish_task(self, prefix):
-        """Mark the task with the given prefix as finished.
-        
-        If more than one task matches the prefix an AmbiguousPrefix exception
-        will be raised.
-        
-        """
-        self.tasks.pop(self[prefix]['id'])
-    
     def delete_finished(self):
         """Remove all finished tasks."""
         self.done = {}