-# Copyright (C) 2010-2012 W. Trevor King <wking@drexel.edu>
+# Copyright (C) 2010-2012 W. Trevor King <wking@tremily.us>
#
# This file is part of Hooke.
#
super(RemoveCommand, self).__init__(
name='remove curve from playlist',
arguments=[
- Argument(name='index', type='int', optional=False, help="""
+ Argument(name='index', type='int', optional=True, help="""
Index of target curve.
""".strip()),
],
def _run(self, hooke, inqueue, outqueue, params):
playlist = self._playlist(hooke, params)
- playlist.pop(params['index'])
+ if params['index'] is None:
+ params['index'] = playlist.index()
+ curve = playlist.pop(params['index'])
playlist.jump(playlist.index())
+ outqueue.put(curve)
class ApplyCommand (PlaylistCommand):