X-Git-Url: http://git.tremily.us/?p=hooke.git;a=blobdiff_plain;f=hooke%2Fplugin%2Fdebug.py;h=1855450d4d3293ecd6b33d05bba95e48afa7179a;hp=c44ba03a946971bd17ee209189e3024204f6faec;hb=bfbed5a3f3a18b9fa278d6e49004e582392c32d7;hpb=10eeb4309e3c258594e4e69e849a1b5c301c9c53 diff --git a/hooke/plugin/debug.py b/hooke/plugin/debug.py index c44ba03..1855450 100644 --- a/hooke/plugin/debug.py +++ b/hooke/plugin/debug.py @@ -1,3 +1,21 @@ +# Copyright (C) 2010 W. Trevor King +# +# 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 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 +# . + """The `debug` module provides :class:`DebugPlugin` and associated :class:`hooke.command.Command`\s which provide useful debugging information. @@ -14,18 +32,16 @@ from ..plugin import Builtin class DebugPlugin (Builtin): def __init__(self): super(DebugPlugin, self).__init__(name='debug') - - def commands(self): - return [VersionCommand(), DebugCommand()] + 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 = [ @@ -55,7 +71,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=[ @@ -63,7 +79,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: