summaryrefslogtreecommitdiff
path: root/src/plugin_manager.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-10-02 13:21:51 +0200
committermathieui <mathieui@mathieui.net>2011-10-02 13:21:51 +0200
commitd5898965993b63ee719df48cca5d48b0a0402f85 (patch)
tree42d5c3880ce104fab4784f1678bd9ebbb5b796ca /src/plugin_manager.py
parentb7279678df346488c8a0454b7d5d372d2236ce65 (diff)
downloadpoezio-d5898965993b63ee719df48cca5d48b0a0402f85.tar.gz
poezio-d5898965993b63ee719df48cca5d48b0a0402f85.tar.bz2
poezio-d5898965993b63ee719df48cca5d48b0a0402f85.tar.xz
poezio-d5898965993b63ee719df48cca5d48b0a0402f85.zip
Adds a way to delete the commands without reloading the plugin
Diffstat (limited to 'src/plugin_manager.py')
-rw-r--r--src/plugin_manager.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugin_manager.py b/src/plugin_manager.py
index 82be8632..5bd6d75b 100644
--- a/src/plugin_manager.py
+++ b/src/plugin_manager.py
@@ -81,6 +81,12 @@ class PluginManager(object):
import traceback
self.core.information(_("Could not unload plugin (may not be safe to try again): ") + traceback.format_exc())
+ def del_command(self, module_name, name):
+ if name in self.commands[module_name]:
+ del self.commands[module_name][name]
+ if name in self.core.commands:
+ del self.core.commands[name]
+
def add_command(self, module_name, name, handler, help, completion=None):
if name in self.core.commands:
raise Exception(_("Command '%s' already exists") % (name,))