diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-10-21 12:12:48 +0100 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-10-21 12:12:48 +0100 |
commit | ab4cb2153615fdf9810de8602a300e0d0f058832 (patch) | |
tree | fd29532c58892a60e59f9542872cafc7567a25eb | |
parent | ba512e4d56b67b173c5e554fa5a8c4fbcd26c93c (diff) | |
parent | 81658678266fe314c9bf30476caf0cce40fb836d (diff) | |
download | jt-ab4cb2153615fdf9810de8602a300e0d0f058832.tar.gz |
Merge remote-tracking branch 'origin/kinnison/editor'
-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.''' |