notelog has been superseded by hooke.plugin.playlist.SaveCommand
authorW. Trevor King <wking@drexel.edu>
Wed, 12 May 2010 18:08:05 +0000 (14:08 -0400)
committerW. Trevor King <wking@drexel.edu>
Wed, 12 May 2010 18:08:05 +0000 (14:08 -0400)
The notes will be stored in Playlist.info['note'], and the info dict
is saved in the playlist file format.

hooke/hooke_cli.py

index 02c5ce2163d29b932989ba70673e9d3f08b6e359..15529864eafde67f5a396f12c372fdb2eb74c6ae 100644 (file)
@@ -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?'