From 20f4a9b9cd357defbc49419e75003acfb6a1eca4 Mon Sep 17 00:00:00 2001 From: albertogomcas Date: Wed, 27 Jan 2010 03:52:42 +0000 Subject: [PATCH] Command 'note' saves notes into 'hookedir/output' directory (a bit cleaner) and if the note file exists adds instead of overwriting the file. --- hooke_cli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hooke_cli.py b/hooke_cli.py index 783b899..6804acf 100755 --- a/hooke_cli.py +++ b/hooke_cli.py @@ -745,9 +745,12 @@ Syntax: txt [filename] {plot to export} print self.current_list[self.pointer].notes else: if self.notes_filename == None: + if not os.path.exists(os.path.realpath('output')): + os.mkdir('output') self.notes_filename=raw_input('Notebook filename? ') + self.notes_filename=os.path.join(os.path.realpath('output'),self.notes_filename) title_line='Notes taken at '+time.asctime()+'\n' - f=open(self.notes_filename,'w') + f=open(self.notes_filename,'a') f.write(title_line) f.close() -- 2.26.2