Skip to content
This repository has been archived by the owner on Jun 25, 2022. It is now read-only.

Change APIVersion to 23 (fixes #119) #121

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 50 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -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&currency_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\<your-plugin-dir>` on windows resp. `~/.ts3client/plugins/pyTSon/scripts/<your-plugin-dir>` 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=<your-python-path>`
* 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\<your-plugin-dir>` on windows resp. `~/.ts3client/plugins/pyTSon/scripts/<your-plugin-dir>` 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=<your-python-path>`
- 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 \<TeamSpeak 3 client install\>/plugins/pyTSon/scripts/\<your-plugin-dir\> with a subclass of ts3plugin.
# How to develop a python plugin

Create a \*.py file in \<TeamSpeak 3 client install\>/plugins/pyTSon/scripts/\<your-plugin-dir\> 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.

Expand All @@ -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

Expand All @@ -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
Expand All @@ -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.

2 changes: 1 addition & 1 deletion generated/pregen/ts3plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
2 changes: 1 addition & 1 deletion ressources/python/devtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class PluginInstaller(object):

class %s(ts3plugin):
name = "%s"
apiVersion = 21
apiVersion = 23
version = "1.0.0"
author = ""
description = ""
Expand Down
2 changes: 1 addition & 1 deletion ressources/python/pytson.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,4 @@ def getCurrentApiVersion():
@return: the apiVersion
@rtype: str
"""
return 21
return 23
2 changes: 1 addition & 1 deletion ressources/python/ts3plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ressources/ui/repository.ui
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ p, li { white-space: pre-wrap; }
<string notr="true"/>
</property>
<property name="text">
<string notr="true">21</string>
<string notr="true">23</string>
</property>
<property name="readOnly">
<bool>true</bool>
Expand Down
2 changes: 1 addition & 1 deletion templates/ts3plugin.cpp.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down