From e682409d2443a8651673ed560fee81e9874f70de Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 7 Dec 2010 10:35:22 +0000 Subject: 'new' should run gedit. --- scripts/journal-note | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/journal-note b/scripts/journal-note index ae1955d..5a41e70 100755 --- a/scripts/journal-note +++ b/scripts/journal-note @@ -67,6 +67,9 @@ class App(object): def drafts(self, opts): return os.path.join(opts.base, 'drafts') + def gedit_file(self, pathname): + subprocess.check_call(['gedit', '--new-window', pathname]) + def new_entry(self, args, opts): if not args: raise AppException('Usage: journal-note new TITLE') @@ -85,6 +88,7 @@ class App(object): f = open(name, 'w') f.write(template % values) f.close() + self.gedit_file(name) def list_entries(self, args, opts): drafts = self.drafts(opts) @@ -108,7 +112,7 @@ class App(object): pathname = os.path.join(self.drafts(opts), args[0] + '.mdwn') if not os.path.exists(pathname): raise AppException('draft %s does not exist' % args[0]) - subprocess.check_call(['gedit', '--new-window', pathname]) + self.gedit_file(pathname) def finish_entry(self, args, opts): if not args: -- cgit v1.2.1