class NotePlugin (Builtin):
def __init__(self):
super(NotePlugin, self).__init__(name='note')
-
- def commands(self):
- return [AddNoteCommand(), ClearNoteCommand(), GetNoteCommand()]
-
- def dependencies(self):
- return [
- 'playlist', # for current_playlist_callback
- ]
+ self._commands = [
+ AddNoteCommand(self), ClearNoteCommand(self), GetNoteCommand(self)]
class AddNoteCommand (Command):
"""Add a note to one of several Hooke objects.
"""
- def __init__(self):
+ def __init__(self, plugin):
super(AddNoteCommand, self).__init__(
name='add note',
arguments=[
The note text.
""".strip()),
],
- help=self.__doc__)
+ help=self.__doc__, plugin=plugin)
def _run(self, hooke, inqueue, outqueue, params):
params['target'].info['note'].append(params['note'])
class ClearNoteCommand (Command):
"""Remove a note or notes from one of several Hooke objects.
"""
- def __init__(self):
+ def __init__(self, plugin):
super(ClearNoteCommand, self).__init__(
name='clear note',
arguments=[
typing mistakes ;).
""".strip()),
],
- help=self.__doc__)
+ help=self.__doc__, plugin=plugin)
def _run(self, hooke, inqueue, outqueue, params):
num_notes = len(params['target'].info['note'])
class GetNoteCommand (Command):
"""Retrieve notes from one of several Hooke objects.
"""
- def __init__(self):
+ def __init__(self, plugin):
super(GetNoteCommand, self).__init__(
name='get note',
arguments=[
Target object for the note. Defaults to the current playlist.
""".strip()),
],
- help=self.__doc__)
+ help=self.__doc__, plugin=plugin)
def _run(self, hooke, inqueue, outqueue, params):
outqueue.put(params['target'].info['note'])