From d3d4bd156cb8a76d5406f7b6c690bbb09e55afde Mon Sep 17 00:00:00 2001 From: mathieui Date: Thu, 10 Nov 2011 15:17:01 +0100 Subject: [PATCH] Doc for the new API function --- doc/en/plugins.txt | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/doc/en/plugins.txt b/doc/en/plugins.txt index 32fe45c3..4cef6db9 100644 --- a/doc/en/plugins.txt +++ b/doc/en/plugins.txt @@ -45,6 +45,41 @@ This method adds a global command to poezio. For example you can add a /foo command that the user could call when the plugin is loaded, by calling this method with _foo_ as its _name_ argument. <> +* _name_: (string) the name of the command (for example, if it is 'plugintest', + it can add a /plugintest command) +* _handler_: (function) the function to be called when the command is executed. +the handler takes *args* as a parameter, which is a string of what +is entered after the command. Split *args* (with _common.shell_split_) to use +that as command arguments. +* _help_: (string) the help message available for that command through the + _/help_ command. +* _completion_: (function) the completion for the args of that command. It + takes an input object as its only argument. This function should call the +_auto_completion()_ method on the input object, passing a list of possible + strings for the completion and returning the value of that call directly. +Everything else is handled by that _auto_completion()_ method (checking what + strings match, how to cycle between matches, etc). If you don’t want any + special completion for that command, just pass None (the default value). + +*del_command*:: +self+, +name+ + +This command removes a tab command added by your plugin. + +* _name_: (string) the name of the command you want to remove. + + +*add_tab_command*:: +self+, +tab_type+, +name+, +handler+, +help+, +completion+ + +This method adds a tab-custom command to poezio. For example you can add /dou +command that the user could call in a specific tab when the plugin is loaded. + + +* _tab_type_: You have to _import tabs_ in order to get tabs types. The + following are possible: +** _tabs.MucTab_: The MultiUserChat tabs +** _tabs.PrivateTab_: The Private tabs +** _tabs.ConversationTab_: The Roster tab +** _tabs.RosterInfoTab_: The MultiUserChat, Private, and Conversation tabs +** _tabs.ChatTab_: The MultiUserChat, Private, and Conversation tabs +** _tabs.MucListTab_: The MultiUserChat list tabs * _name_: (string) the name of the command (for example, if it is 'plugintest', it can add a /plugintest command) * _handler_: (function) the function to be called when the command is executed. @@ -76,6 +111,7 @@ It must accept the arguments specified for that event in the with the internal poezio events described below. + Attributes ----------