summaryrefslogtreecommitdiff
path: root/src/plugin.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2013-01-18 23:08:40 +0100
committermathieui <mathieui@mathieui.net>2013-01-18 23:25:33 +0100
commit3755b51430f5532e2cf3934f027537b832c07b2a (patch)
treef5f172d116771772ced1fb8a05a038f866c81e21 /src/plugin.py
parentb3341c63272be3322a7276a3f1ff34598888ce0a (diff)
downloadpoezio-3755b51430f5532e2cf3934f027537b832c07b2a.tar.gz
poezio-3755b51430f5532e2cf3934f027537b832c07b2a.tar.bz2
poezio-3755b51430f5532e2cf3934f027537b832c07b2a.tar.xz
poezio-3755b51430f5532e2cf3934f027537b832c07b2a.zip
Use the new command scheme in plugins too
(while staying backwards-compatible)
Diffstat (limited to 'src/plugin.py')
-rw-r--r--src/plugin.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugin.py b/src/plugin.py
index bd5c88be..537f7b61 100644
--- a/src/plugin.py
+++ b/src/plugin.py
@@ -113,12 +113,13 @@ class BasePlugin(object, metaclass=SafetyMetaclass):
def unload(self):
self.cleanup()
- def add_command(self, name, handler, help, completion=None):
+ def add_command(self, name, handler, help, completion=None, short='', usage=''):
"""
Add a global command.
You cannot overwrite the existing commands.
"""
- return self.plugin_manager.add_command(self.__module__, name, handler, help, completion)
+ return self.plugin_manager.add_command(self.__module__, name, handler, help,
+ completion=completion, short=short, usage=usage)
def del_command(self, name):
"""
@@ -151,11 +152,12 @@ class BasePlugin(object, metaclass=SafetyMetaclass):
"""
return self.plugin_manager.del_tab_key(self.__module__, tab_type, key)
- def add_tab_command(self, tab_type, name, handler, help, completion=None):
+ def add_tab_command(self, tab_type, name, handler, help, completion=None, short='', usage=''):
"""
Add a command only for a type of tab.
"""
- return self.plugin_manager.add_tab_command(self.__module__, tab_type, name, handler, help, completion)
+ return self.plugin_manager.add_tab_command(self.__module__, tab_type, name, handler, help,
+ completion=completion, short=short, usage=usage)
def del_tab_command(self, tab_type, name):
"""