Command 'note' saves notes into 'hookedir/output' directory (a bit cleaner) and if...
authoralbertogomcas <devnull@localhost>
Wed, 27 Jan 2010 03:52:42 +0000 (03:52 +0000)
committeralbertogomcas <devnull@localhost>
Wed, 27 Jan 2010 03:52:42 +0000 (03:52 +0000)
hooke_cli.py

index 783b8992d290a5dd5886960639359521263f083f..6804acf55515ab7c0bee9a818280ff368903a51a 100755 (executable)
@@ -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()