diff options
Diffstat (limited to 'jt')
-rwxr-xr-x | jt | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -77,6 +77,13 @@ class NewCommand(Command): self._app.edit_file(name) +class ListCommand(Command): + + def run(self, args): + for draft_id, filename in self.find_drafts(): + print draft_id, self.get_draft_title(filename) or "" + + class JournalTool(cliapp.Application): cmd_synopsis = { @@ -137,9 +144,7 @@ class JournalTool(cliapp.Application): def cmd_list(self, args): '''List journal entry drafts.''' - - for draft_id, filename in self.find_drafts(): - print draft_id, self.get_draft_title(filename) or "" + ListCommand(self).run(args) def find_drafts(self): drafts_dir = self.drafts_dir() |