Doc for the new API function
This commit is contained in:
parent
628ff3b0d9
commit
d3d4bd156c
1 changed files with 36 additions and 0 deletions
|
@ -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
|
command that the user could call when the plugin is loaded, by calling this
|
||||||
method with _foo_ as its _name_ argument. <<example-1,ex 1>>
|
method with _foo_ as its _name_ argument. <<example-1,ex 1>>
|
||||||
|
|
||||||
|
* _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',
|
* _name_: (string) the name of the command (for example, if it is 'plugintest',
|
||||||
it can add a /plugintest command)
|
it can add a /plugintest command)
|
||||||
* _handler_: (function) the function to be called when the command is executed.
|
* _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.
|
with the internal poezio events described below.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Attributes
|
Attributes
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue