From: W. Trevor King Date: Wed, 12 May 2010 18:08:05 +0000 (-0400) Subject: notelog has been superseded by hooke.plugin.playlist.SaveCommand X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3f02a139f6ad8116ff1b13dbb96fcecf6e2fc9f0;p=hooke.git notelog has been superseded by hooke.plugin.playlist.SaveCommand The notes will be stored in Playlist.info['note'], and the info dict is saved in the playlist file format. --- diff --git a/hooke/hooke_cli.py b/hooke/hooke_cli.py index 02c5ce2..1552986 100644 --- a/hooke/hooke_cli.py +++ b/hooke/hooke_cli.py @@ -558,58 +558,3 @@ Syntax: txt [filename] {plot to export} note_string=(self.current.path+' | '+self.current.notes+'\n') f.write(note_string) f.close() - - def help_notelog(self): - print ''' -NOTELOG -Writes a log of the notes taken during the session for the current -playlist --------------- -Syntax notelog [filename] -''' - def do_notelog(self,args): - - if len(args)==0: - args=linp.safeinput('Notelog filename?',['notelog.txt']) - - note_lines='Notes taken at '+time.asctime()+'\n' - for item in self.current_list: - if len(item.notes)>0: - #FIXME: log should be justified - #FIXME: file path should be truncated... - note_string=(item.path+' | '+item.notes+'\n') - note_lines+=note_string - - try: - f=open(args,'a+') - f.write(note_lines) - f.close() - except IOError, (ErrorNumber, ErrorMessage): - print 'Error: notes cannot be saved. Catched exception:' - print ErrorMessage - - self.notes_saved=1 - - def help_copylog(self): - print ''' -COPYLOG -Moves the annotated curves to another directory ------------ -Syntax copylog [directory] - ''' - def do_copylog(self,args): - - if len(args)==0: - args=linp.safeinput('Destination directory?') #TODO default - - mydir=os.path.abspath(args) - if not os.path.isdir(mydir): - print 'Destination is not a directory.' - return - - for item in self.current_list: - if len(item.notes)>0: - try: - shutil.copy(item.path, mydir) - except (OSError, IOError): - print 'Cannot copy file. '+item.path+' Perhaps you gave me a wrong directory?'