diff options
author | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2013-10-21 11:56:08 +0100 |
---|---|---|
committer | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2013-10-21 12:11:55 +0100 |
commit | 81658678266fe314c9bf30476caf0cce40fb836d (patch) | |
tree | fd29532c58892a60e59f9542872cafc7567a25eb | |
parent | ba512e4d56b67b173c5e554fa5a8c4fbcd26c93c (diff) | |
download | jt-81658678266fe314c9bf30476caf0cce40fb836d.tar.gz |
Support different editors
-rwxr-xr-x | jt | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -63,6 +63,13 @@ class JournalTool(cliapp.Application): 'add entries to git automatically', default=True) + self.settings.string( + ['editor'], + 'editor to launch for journal entries. Must include %s to ' + 'indicate where the filename goes', + default='sensible-editor %s') + + def cmd_new(self, args): '''Create a new journal entry draft.''' @@ -107,7 +114,9 @@ class JournalTool(cliapp.Application): return os.path.join(self.settings['source'], subdir) def edit_file(self, pathname): - subprocess.check_call(['sensible-editor', pathname]) + safe_pathname = cliapp.shell_quote(pathname) + cmdline = ['sh', '-c', self.settings['editor'] % pathname] + self.runcmd(cmdline) def cmd_list(self, args): '''List journal entry drafts.''' |