# Define common or complicated arguments
-def current_curve_callback(hooke, command, argument, value):
+def current_curve_callback(hooke, command, argument, value, load=True):
if value != None:
return value
playlist = current_playlist_callback(hooke, command, argument, value)
- curve = playlist.current()
+ curve = playlist.current(load=load)
if curve == None:
raise Failure('No curves in %s' % playlist)
return curve
+def unloaded_current_curve_callback(hooke, command, argument, value):
+ return current_curve_callback(
+ hooke=hooke, command=command, argument=argument, value=value,
+ load=False)
+
CurveArgument = Argument(
name='curve', type='curve', callback=current_curve_callback,
help="""
super(ClearStackCommand, self).__init__(
name='clear curve command stack',
help=self.__doc__, plugin=plugin)
+ i,arg = [(i,arg) for i,arg in enumerate(self.arguments)
+ if arg.name == 'curve'][0]
+ arg = copy.copy(arg)
+ arg.callback = unloaded_current_curve_callback
+ self.arguments[i] = arg
def _run(self, hooke, inqueue, outqueue, params):
curve = self._curve(hooke, params)