diff --git a/README.md b/README.md index 26018d1..10d805a 100644 --- a/README.md +++ b/README.md @@ -1,62 +1,65 @@ [![Build Status](https://build.4qt.de/buildStatus/icon?job=pyTSon)](https://build.4qt.de/job/pyTSon/) [![Gitter chat](https://badges.gitter.im/pyTSon-ts3/gitter.png)](https://gitter.im/pyTSon-ts3/Lobby) [![PayPal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=thomas.pathmann%40gmail%2ecom&lc=GB&item_name=pyTSon¤cy_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted) # pyTSon + pyTSon is a plugin for the TeamSpeak 3 client, it offers a python3 interface for the plugin sdk. pyTSon has a minimum C/C++ part, so that the main plugin runs in embedded python. Current used python version is Python 3.5.2. -Batteries included -================== +# Batteries included + The python standard library is included, either built in the plugin or bundled in the lib directory (which is in sys.path by default). pyTSon has PythonQt included, so that scripts can have UIs written in python, see pyTSon's own configdialog or the scripting console for examples. -Dependencies -============ +# Dependencies + pyTSon has multiple layers of dependencies listed below. -Generating Code ---------------- -* [Python3](https://www.python.org/download/releases/3.0/) -* [pycparser](https://github.com/eliben/pycparser/) -* [jinja2](http://jinja.pocoo.org) - -Generating Documentation ------------------------- -* [Python3](https://www.python.org/download/releases/3.0/) -* [epydoc](http://epydoc.sourceforge.net) (which is only available for Python2, so we'll switch to another doctool in the future) - -Building --------- -* [Qt 5.12.1](https://download.qt.io/archive/qt/5.12/5.12.1/) (which is the version, the TeamSpeak 3 client is currently using) -* [Python 3.5.2](https://www.python.org/downloads/release/python-352/#Files) (configure with --enable-shared) -* [PythonQt](https://github.com/pathmann/PythonQt) -* [patchelf](http://nixos.org/patchelf.html) (linux; Version >= 0.9) - -Running -------- -* None! (At least none you have to care about, python is deployed with the plugin) - -How to use -========== +## Generating Code + +- [Python3](https://www.python.org/download/releases/3.0/) +- [pycparser](https://github.com/eliben/pycparser/) +- [jinja2](http://jinja.pocoo.org) + +## Generating Documentation + +- [Python3](https://www.python.org/download/releases/3.0/) +- [epydoc](http://epydoc.sourceforge.net) (which is only available for Python2, so we'll switch to another doctool in the future) + +## Building + +- [Qt 5.12.1](https://download.qt.io/archive/qt/5.12/5.12.1/) (which is the version, the TeamSpeak 3 client is currently using) +- [Python 3.5.2](https://www.python.org/downloads/release/python-352/#Files) (configure with --enable-shared) +- [PythonQt](https://github.com/pathmann/PythonQt) +- [patchelf](http://nixos.org/patchelf.html) (linux; Version >= 0.9) + +## Running + +- None! (At least none you have to care about, python is deployed with the plugin) + +# How to use + 1. Get the latest release for your Teamspeak client [here](https://github.com/pathmann/pyTSon/releases/) or compile the source yourself. -3. Restart your Teamspeak Client. -4. Download or write any pyTSon script and place it in `%APPDATA%\TS3Client\plugins\pyTSon\scripts\` on windows resp. `~/.ts3client/plugins/pyTSon/scripts/` on unix. -5. In your client click on "Plugins" => "pyTSon" => "Settings" and on the settings dialog click on "Reload All" and check the plugins checkbox if it's not checked already. - -How to build -============ -* Adjust the python include and lib path in [python.pri](https://github.com/pathmann/pyTSon/blob/master/python.pri) or run qmake with `qmake [...] PYTHONPATH=` -* Download/Clone PythonQt from [here](https://github.com/pathmann/PythonQt) to includes/ +2. Restart your Teamspeak Client. +3. Download or write any pyTSon script and place it in `%APPDATA%\TS3Client\plugins\pyTSon\scripts\` on windows resp. `~/.ts3client/plugins/pyTSon/scripts/` on unix. +4. In your client click on "Plugins" => "pyTSon" => "Settings" and on the settings dialog click on "Reload All" and check the plugins checkbox if it's not checked already. + +# How to build + +- Adjust the python include and lib path in [python.pri](https://github.com/pathmann/pyTSon/blob/master/python.pri) or run qmake with `qmake [...] PYTHONPATH=` +- Download/Clone PythonQt from [here](https://github.com/pathmann/PythonQt) to includes/ + ``` qmake (n)make ``` + Done -How to develop a python plugin -============================== -Create a *.py file in \/plugins/pyTSon/scripts/\ with a subclass of ts3plugin. +# How to develop a python plugin + +Create a \*.py file in \/plugins/pyTSon/scripts/\ with a subclass of ts3plugin. Needed class attributes are requestAutoload, name, version, apiVersion, author, description, offersConfigure, commandKeyword, infoTitle, menuItems, hotkeys. Otherwise pyTSon refuses to load the plugin. See ts3plugin.py or the documentation for a description of each attribute. @@ -67,6 +70,7 @@ TeamSpeak 3's library functions are available with the ts3lib module (eg err, my Constants are available in the ts3defines module (see ts3defines.py in include/ directory). Below is a small example plugin: + ```python from ts3plugin import ts3plugin @@ -76,7 +80,7 @@ class testplugin(ts3plugin): name = "test" requestAutoload = False version = "1.0" - apiVersion = 21 + apiVersion = 23 author = "Thomas \"PLuS\" Pathmann" description = "This is a testplugin" offersConfigure = True @@ -98,14 +102,14 @@ class testplugin(ts3plugin): else: ts3lib.printMessageToCurrentTab("got error %s" % err) ``` -Repository -========== -pyTSon can load plugins from online repositories. [pyTSon master](https://github.com/pathmann/pyTSon_repository) is included by default. Check [the Readme](https://github.com/pathmann/pyTSon_repository/blob/master/README.md) for more information, if you want to setup your own. -Releases -======== +# Repository + +pyTSon can load plugins from online repositories. [pyTSon master](https://github.com/pathmann/pyTSon_repository) is included by default. Check [the Readme](https://github.com/pathmann/pyTSon_repository/blob/master/README.md) for more information, if you want to setup your own. + +# Releases + Personally I work on my linux amd64 machine, other platforms are only tested for basic running, but of course feel free to open an issue, if there is something wrong on your platform and I'll have a look into it. Check the [release page](https://github.com/pathmann/pyTSon/releases) or myteamspeak.com within your client. If you are interested in the most recent version, check [this repository](https://repo.4qt.de/pyTSon/nightlies/) for automatic (untested) builds. - diff --git a/generated/pregen/ts3plugin.cpp b/generated/pregen/ts3plugin.cpp index d33ec3e..3d49568 100644 --- a/generated/pregen/ts3plugin.cpp +++ b/generated/pregen/ts3plugin.cpp @@ -61,7 +61,7 @@ class ts3plugin(object): """The name of the plugin. Use meaningful names. It has to be unique in the list of plugins.""" version = "1.0" """Version string of the plugin. pyTSon will use this string to determine, if a new version is available in an online repository.""" - apiVersion = 21 + apiVersion = 23 """apiVersion the plugin was developed for.""" author = "Thomas \"PLuS\" Pathmann" """Let the world know who made the plugin.""" diff --git a/ressources/python/devtools.py b/ressources/python/devtools.py index d2eab86..ebd7302 100644 --- a/ressources/python/devtools.py +++ b/ressources/python/devtools.py @@ -23,7 +23,7 @@ class PluginInstaller(object): class %s(ts3plugin): name = "%s" - apiVersion = 21 + apiVersion = 23 version = "1.0.0" author = "" description = "" diff --git a/ressources/python/pytson.py b/ressources/python/pytson.py index 10ab106..1971cdb 100644 --- a/ressources/python/pytson.py +++ b/ressources/python/pytson.py @@ -145,4 +145,4 @@ def getCurrentApiVersion(): @return: the apiVersion @rtype: str """ - return 21 + return 23 diff --git a/ressources/python/ts3plugin.py b/ressources/python/ts3plugin.py index 67c6656..739261e 100644 --- a/ressources/python/ts3plugin.py +++ b/ressources/python/ts3plugin.py @@ -46,7 +46,7 @@ class ts3plugin(object, metaclass=PluginMount): requestAutoload = False name = "__ts3plugin__" version = "1.0" - apiVersion = 21 + apiVersion = 23 author = "Thomas \"PLuS\" Pathmann" description = "This is the baseclass for all ts3 python plugins" offersConfigure = False diff --git a/ressources/ui/repository.ui b/ressources/ui/repository.ui index ac84e07..a5c6f7c 100644 --- a/ressources/ui/repository.ui +++ b/ressources/ui/repository.ui @@ -273,7 +273,7 @@ p, li { white-space: pre-wrap; } - 21 + 23 true diff --git a/templates/ts3plugin.cpp.tpl b/templates/ts3plugin.cpp.tpl index 48e98ad..2fce281 100644 --- a/templates/ts3plugin.cpp.tpl +++ b/templates/ts3plugin.cpp.tpl @@ -61,7 +61,7 @@ class ts3plugin(object): """The name of the plugin. Use meaningful names. It has to be unique in the list of plugins.""" version = "1.0" """Version string of the plugin. pyTSon will use this string to determine, if a new version is available in an online repository.""" - apiVersion = 21 + apiVersion = 23 """apiVersion the plugin was developed for.""" author = "Thomas \"PLuS\" Pathmann" """Let the world know who made the plugin."""