Added hooke.plugin.license and removed get-warrenty info from short_license.
[hooke.git] / hooke / plugin / note.py
index 168cbd34f050cbd01e6176b1faa666a15e6a6022..fa20592a90ac0f2e517d4b51926a881a67debfb9 100644 (file)
@@ -30,20 +30,14 @@ from ..plugin.playlist import current_playlist_callback
 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=[
@@ -59,7 +53,7 @@ Target object for the note.  Defaults to the current playlist.
 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'])
@@ -67,7 +61,7 @@ The note text.
 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=[
@@ -87,7 +81,7 @@ Run without prompting the user.  Use if you save often or don't make
 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'])
@@ -109,7 +103,7 @@ typing mistakes ;).
 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=[
@@ -120,7 +114,7 @@ class GetNoteCommand (Command):
 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'])