self.config[key]=value
self.do_plot(0)
-
- def help_printlist(self):
- print '''
-PRINTLIST
-Prints the list of curves in the current playlist
--------------
-Syntax: printlist
-'''
- def do_printlist(self,args):
- for item in self.current_list:
- print item.path
-
-
- def help_jump(self):
- print '''
-JUMP
-Jumps to a given curve.
-------
-Syntax: jump {$curve}
-
-If the curve is not in the current playlist, it politely asks if we want to add it.
- '''
- def do_jump(self,filename):
- '''
- jumps to the curve with the given filename.
- if the filename is not in the playlist, it asks if we must add it or not.
- '''
-
- if filename=='':
- filename=linp.safeinput('Jump to?')
-
- filepath=os.path.abspath(filename)
- print filepath
-
- c=0
- item_not_found=1
- while item_not_found:
- try:
-
- if self.current_list[c].path == filepath:
- self.pointer=c
- self.current=self.current_list[self.pointer]
- item_not_found=0
- self.do_plot(0)
- else:
- c+=1
- except IndexError:
- #We've found the end of the list.
- answer=linp.safeinput('Curve not found in playlist. Add it to list?',['y'])
- if answer.lower()[0]=='y':
- try:
- self.do_addtolist(filepath)
- except:
- print 'Curve file not found.'
- return
- self.current=self.current_list[-1]
- self.pointer=(len(current_list)-1)
- self.do_plot(0)
-
- item_not_found=0
def commands(self):
return [NextCommand(), PreviousCommand(), JumpCommand(),
+ IndexCommand(), CurveListCommand(),
SaveCommand(), LoadCommand(),
AddCommand(), AddGlobCommand(),
RemoveCommand(), FilterCommand(), NoteFilterCommand()]
def _run(self, hooke, inqueue, outqueue, params):
outqueue.put(params['playlist']._index)
+class CurveListCommand (Command):
+ """Get the curves in a playlist.
+ """
+ def __init__(self):
+ super(CurveListCommand, self).__init__(
+ name='playlist curves',
+ arguments=[
+ PlaylistArgument,
+ ],
+ help=self.__doc__)
+
+ def _run(self, hooke, inqueue, outqueue, params):
+ outqueue.put([c for c in params['playlist']])
+
class SaveCommand (Command):
"""Save a playlist.
"""