summaryrefslogtreecommitdiff
path: root/src/plugin.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-11-10 14:39:19 +0100
committermathieui <mathieui@mathieui.net>2011-11-10 14:39:19 +0100
commit628ff3b0d982526aad48151bdce623d12b8db2b7 (patch)
treedfb9343431ddb690f42b141b31616fab888c8dc8 /src/plugin.py
parent953dc36c470ed8012322651abe8bc010e37153eb (diff)
downloadpoezio-628ff3b0d982526aad48151bdce623d12b8db2b7.tar.gz
poezio-628ff3b0d982526aad48151bdce623d12b8db2b7.tar.bz2
poezio-628ff3b0d982526aad48151bdce623d12b8db2b7.tar.xz
poezio-628ff3b0d982526aad48151bdce623d12b8db2b7.zip
Add per_tab_type commands for the plugins
Diffstat (limited to 'src/plugin.py')
-rw-r--r--src/plugin.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugin.py b/src/plugin.py
index 40f96871..4dd88697 100644
--- a/src/plugin.py
+++ b/src/plugin.py
@@ -93,6 +93,18 @@ class BasePlugin(object, metaclass=SafetyMetaclass):
"""
return self.plugin_manager.del_command(self.__module__, name)
+ def add_tab_command(self, tab_type, name, handler, help, completion=None):
+ """
+ Add a command only for a type of tab.
+ """
+ return self.plugin_manager.add_tab_command(self.__module__, tab_type, name, handler, help, completion)
+
+ def del_tab_command(self, tab_type, name):
+ """
+ Delete a command added through add_tab_command.
+ """
+ return self.plugin_manager.del_tab_command(self.__module__, tab_type, name)
+
def add_event_handler(self, event_name, handler, position=0):
"""
Add an event handler to the event event_name.