# HG changeset patch # User Steve Losh # Date 1251507478 14400 # Node ID efbdbc2fc8a05d6c40a818d3c9da878dd2dc0118 # Parent be695300145b060671ffabe68a8e7b0e5645ddef Rearrange some functions. diff -r be695300145b -r efbdbc2fc8a0 t.py --- 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 = {}