This commit is contained in:
ingvar1995 2016-05-28 22:43:51 +03:00
parent c27c35fcc0
commit 02507ab8b4
9 changed files with 37 additions and 6 deletions

View file

@ -12,6 +12,7 @@ All plugin's data should be stored in following structure:
|---plugin_short_name.py
|---/plugin_short_name/
|---settings.json
|---logs.txt
|---other_files
```
@ -21,6 +22,7 @@ Plugin can override following methods:
- get_window - plugins can have GUI, this method should return window instance or None for plugins without GUI.
- start - plugin was started.
- stop - plugin was stopped.
- close - app is closing, stop plugin.
- command - new command to plugin. Command can be entered in message field in format '/plugin <plugin_short_name> <command>'. Command 'help' should show user list of supported commands.
- lossless_packet - callback - incoming lossless packet from friend.
- lossy_packet - callback - incoming lossy packet from friend.
@ -33,4 +35,19 @@ Other methods:
- save_settings - saves settings to default location.
- load_translator - loads translations. Translations must be stored in directory with plugin's data. Files with translations must have the same name as in main app.
About import:
import statement will not work in case you import module that wasn't previously imported by main program and user use precompiled binary. It's recommended to use imp module and dynamic import instead.
About GUI:
It's strictly recommended to support both PySide and PyQt4 in GUI.
Exceptions:
Plugin's methods should not raise exceptions.
#Examples
You can find example of a plugin in [official repo](https://github.com/ingvar1995/toxygen_plugins)

View file

@ -8,6 +8,8 @@ Check [Plugin API](/docs/plugin_api.md) for more info
#How to install plugin
Toxygen comes without preinstalled plugins.
1. Put plugin and directory with it's data into /src/plugins/
2. Restart Toxygen
@ -15,3 +17,4 @@ Check [Plugin API](/docs/plugin_api.md) for more info
WARNING: It is unsecure to install plugin not from this list!
[Main repo](https://github.com/ingvar1995/toxygen_plugins)