Run update-copyright.py.
[hooke.git] / hooke / plugin / debug.py
index cc9101de77081d1978860c9ef56e444675106095..b40c71aea7118555fab59a93b34fe7fd9da25e0a 100644 (file)
@@ -1,20 +1,19 @@
-# Copyright (C) 2010 W. Trevor King <wking@drexel.edu>
+# Copyright (C) 2010-2012 W. Trevor King <wking@drexel.edu>
 #
 # This file is part of Hooke.
 #
-# Hooke is free software: you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation, either
-# version 3 of the License, or (at your option) any later version.
+# Hooke is free software: you can redistribute it and/or modify it under the
+# terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
 #
-# Hooke is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Lesser General Public License for more details.
+# Hooke is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
+# details.
 #
-# You should have received a copy of the GNU Lesser General Public
-# License along with Hooke.  If not, see
-# <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Lesser General Public License
+# along with Hooke.  If not, see <http://www.gnu.org/licenses/>.
 
 """The `debug` module provides :class:`DebugPlugin` and associated
 :class:`hooke.command.Command`\s which provide useful debugging
@@ -26,23 +25,22 @@ import sys
 
 from .. import version
 from ..command import Command, Argument
-from ..plugin import Builtin
+from . import Builtin
 
 
 class DebugPlugin (Builtin):
     def __init__(self):
         super(DebugPlugin, self).__init__(name='debug')
-        self._commands = [VersionCommand(), DebugCommand()]
-        self._setup_commands()
+        self._commands = [VersionCommand(self), DebugCommand(self)]
 
 
 class VersionCommand (Command):
     """Get the Hooke version, as well as versions for important Python
     packages.  Useful for debugging.
     """
-    def __init__(self):
+    def __init__(self, plugin):
         super(VersionCommand, self).__init__(
-            name='version', help=self.__doc__)
+            name='version', help=self.__doc__, plugin=plugin)
 
     def _run(self, hooke, inqueue, outqueue, params):
         lines = [
@@ -72,7 +70,7 @@ class VersionCommand (Command):
 class DebugCommand (Command):
     """Get Hooke attributes.  Useful for debugging.
     """
-    def __init__(self):
+    def __init__(self, plugin):
         super(DebugCommand, self).__init__(
             name='debug',
             arguments=[
@@ -80,7 +78,7 @@ class DebugCommand (Command):
 Hooke attribute to print.
 """.strip()),
                 ],
-            help=self.__doc__)
+            help=self.__doc__, plugin=plugin)
 
     def _run(self, hooke, inqueue, outqueue, params):
         if params['attribute'] == None: