├── .gitignore ├── Changelog.html ├── LICENSE ├── README.md ├── VERSION ├── generated └── pregen │ ├── api.pdf │ ├── pyTSon-de_DE.qm │ ├── pyTSon-de_DE.ts │ ├── pyTSon.ts │ ├── ts3defines.py │ ├── ts3help.py │ ├── ts3lib.cpp │ ├── ts3lib.h │ ├── ts3plugin.cpp │ └── ts3plugin.h ├── includes └── pluginsdk │ ├── 21 │ ├── include │ │ ├── plugin_definitions.h │ │ ├── teamlog │ │ │ └── logtypes.h │ │ ├── teamspeak │ │ │ ├── clientlib_publicdefinitions.h │ │ │ ├── public_definitions.h │ │ │ ├── public_errors.h │ │ │ ├── public_errors_rare.h │ │ │ └── public_rare_definitions.h │ │ └── ts3_functions.h │ └── src │ │ ├── plugin.c │ │ └── plugin.h │ └── 23 │ ├── include │ ├── plugin_definitions.h │ ├── teamlog │ │ └── logtypes.h │ ├── teamspeak │ │ ├── clientlib_publicdefinitions.h │ │ ├── public_definitions.h │ │ ├── public_errors.h │ │ ├── public_errors_rare.h │ │ └── public_rare_definitions.h │ └── ts3_functions.h │ └── src │ ├── plugin.c │ └── plugin.h ├── interpreter ├── interpreter.pro ├── main.cpp ├── pytsonpathfactory.cpp └── pytsonpathfactory.h ├── pyTSon.pro ├── python.pri ├── pythonqt.pri ├── pythonqt_app ├── dialog.cpp ├── dialog.h ├── dialog.ui ├── dummyts3lib.cpp ├── dummyts3lib.h ├── global_shared.cpp ├── global_shared.h ├── main.cpp ├── pythonqt_app.pro └── pythonqtapphost.h ├── requirements.txt ├── ressources ├── loading.gif ├── octicons │ ├── LICENSE │ ├── alert.svg.png │ ├── arrow-down.svg.png │ ├── arrow-left.svg.png │ ├── arrow-right.svg.png │ ├── arrow-small-down.svg.png │ ├── arrow-small-left.svg.png │ ├── arrow-small-right.svg.png │ ├── arrow-small-up.svg.png │ ├── arrow-up.svg.png │ ├── beaker.svg.png │ ├── bell.svg.png │ ├── bold.svg.png │ ├── book.svg.png │ ├── bookmark.svg.png │ ├── briefcase.svg.png │ ├── broadcast.svg.png │ ├── browser.svg.png │ ├── bug.svg.png │ ├── calendar.svg.png │ ├── check.svg.png │ ├── checklist.svg.png │ ├── chevron-down.svg.png │ ├── chevron-left.svg.png │ ├── chevron-right.svg.png │ ├── chevron-up.svg.png │ ├── circle-slash.svg.png │ ├── circuit-board.svg.png │ ├── clippy.svg.png │ ├── clock.svg.png │ ├── cloud-download.svg.png │ ├── cloud-upload.svg.png │ ├── code.svg.png │ ├── comment-discussion.svg.png │ ├── comment.svg.png │ ├── credit-card.svg.png │ ├── dash.svg.png │ ├── dashboard.svg.png │ ├── database.svg.png │ ├── desktop-download.svg.png │ ├── device-camera-video.svg.png │ ├── device-camera.svg.png │ ├── device-desktop.svg.png │ ├── device-mobile.svg.png │ ├── diff-added.svg.png │ ├── diff-ignored.svg.png │ ├── diff-modified.svg.png │ ├── diff-removed.svg.png │ ├── diff-renamed.svg.png │ ├── diff.svg.png │ ├── ellipses.svg.png │ ├── ellipsis.svg.png │ ├── eye.svg.png │ ├── file-binary.svg.png │ ├── file-code.svg.png │ ├── file-directory.svg.png │ ├── file-media.svg.png │ ├── file-pdf.svg.png │ ├── file-submodule.svg.png │ ├── file-symlink-directory.svg.png │ ├── file-symlink-file.svg.png │ ├── file-text.svg.png │ ├── file-zip.svg.png │ ├── file.svg.png │ ├── flame.svg.png │ ├── fold.svg.png │ ├── gear.svg.png │ ├── gift.svg.png │ ├── gist-secret.svg.png │ ├── gist.svg.png │ ├── git-branch.svg.png │ ├── git-commit.svg.png │ ├── git-compare.svg.png │ ├── git-merge.svg.png │ ├── git-pull-request.svg.png │ ├── globe.svg.png │ ├── grabber.svg.png │ ├── graph.svg.png │ ├── heart.svg.png │ ├── history.svg.png │ ├── home.svg.png │ ├── horizontal-rule.svg.png │ ├── hubot.svg.png │ ├── inbox.svg.png │ ├── info.svg.png │ ├── issue-closed.svg.png │ ├── issue-opened.svg.png │ ├── issue-reopened.svg.png │ ├── italic.svg.png │ ├── jersey.svg.png │ ├── key.svg.png │ ├── keyboard.svg.png │ ├── law.svg.png │ ├── light-bulb.svg.png │ ├── link-external.svg.png │ ├── link.svg.png │ ├── list-ordered.svg.png │ ├── list-unordered.svg.png │ ├── location.svg.png │ ├── lock.svg.png │ ├── logo-gist.svg.png │ ├── logo-github.svg.png │ ├── mail-read.svg.png │ ├── mail-reply.svg.png │ ├── mail.svg.png │ ├── mark-github.svg.png │ ├── markdown.svg.png │ ├── megaphone.svg.png │ ├── mention.svg.png │ ├── milestone.svg.png │ ├── mirror.svg.png │ ├── mortar-board.svg.png │ ├── mute.svg.png │ ├── no-newline.svg.png │ ├── note.svg.png │ ├── octoface.svg.png │ ├── organization.svg.png │ ├── package.svg.png │ ├── paintcan.svg.png │ ├── pencil.svg.png │ ├── person.svg.png │ ├── pin.svg.png │ ├── plug.svg.png │ ├── plus-small.svg.png │ ├── plus.svg.png │ ├── primitive-dot.svg.png │ ├── primitive-square.svg.png │ ├── project.svg.png │ ├── pulse.svg.png │ ├── question.svg.png │ ├── quote.svg.png │ ├── radio-tower.svg.png │ ├── reply.svg.png │ ├── repo-clone.svg.png │ ├── repo-force-push.svg.png │ ├── repo-forked.svg.png │ ├── repo-pull.svg.png │ ├── repo-push.svg.png │ ├── repo.svg.png │ ├── rocket.svg.png │ ├── rss.svg.png │ ├── ruby.svg.png │ ├── screen-full.svg.png │ ├── screen-normal.svg.png │ ├── search.svg.png │ ├── server.svg.png │ ├── settings.svg.png │ ├── shield.svg.png │ ├── sign-in.svg.png │ ├── sign-out.svg.png │ ├── smiley.svg.png │ ├── squirrel.svg.png │ ├── star.svg.png │ ├── stop.svg.png │ ├── sync.svg.png │ ├── tag.svg.png │ ├── tasklist.svg.png │ ├── telescope.svg.png │ ├── terminal.svg.png │ ├── text-size.svg.png │ ├── three-bars.svg.png │ ├── thumbsdown.svg.png │ ├── thumbsup.svg.png │ ├── tools.svg.png │ ├── trashcan.svg.png │ ├── triangle-down.svg.png │ ├── triangle-left.svg.png │ ├── triangle-right.svg.png │ ├── triangle-up.svg.png │ ├── unfold.svg.png │ ├── unmute.svg.png │ ├── unverified.svg.png │ ├── verified.svg.png │ ├── versions.svg.png │ ├── watch.svg.png │ ├── x.svg.png │ └── zap.svg.png ├── python.png ├── python │ ├── _plugincmd.py │ ├── devtools.py │ ├── pluginhost.py │ ├── pythonqtpytson.py │ ├── pytson.py │ ├── pytsonui │ │ ├── __init__.py │ │ ├── config.py │ │ ├── console.py │ │ ├── dialogs.py │ │ └── repository.py │ ├── signalslot.py │ ├── ts3client.py │ ├── ts3lib.py │ ├── ts3plugin.py │ └── ts3widgets │ │ ├── __init__.py │ │ ├── filetransfer.py │ │ └── serverview.py ├── repositorymaster.json └── ui │ ├── filebrowser.ui │ ├── filecollision.ui │ ├── filetransfer.ui │ ├── installer.ui │ ├── pyTSon-configdialog.ui │ └── repository.ui ├── shared ├── pythonhost.cpp ├── pythonhost.h └── pythonqt │ ├── eventfilterobject.cpp │ ├── eventfilterobject.h │ ├── pythonqtpytson.cpp │ └── pythonqtpytson.h ├── src ├── global_shared.cpp ├── global_shared.h ├── pyconversion.cpp ├── pyconversion.h ├── pytson.cpp ├── pytson.h ├── pytsonhost.cpp ├── pytsonhost.h ├── singleton.h ├── src.pro ├── ts3callbackarguments.cpp ├── ts3callbackarguments.h ├── ts3logdispatcher.cpp └── ts3logdispatcher.h ├── templates ├── ts3defines.py.tpl ├── ts3help.py.tpl ├── ts3lib.cpp.tpl ├── ts3lib.h.tpl ├── ts3plugin.cpp.tpl └── ts3plugin.h.tpl └── tools ├── bundle.py ├── generator ├── epydoc.conf ├── generate_docs.py ├── generate_src.py ├── keywordonly.patch └── pytson │ ├── fake_libc_include │ ├── LICENSE │ ├── _ansi.h │ ├── _fake_defines.h │ ├── _fake_typedefs.h │ ├── _syslist.h │ ├── alloca.h │ ├── ar.h │ ├── argz.h │ ├── arpa │ │ └── inet.h │ ├── asm-generic │ │ └── int-ll64.h │ ├── assert.h │ ├── complex.h │ ├── ctype.h │ ├── dirent.h │ ├── dlfcn.h │ ├── endian.h │ ├── envz.h │ ├── errno.h │ ├── fastmath.h │ ├── fcntl.h │ ├── features.h │ ├── fenv.h │ ├── float.h │ ├── getopt.h │ ├── grp.h │ ├── iconv.h │ ├── ieeefp.h │ ├── inttypes.h │ ├── iso646.h │ ├── langinfo.h │ ├── libgen.h │ ├── libintl.h │ ├── limits.h │ ├── linux │ │ ├── socket.h │ │ └── version.h │ ├── locale.h │ ├── malloc.h │ ├── math.h │ ├── netdb.h │ ├── netinet │ │ ├── in.h │ │ └── tcp.h │ ├── newlib.h │ ├── openssl │ │ ├── err.h │ │ ├── evp.h │ │ ├── hmac.h │ │ ├── ssl.h │ │ └── x509v3.h │ ├── paths.h │ ├── process.h │ ├── pthread.h │ ├── pwd.h │ ├── reent.h │ ├── regdef.h │ ├── regex.h │ ├── sched.h │ ├── search.h │ ├── semaphore.h │ ├── setjmp.h │ ├── signal.h │ ├── stdarg.h │ ├── stdbool.h │ ├── stddef.h │ ├── stdint.h │ ├── stdio.h │ ├── stdlib.h │ ├── string.h │ ├── sys │ │ ├── ioctl.h │ │ ├── mman.h │ │ ├── poll.h │ │ ├── resource.h │ │ ├── select.h │ │ ├── socket.h │ │ ├── stat.h │ │ ├── sysctl.h │ │ ├── time.h │ │ ├── types.h │ │ ├── uio.h │ │ ├── un.h │ │ ├── utsname.h │ │ └── wait.h │ ├── syslog.h │ ├── tar.h │ ├── termios.h │ ├── tgmath.h │ ├── time.h │ ├── unctrl.h │ ├── unistd.h │ ├── utime.h │ ├── utmp.h │ ├── wchar.h │ ├── wctype.h │ └── zlib.h │ ├── fake_pyTSon │ ├── Python.h │ ├── PythonQtInstanceWrapper.h │ ├── QObject │ ├── QString │ ├── global_shared.h │ ├── pyconversion.h │ ├── pythonhost.h │ └── ts3logdispatcher.h │ ├── parsing.py │ └── wrappers.py └── pylupdate.py /.gitignore: -------------------------------------------------------------------------------- 1 | #C++ and libs 2 | *.so 3 | *.dll 4 | *.dylib 5 | *.a 6 | *.o 7 | *.lib 8 | 9 | #Qt 10 | *.pro.user 11 | Makefile* 12 | 13 | #Visual Studio 14 | *.sln 15 | *.vcxproj* 16 | 17 | #Python 18 | __pycache__ 19 | 20 | #pyTSon 21 | includes/PythonQt 22 | includes/python-352 23 | build 24 | src/build 25 | 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # This repository is archived. pyTSon will not work with your up-to-date TeamSpeak 3 client. 2 | Feel free to fork this repository. 3 | 4 | # pyTSon 5 | pyTSon is a plugin for the TeamSpeak 3 client, it offers a python3 interface for the plugin sdk. 6 | pyTSon has a minimum C/C++ part, so that the main plugin runs in embedded python. 7 | 8 | Current used python version is Python 3.5.2. 9 | 10 | Batteries included 11 | ================== 12 | The python standard library is included, either built in the plugin or bundled in the lib directory (which is in sys.path by default). 13 | pyTSon has PythonQt included, so that scripts can have UIs written in python, see pyTSon's own configdialog or the scripting console for examples. 14 | 15 | Dependencies 16 | ============ 17 | pyTSon has multiple layers of dependencies listed below. 18 | 19 | Generating Code 20 | --------------- 21 | * [Python3](https://www.python.org/download/releases/3.0/) 22 | * [pycparser](https://github.com/eliben/pycparser/) 23 | * [jinja2](http://jinja.pocoo.org) 24 | 25 | Generating Documentation 26 | ------------------------ 27 | * [Python3](https://www.python.org/download/releases/3.0/) 28 | * [epydoc](http://epydoc.sourceforge.net) (which is only available for Python2, so we'll switch to another doctool in the future) 29 | 30 | Building 31 | -------- 32 | * [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) 33 | * [Python 3.5.2](https://www.python.org/downloads/release/python-352/#Files) (configure with --enable-shared) 34 | * [PythonQt](https://github.com/pathmann/PythonQt) 35 | * [patchelf](http://nixos.org/patchelf.html) (linux; Version >= 0.9) 36 | 37 | Running 38 | ------- 39 | * None! (At least none you have to care about, python is deployed with the plugin) 40 | 41 | How to use 42 | ========== 43 | 1. Get the latest release for your Teamspeak client [here](https://github.com/pathmann/pyTSon/releases/) or compile the source yourself. 44 | 3. Restart your Teamspeak Client. 45 | 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. 46 | 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. 47 | 48 | How to build 49 | ============ 50 | * 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=` 51 | * Download/Clone PythonQt from [here](https://github.com/pathmann/PythonQt) to includes/ 52 | ``` 53 | qmake 54 | (n)make 55 | ``` 56 | Done 57 | 58 | How to develop a python plugin 59 | ============================== 60 | Create a *.py file in \/plugins/pyTSon/scripts/\ with a subclass of ts3plugin. 61 | Needed class attributes are requestAutoload, name, version, apiVersion, author, description, offersConfigure, commandKeyword, infoTitle, menuItems, hotkeys. 62 | Otherwise pyTSon refuses to load the plugin. See ts3plugin.py or the documentation for a description of each attribute. 63 | 64 | On load, pyTSon will create an instance of your class (call the constructor), after that callbacks are called (if available) as methods of the created instance, eg if you were poked, onClientPokeEvent(self, schid, fromClientID, pokerName, pokerUniqueIdentity, message, ffIgnored) will be called. 65 | On unload, pyTSon will call stop and delete the instance of your class. 66 | 67 | TeamSpeak 3's library functions are available with the ts3lib module (eg err, myid = ts3lib.getClientID(schid)). 68 | Constants are available in the ts3defines module (see ts3defines.py in include/ directory). 69 | 70 | Below is a small example plugin: 71 | ```python 72 | from ts3plugin import ts3plugin 73 | 74 | import ts3lib, ts3defines 75 | 76 | class testplugin(ts3plugin): 77 | name = "test" 78 | requestAutoload = False 79 | version = "1.0" 80 | apiVersion = 21 81 | author = "Thomas \"PLuS\" Pathmann" 82 | description = "This is a testplugin" 83 | offersConfigure = True 84 | commandKeyword = "" 85 | infoTitle = "" 86 | menuItems = []#[(ts3defines.PluginMenuType.PLUGIN_MENU_TYPE_CLIENT, 0, "text", "icon.png")] 87 | hotkeys = []#[("keyword", "description")] 88 | 89 | def __init__(self): 90 | ts3lib.printMessageToCurrentTab("Yay, we are running!") 91 | 92 | def stop(self): 93 | ts3lib.printMessageToCurrentTab("Oh no, we were stopped :(") 94 | 95 | def onNewChannelEvent(self, schid, channelID, channelParentID): 96 | err, name = ts3lib.getChannelVariableAsString(schid, channelID, ts3defines.ChannelProperties.CHANNEL_NAME) 97 | if err == ts3defines.ERROR_ok: 98 | ts3lib.printMessageToCurrentTab("new channel %s" % name) 99 | else: 100 | ts3lib.printMessageToCurrentTab("got error %s" % err) 101 | ``` 102 | Repository 103 | ========== 104 | 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. 105 | 106 | Releases 107 | ======== 108 | 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. 109 | 110 | Check the [release page](https://github.com/pathmann/pyTSon/releases) or myteamspeak.com within your client. 111 | If you are interested in the most recent version, check [this repository](https://repo.4qt.de/pyTSon/nightlies/) for automatic (untested) builds. 112 | 113 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 1.2.4 2 | #YOU SHOULD NOT CHANGE THE CONTENT OF THIS FILE 3 | -------------------------------------------------------------------------------- /generated/pregen/api.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/generated/pregen/api.pdf -------------------------------------------------------------------------------- /generated/pregen/pyTSon-de_DE.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/generated/pregen/pyTSon-de_DE.qm -------------------------------------------------------------------------------- /includes/pluginsdk/21/include/plugin_definitions.h: -------------------------------------------------------------------------------- 1 | #ifndef PLUGIN_DEFINITIONS 2 | #define PLUGIN_DEFINITIONS 3 | 4 | /* Return values for ts3plugin_offersConfigure */ 5 | enum PluginConfigureOffer { 6 | PLUGIN_OFFERS_NO_CONFIGURE = 0, /* Plugin does not implement ts3plugin_configure */ 7 | PLUGIN_OFFERS_CONFIGURE_NEW_THREAD, /* Plugin does implement ts3plugin_configure and requests to run this function in an own thread */ 8 | PLUGIN_OFFERS_CONFIGURE_QT_THREAD /* Plugin does implement ts3plugin_configure and requests to run this function in the Qt GUI thread */ 9 | }; 10 | 11 | enum PluginMessageTarget { 12 | PLUGIN_MESSAGE_TARGET_SERVER = 0, 13 | PLUGIN_MESSAGE_TARGET_CHANNEL 14 | }; 15 | 16 | enum PluginItemType { 17 | PLUGIN_SERVER = 0, 18 | PLUGIN_CHANNEL, 19 | PLUGIN_CLIENT 20 | }; 21 | 22 | enum PluginMenuType { 23 | PLUGIN_MENU_TYPE_GLOBAL = 0, 24 | PLUGIN_MENU_TYPE_CHANNEL, 25 | PLUGIN_MENU_TYPE_CLIENT 26 | }; 27 | 28 | #define PLUGIN_MENU_BUFSZ 128 29 | 30 | struct PluginMenuItem { 31 | enum PluginMenuType type; 32 | int id; 33 | char text[PLUGIN_MENU_BUFSZ]; 34 | char icon[PLUGIN_MENU_BUFSZ]; 35 | }; 36 | 37 | #define PLUGIN_HOTKEY_BUFSZ 128 38 | 39 | struct PluginHotkey { 40 | char keyword[PLUGIN_HOTKEY_BUFSZ]; 41 | char description[PLUGIN_HOTKEY_BUFSZ]; 42 | }; 43 | 44 | struct PluginBookmarkList; 45 | struct PluginBookmarkItem { 46 | char* name; 47 | unsigned char isFolder; 48 | unsigned char reserved[3]; 49 | union{ 50 | char* uuid; 51 | struct PluginBookmarkList* folder; 52 | }; 53 | }; 54 | 55 | struct PluginBookmarkList{ 56 | int itemcount; 57 | struct PluginBookmarkItem items[1]; //should be 0 but compiler complains 58 | }; 59 | 60 | enum PluginGuiProfile{ 61 | PLUGIN_GUI_SOUND_CAPTURE = 0, 62 | PLUGIN_GUI_SOUND_PLAYBACK, 63 | PLUGIN_GUI_HOTKEY, 64 | PLUGIN_GUI_SOUNDPACK, 65 | PLUGIN_GUI_IDENTITY 66 | }; 67 | 68 | enum PluginConnectTab{ 69 | PLUGIN_CONNECT_TAB_NEW = 0, 70 | PLUGIN_CONNECT_TAB_CURRENT, 71 | PLUGIN_CONNECT_TAB_NEW_IF_CURRENT_CONNECTED 72 | }; 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /includes/pluginsdk/21/include/teamlog/logtypes.h: -------------------------------------------------------------------------------- 1 | #ifndef TEAMLOG_LOGTYPES_H 2 | #define TEAMLOG_LOGTYPES_H 3 | 4 | enum LogTypes { 5 | LogType_NONE = 0x0000, 6 | LogType_FILE = 0x0001, 7 | LogType_CONSOLE = 0x0002, 8 | LogType_USERLOGGING = 0x0004, 9 | LogType_NO_NETLOGGING = 0x0008, 10 | LogType_DATABASE = 0x0010, 11 | LogType_SYSLOG = 0x0020, 12 | }; 13 | 14 | enum LogLevel { 15 | LogLevel_CRITICAL = 0, //these messages stop the program 16 | LogLevel_ERROR, //everything that is really bad, but not so bad we need to shut down 17 | LogLevel_WARNING, //everything that *might* be bad 18 | LogLevel_DEBUG, //output that might help find a problem 19 | LogLevel_INFO, //informational output, like "starting database version x.y.z" 20 | LogLevel_DEVEL //developer only output (will not be displayed in release mode) 21 | }; 22 | 23 | #endif //TEAMLOG_LOGTYPES_H 24 | -------------------------------------------------------------------------------- /includes/pluginsdk/21/include/teamspeak/clientlib_publicdefinitions.h: -------------------------------------------------------------------------------- 1 | #ifndef CLIENTLIB_PUBLICDEFINITIONS_H 2 | #define CLIENTLIB_PUBLICDEFINITIONS_H 3 | 4 | enum Visibility { 5 | ENTER_VISIBILITY = 0, 6 | RETAIN_VISIBILITY, 7 | LEAVE_VISIBILITY 8 | }; 9 | 10 | enum ConnectStatus { 11 | STATUS_DISCONNECTED = 0, //There is no activity to the server, this is the default value 12 | STATUS_CONNECTING, //We are trying to connect, we haven't got a clientID yet, we haven't been accepted by the server 13 | STATUS_CONNECTED, //The server has accepted us, we can talk and hear and we got a clientID, but we don't have the channels and clients yet, we can get server infos (welcome msg etc.) 14 | STATUS_CONNECTION_ESTABLISHING,//we are CONNECTED and we are visible 15 | STATUS_CONNECTION_ESTABLISHED, //we are CONNECTED and we have the client and channels available 16 | }; 17 | 18 | enum LocalTestMode { 19 | TEST_MODE_OFF = 0, 20 | TEST_MODE_VOICE_LOCAL_ONLY = 1, 21 | TEST_MODE_VOICE_LOCAL_AND_REMOTE = 2, 22 | }; 23 | 24 | #endif //CLIENTLIB_PUBLICDEFINITIONS_H 25 | -------------------------------------------------------------------------------- /includes/pluginsdk/21/include/teamspeak/public_errors_rare.h: -------------------------------------------------------------------------------- 1 | #ifndef PUBLIC_ERRORS__RARE_H 2 | #define PUBLIC_ERRORS__RARE_H 3 | 4 | //The idea here is: the values are 2 bytes wide, the first byte identifies the group, the second the count within that group 5 | 6 | //client 7 | const unsigned int ERROR_client_invalid_password = 0x0208; 8 | const unsigned int ERROR_client_too_many_clones_connected = 0x0209; 9 | const unsigned int ERROR_client_is_online = 0x020b; 10 | 11 | //channel 12 | const unsigned int ERROR_channel_is_private_channel = 0x030e; 13 | //note 0x030f is defined in public_errors; 14 | 15 | //database 16 | const unsigned int ERROR_database = 0x0500; 17 | const unsigned int ERROR_database_empty_result = 0x0501; 18 | const unsigned int ERROR_database_duplicate_entry = 0x0502; 19 | const unsigned int ERROR_database_no_modifications = 0x0503; 20 | const unsigned int ERROR_database_constraint = 0x0504; 21 | const unsigned int ERROR_database_reinvoke = 0x0505; 22 | 23 | //permissions 24 | const unsigned int ERROR_permission_invalid_group_id = 0x0a00; 25 | const unsigned int ERROR_permission_duplicate_entry = 0x0a01; 26 | const unsigned int ERROR_permission_invalid_perm_id = 0x0a02; 27 | const unsigned int ERROR_permission_empty_result = 0x0a03; 28 | const unsigned int ERROR_permission_default_group_forbidden = 0x0a04; 29 | const unsigned int ERROR_permission_invalid_size = 0x0a05; 30 | const unsigned int ERROR_permission_invalid_value = 0x0a06; 31 | const unsigned int ERROR_permissions_group_not_empty = 0x0a07; 32 | const unsigned int ERROR_permissions_insufficient_group_power = 0x0a09; 33 | const unsigned int ERROR_permissions_insufficient_permission_power = 0x0a0a; 34 | const unsigned int ERROR_permission_template_group_is_used = 0x0a0b; 35 | //0x0a0c is in public_errors.h 36 | 37 | //server 38 | const unsigned int ERROR_server_deployment_active = 0x0405; 39 | const unsigned int ERROR_server_unable_to_stop_own_server = 0x0406; 40 | const unsigned int ERROR_server_wrong_machineid = 0x0408; 41 | const unsigned int ERROR_server_modal_quit = 0x040c; 42 | 43 | //messages 44 | const unsigned int ERROR_message_invalid_id = 0x0c00; 45 | 46 | //ban 47 | const unsigned int ERROR_ban_invalid_id = 0x0d00; 48 | const unsigned int ERROR_connect_failed_banned = 0x0d01; 49 | const unsigned int ERROR_rename_failed_banned = 0x0d02; 50 | const unsigned int ERROR_ban_flooding = 0x0d03; 51 | 52 | //tts 53 | const unsigned int ERROR_tts_unable_to_initialize = 0x0e00; 54 | 55 | //privilege key 56 | const unsigned int ERROR_privilege_key_invalid = 0x0f00; 57 | 58 | //voip 59 | const unsigned int ERROR_voip_pjsua = 0x1000; 60 | const unsigned int ERROR_voip_already_initialized = 0x1001; 61 | const unsigned int ERROR_voip_too_many_accounts = 0x1002; 62 | const unsigned int ERROR_voip_invalid_account = 0x1003; 63 | const unsigned int ERROR_voip_internal_error = 0x1004; 64 | const unsigned int ERROR_voip_invalid_connectionId = 0x1005; 65 | const unsigned int ERROR_voip_cannot_answer_initiated_call = 0x1006; 66 | const unsigned int ERROR_voip_not_initialized = 0x1007; 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /includes/pluginsdk/23/include/plugin_definitions.h: -------------------------------------------------------------------------------- 1 | #ifndef PLUGIN_DEFINITIONS 2 | #define PLUGIN_DEFINITIONS 3 | 4 | /* Return values for ts3plugin_offersConfigure */ 5 | enum PluginConfigureOffer { 6 | PLUGIN_OFFERS_NO_CONFIGURE = 0, /* Plugin does not implement ts3plugin_configure */ 7 | PLUGIN_OFFERS_CONFIGURE_NEW_THREAD, /* Plugin does implement ts3plugin_configure and requests to run this function in an own thread */ 8 | PLUGIN_OFFERS_CONFIGURE_QT_THREAD /* Plugin does implement ts3plugin_configure and requests to run this function in the Qt GUI thread */ 9 | }; 10 | 11 | enum PluginMessageTarget { 12 | PLUGIN_MESSAGE_TARGET_SERVER = 0, 13 | PLUGIN_MESSAGE_TARGET_CHANNEL 14 | }; 15 | 16 | enum PluginItemType { 17 | PLUGIN_SERVER = 0, 18 | PLUGIN_CHANNEL, 19 | PLUGIN_CLIENT 20 | }; 21 | 22 | enum PluginMenuType { 23 | PLUGIN_MENU_TYPE_GLOBAL = 0, 24 | PLUGIN_MENU_TYPE_CHANNEL, 25 | PLUGIN_MENU_TYPE_CLIENT 26 | }; 27 | 28 | #define PLUGIN_MENU_BUFSZ 128 29 | 30 | struct PluginMenuItem { 31 | enum PluginMenuType type; 32 | int id; 33 | char text[PLUGIN_MENU_BUFSZ]; 34 | char icon[PLUGIN_MENU_BUFSZ]; 35 | }; 36 | 37 | #define PLUGIN_HOTKEY_BUFSZ 128 38 | 39 | struct PluginHotkey { 40 | char keyword[PLUGIN_HOTKEY_BUFSZ]; 41 | char description[PLUGIN_HOTKEY_BUFSZ]; 42 | }; 43 | 44 | struct PluginBookmarkList; 45 | struct PluginBookmarkItem { 46 | char* name; 47 | unsigned char isFolder; 48 | unsigned char reserved[3]; 49 | union{ 50 | char* uuid; 51 | struct PluginBookmarkList* folder; 52 | }; 53 | }; 54 | 55 | struct PluginBookmarkList{ 56 | int itemcount; 57 | struct PluginBookmarkItem items[1]; //should be 0 but compiler complains 58 | }; 59 | 60 | enum PluginGuiProfile{ 61 | PLUGIN_GUI_SOUND_CAPTURE = 0, 62 | PLUGIN_GUI_SOUND_PLAYBACK, 63 | PLUGIN_GUI_HOTKEY, 64 | PLUGIN_GUI_SOUNDPACK, 65 | PLUGIN_GUI_IDENTITY 66 | }; 67 | 68 | enum PluginConnectTab{ 69 | PLUGIN_CONNECT_TAB_NEW = 0, 70 | PLUGIN_CONNECT_TAB_CURRENT, 71 | PLUGIN_CONNECT_TAB_NEW_IF_CURRENT_CONNECTED 72 | }; 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /includes/pluginsdk/23/include/teamlog/logtypes.h: -------------------------------------------------------------------------------- 1 | #ifndef TEAMLOG_LOGTYPES_H 2 | #define TEAMLOG_LOGTYPES_H 3 | 4 | enum LogTypes { 5 | LogType_NONE = 0x0000, 6 | LogType_FILE = 0x0001, 7 | LogType_CONSOLE = 0x0002, 8 | LogType_USERLOGGING = 0x0004, 9 | LogType_NO_NETLOGGING = 0x0008, 10 | LogType_DATABASE = 0x0010, 11 | LogType_SYSLOG = 0x0020, 12 | }; 13 | 14 | enum LogLevel { 15 | LogLevel_CRITICAL = 0, //these messages stop the program 16 | LogLevel_ERROR, //everything that is really bad, but not so bad we need to shut down 17 | LogLevel_WARNING, //everything that *might* be bad 18 | LogLevel_DEBUG, //output that might help find a problem 19 | LogLevel_INFO, //informational output, like "starting database version x.y.z" 20 | LogLevel_DEVEL //developer only output (will not be displayed in release mode) 21 | }; 22 | 23 | #endif //TEAMLOG_LOGTYPES_H 24 | -------------------------------------------------------------------------------- /includes/pluginsdk/23/include/teamspeak/clientlib_publicdefinitions.h: -------------------------------------------------------------------------------- 1 | #ifndef CLIENTLIB_PUBLICDEFINITIONS_H 2 | #define CLIENTLIB_PUBLICDEFINITIONS_H 3 | 4 | enum Visibility { 5 | ENTER_VISIBILITY = 0, 6 | RETAIN_VISIBILITY, 7 | LEAVE_VISIBILITY 8 | }; 9 | 10 | enum ConnectStatus { 11 | STATUS_DISCONNECTED = 0, //There is no activity to the server, this is the default value 12 | STATUS_CONNECTING, //We are trying to connect, we haven't got a clientID yet, we haven't been accepted by the server 13 | STATUS_CONNECTED, //The server has accepted us, we can talk and hear and we got a clientID, but we don't have the channels and clients yet, we can get server infos (welcome msg etc.) 14 | STATUS_CONNECTION_ESTABLISHING,//we are CONNECTED and we are visible 15 | STATUS_CONNECTION_ESTABLISHED, //we are CONNECTED and we have the client and channels available 16 | }; 17 | 18 | enum LocalTestMode { 19 | TEST_MODE_OFF = 0, 20 | TEST_MODE_VOICE_LOCAL_ONLY = 1, 21 | TEST_MODE_VOICE_LOCAL_AND_REMOTE = 2, 22 | }; 23 | 24 | #endif //CLIENTLIB_PUBLICDEFINITIONS_H 25 | -------------------------------------------------------------------------------- /includes/pluginsdk/23/include/teamspeak/public_errors_rare.h: -------------------------------------------------------------------------------- 1 | #ifndef PUBLIC_ERRORS__RARE_H 2 | #define PUBLIC_ERRORS__RARE_H 3 | 4 | //The idea here is: the values are 2 bytes wide, the first byte identifies the group, the second the count within that group 5 | 6 | enum Ts3RareErrorType { 7 | //client 8 | ERROR_client_invalid_password = 0x0208, 9 | ERROR_client_too_many_clones_connected = 0x0209, 10 | ERROR_client_is_online = 0x020b, 11 | 12 | //channel 13 | ERROR_channel_is_private_channel = 0x030e, 14 | //note 0x030f is defined in public_errors; 15 | 16 | //database 17 | ERROR_database = 0x0500, 18 | ERROR_database_empty_result = 0x0501, 19 | ERROR_database_duplicate_entry = 0x0502, 20 | ERROR_database_no_modifications = 0x0503, 21 | ERROR_database_constraint = 0x0504, 22 | ERROR_database_reinvoke = 0x0505, 23 | 24 | //permissions 25 | ERROR_permission_invalid_group_id = 0x0a00, 26 | ERROR_permission_duplicate_entry = 0x0a01, 27 | ERROR_permission_invalid_perm_id = 0x0a02, 28 | ERROR_permission_empty_result = 0x0a03, 29 | ERROR_permission_default_group_forbidden = 0x0a04, 30 | ERROR_permission_invalid_size = 0x0a05, 31 | ERROR_permission_invalid_value = 0x0a06, 32 | ERROR_permissions_group_not_empty = 0x0a07, 33 | ERROR_permissions_insufficient_group_power = 0x0a09, 34 | ERROR_permissions_insufficient_permission_power = 0x0a0a, 35 | ERROR_permission_template_group_is_used = 0x0a0b, 36 | //0x0a0c is in public_errors.h 37 | ERROR_permission_used_by_integration = 0x0a0d, 38 | 39 | //server 40 | ERROR_server_deployment_active = 0x0405, 41 | ERROR_server_unable_to_stop_own_server = 0x0406, 42 | ERROR_server_wrong_machineid = 0x0408, 43 | ERROR_server_modal_quit = 0x040c, 44 | ERROR_server_time_difference_too_large = 0x040f, 45 | ERROR_server_blacklisted = 0x0410, 46 | 47 | //messages 48 | ERROR_message_invalid_id = 0x0c00, 49 | 50 | //ban 51 | ERROR_ban_invalid_id = 0x0d00, 52 | ERROR_connect_failed_banned = 0x0d01, 53 | ERROR_rename_failed_banned = 0x0d02, 54 | ERROR_ban_flooding = 0x0d03, 55 | 56 | //tts 57 | ERROR_tts_unable_to_initialize = 0x0e00, 58 | 59 | //privilege key 60 | ERROR_privilege_key_invalid = 0x0f00, 61 | 62 | //voip 63 | ERROR_voip_pjsua = 0x1000, 64 | ERROR_voip_already_initialized = 0x1001, 65 | ERROR_voip_too_many_accounts = 0x1002, 66 | ERROR_voip_invalid_account = 0x1003, 67 | ERROR_voip_internal_error = 0x1004, 68 | ERROR_voip_invalid_connectionId = 0x1005, 69 | ERROR_voip_cannot_answer_initiated_call = 0x1006, 70 | ERROR_voip_not_initialized = 0x1007, 71 | 72 | //ed25519 73 | ERROR_ed25519_rng_fail = 0x1300, 74 | ERROR_ed25519_signature_invalid = 0x1301, 75 | ERROR_ed25519_invalid_key = 0x1302, 76 | ERROR_ed25519_unable_to_create_valid_key = 0x1303, 77 | ERROR_ed25519_out_of_memory = 0x1304, 78 | ERROR_ed25519_exists = 0x1305, 79 | ERROR_ed25519_read_beyond_eof = 0x1306, 80 | ERROR_ed25519_write_beyond_eof = 0x1307, 81 | ERROR_ed25519_version = 0x1308, 82 | ERROR_ed25519_invalid = 0x1309, 83 | ERROR_ed25519_invalid_date = 0x130A, 84 | ERROR_ed25519_unauthorized = 0x130B, 85 | ERROR_ed25519_invalid_type = 0x130C, 86 | ERROR_ed25519_address_nomatch = 0x130D, 87 | ERROR_ed25519_not_valid_yet = 0x130E, 88 | ERROR_ed25519_expired = 0x130F, 89 | ERROR_ed25519_index_out_of_range = 0x1310, 90 | ERROR_ed25519_invalid_size = 0x1311, 91 | 92 | //mytsid - client 93 | ERROR_invalid_mytsid_data = 0x1200, 94 | ERROR_invalid_integration = 0x1201, 95 | }; 96 | 97 | #endif 98 | -------------------------------------------------------------------------------- /interpreter/interpreter.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | TARGET = python 3 | QT -= core gui 4 | 5 | DESTDIR = $$PWD/../build 6 | OBJECTS_DIR = $$PWD/build 7 | MOC_DIR = $$PWD/build 8 | RCC_DIR = $$PWD/build 9 | UI_DIR = $$PWD/build 10 | 11 | HEADERS += \ 12 | pytsonpathfactory.h 13 | 14 | SOURCES += main.cpp \ 15 | pytsonpathfactory.cpp 16 | 17 | unix:!mac { 18 | QMAKE_RPATHDIR += $ORIGIN 19 | } 20 | 21 | include ($$PWD/../python.pri) 22 | 23 | macx { 24 | CONFIG -= app_bundle 25 | QMAKE_POST_LINK += install_name_tool -change $$absolute_path("$${PYTHONPATH}/lib/libpython3.5m.dylib") @loader_path/libpython3.5m.dylib ${DESTDIR}${TARGET} & 26 | } 27 | -------------------------------------------------------------------------------- /interpreter/pytsonpathfactory.cpp: -------------------------------------------------------------------------------- 1 | #include "pytsonpathfactory.h" 2 | 3 | #if defined(_WIN32) 4 | #define realpath(N,R) _fullpath((R),(N),_MAX_PATH) 5 | #endif 6 | 7 | #include 8 | #include 9 | 10 | pytsonpathfactory::pytsonpathfactory(const char* execname) { 11 | std::string tmp(execname); 12 | 13 | char* norm = realpath(tmp.c_str(), NULL); 14 | m_exec = std::string(norm); 15 | free(norm); 16 | 17 | //delete binary name 18 | m_base = m_exec.substr(0, m_exec.find_last_of("\\/")); 19 | //m_base = ~/.ts3client/plugins/pyTSon 20 | 21 | m_inc = std::string(m_base); 22 | m_inc += PATHSEP; 23 | m_inc += "include"; 24 | //m_inc = ~/.ts3client/plugins/pyTSon/include 25 | 26 | m_lib = std::string(m_base); 27 | m_lib += PATHSEP; 28 | m_lib += "lib"; 29 | #ifndef _WIN32 30 | m_lib += PATHSEP; 31 | m_lib += "python3.5"; 32 | #endif 33 | //m_lib = ~/.ts3client/plugins/pyTSon/lib/python3.5 34 | 35 | m_dynload = std::string(m_lib); 36 | m_dynload += PATHSEP; 37 | m_dynload += "lib-dynload"; 38 | //m_dynload = ~/.ts3client/plugins/pyTSon/lib/python3.5m/lib-dynload 39 | 40 | m_site = std::string(m_lib); 41 | m_site += PATHSEP; 42 | m_site += "site-packages"; 43 | //m_site = ~/.ts3client/plugins/pyTSon/lib/python3.5m/site-packages 44 | } 45 | 46 | const std::string pytsonpathfactory::moduleSearchPath() const { 47 | std::string ret(m_lib); 48 | ret += PATHDELIM; 49 | ret += m_dynload; 50 | ret += PATHDELIM; 51 | ret += m_site; 52 | // = ~/.ts3client/plugins/pyTSon/lib/python3.5m/lib:~/.ts3client/plugins/pyTSon/lib/python3.5m/lib-dynload 53 | 54 | return ret; 55 | } 56 | -------------------------------------------------------------------------------- /interpreter/pytsonpathfactory.h: -------------------------------------------------------------------------------- 1 | #ifndef PYTSONPATHFACTORY_H 2 | #define PYTSONPATHFACTORY_H 3 | 4 | #include 5 | 6 | #if defined(_WIN32) 7 | #define PATHSEP "\\" 8 | #define PATHDELIM ";" 9 | #else 10 | //mac + linux 11 | #define PATHSEP "/" 12 | #define PATHDELIM ":" 13 | #endif 14 | 15 | class pytsonpathfactory { 16 | public: 17 | pytsonpathfactory(const char* execname); 18 | 19 | const std::string basepath() const { return m_base; } 20 | 21 | const std::string includePath() const { return m_inc; } 22 | const std::string libPath() const { return m_lib; } 23 | const std::string dynloadPath() const { return m_dynload; } 24 | const std::string sitepackPath() const { return m_site; } 25 | 26 | const std::string executablePath() const { return m_exec; } 27 | 28 | const std::string moduleSearchPath() const; 29 | private: 30 | std::string m_base; 31 | std::string m_exec; 32 | std::string m_inc; 33 | std::string m_lib; 34 | std::string m_dynload; 35 | std::string m_site; 36 | }; 37 | 38 | #endif // PYTSONPATHFACTORY_H 39 | -------------------------------------------------------------------------------- /pyTSon.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | SUBDIRS = src interpreter pythonqt_app 3 | -------------------------------------------------------------------------------- /python.pri: -------------------------------------------------------------------------------- 1 | JENKINS = $$(JENKINS_BUILD) 2 | 3 | unix:!mac { 4 | isEmpty(PYTHONPATH) { 5 | equals(JENKINS, 1) { 6 | PYTHONPATH = /home/build/libs/python/3.5.2/install 7 | } 8 | else { 9 | PYTHONPATH = $$PWD/includes/python-352/install 10 | } 11 | } 12 | 13 | INCLUDEPATH += $${PYTHONPATH}/include/python3.5m 14 | LIBS += $${PYTHONPATH}/lib/libpython3.5m.so 15 | LIBS += -lpthread -ldl -lutil 16 | 17 | contains(QMAKE_HOST.arch, x86_64) { 18 | QMAKE_POST_LINK += patchelf --replace-needed libpython3.5m.so.1.0 libpython3.5m_64.so ${DESTDIR}${TARGET} & 19 | } 20 | else { 21 | QMAKE_POST_LINK += patchelf --replace-needed libpython3.5m.so.1.0 libpython3.5m_32.so ${DESTDIR}${TARGET} & 22 | } 23 | } 24 | 25 | macx { 26 | isEmpty(PYTHONPATH) { 27 | equals(JENKINS, 1) { 28 | PYTHONPATH = /Users/build/libs/python/3.5.2/install 29 | } 30 | else { 31 | PYTHONPATH = $$PWD/includes/python-352/install 32 | } 33 | } 34 | 35 | INCLUDEPATH += $${PYTHONPATH}/include/python3.5m 36 | LIBS += $${PYTHONPATH}/lib/libpython3.5m.dylib 37 | LIBS += -lpthread -ldl -lutil 38 | } 39 | 40 | win32 { 41 | isEmpty(PYTHONPATH) { 42 | contains(QMAKE_TARGET.arch, x86_64) { 43 | equals(JENKINS, 1) { 44 | PYTHONPATH = C:\libs\amd64\python\3.5.2 45 | } 46 | else { 47 | PYTHONPATH = C:\python-352\64bit 48 | } 49 | } 50 | else { 51 | equals(JENKINS, 1) { 52 | PYTHONPATH = C:\libs\x86\python\3.5.2 53 | } 54 | else { 55 | PYTHONPATH = C:\python-352\32bit 56 | } 57 | } 58 | } 59 | 60 | LIBS += $${PYTHONPATH}\libs\python35.lib 61 | INCLUDEPATH += $${PYTHONPATH}\include 62 | } 63 | -------------------------------------------------------------------------------- /pythonqt.pri: -------------------------------------------------------------------------------- 1 | #########PythonQt Settings######### 2 | PYTHONQT_PATH = $$PWD/includes/PythonQt 3 | 4 | INCLUDEPATH += $${PYTHONQT_PATH}/src \ 5 | $${PYTHONQT_PATH}/extensions/PythonQt_QtAll 6 | 7 | include ( $${PYTHONQT_PATH}/src/src.pri ) 8 | 9 | include( $${PYTHONQT_PATH}/generated_cpp/com_trolltech_qt_core_builtin/com_trolltech_qt_core_builtin.pri) 10 | include( $${PYTHONQT_PATH}/generated_cpp/com_trolltech_qt_gui_builtin/com_trolltech_qt_gui_builtin.pri) 11 | 12 | 13 | #########PythonQt_QtAll Settings######### 14 | HEADERS += \ 15 | $${PYTHONQT_PATH}/extensions/PythonQt_QtAll/PythonQt_QtAll.h 16 | 17 | SOURCES += \ 18 | $${PYTHONQT_PATH}/extensions/PythonQt_QtAll/PythonQt_QtAll.cpp 19 | 20 | include ($${PYTHONQT_PATH}/generated_cpp/com_trolltech_qt_core/com_trolltech_qt_core.pri) 21 | include ($${PYTHONQT_PATH}/generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui.pri) 22 | include ($${PYTHONQT_PATH}/generated_cpp/com_trolltech_qt_sql/com_trolltech_qt_sql.pri) 23 | include ($${PYTHONQT_PATH}/generated_cpp/com_trolltech_qt_network/com_trolltech_qt_network.pri) 24 | include ($${PYTHONQT_PATH}/generated_cpp/com_trolltech_qt_uitools/com_trolltech_qt_uitools.pri) 25 | -------------------------------------------------------------------------------- /pythonqt_app/dialog.cpp: -------------------------------------------------------------------------------- 1 | #include "dialog.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | Dialog::Dialog(const QString& script, bool openconsole, QWidget *parent): QDialog(parent), m_curpath(QDir::current()) { 8 | setupUi(this); 9 | 10 | PyRun_SimpleString("from pytsonui.console import PythonConsole\nconsole = None"); 11 | 12 | if (openconsole) 13 | openConsole(); 14 | 15 | if (!script.isEmpty()) { 16 | fileEdit->setText(script); 17 | executeScript(script); 18 | } 19 | } 20 | 21 | Dialog::~Dialog() { 22 | 23 | } 24 | 25 | void Dialog::on_fileButton_clicked() { 26 | QString filename = QFileDialog::getOpenFileName(this, tr("Open script"), m_curpath.absolutePath(), tr("Python scripts (*.py)")); 27 | 28 | if (!filename.isEmpty()) { 29 | fileEdit->setText(filename); 30 | m_curpath = QFileInfo(filename).absoluteDir(); 31 | } 32 | } 33 | 34 | void Dialog::on_fileEdit_textChanged(const QString &arg1) { 35 | executeButton->setEnabled(QFile::exists(arg1)); 36 | } 37 | 38 | void Dialog::on_executeButton_clicked() { 39 | executeScript(fileEdit->text()); 40 | } 41 | 42 | void Dialog::on_consoleButton_clicked() { 43 | openConsole(); 44 | } 45 | 46 | void Dialog::executeScript(const QString &filename) { 47 | FILE* file = fopen(filename.toUtf8().constData(), "r"); 48 | if (!file) { 49 | QMessageBox::critical(this, tr("Error"), tr("Error opening file")); 50 | return; 51 | } 52 | 53 | PyRun_SimpleFileEx(file, filename.toUtf8().constData(), 1); 54 | } 55 | 56 | void Dialog::openConsole() { 57 | PyRun_SimpleString("if not console:\n console = PythonConsole(catchstd=True)\nconsole.show()"); 58 | } 59 | -------------------------------------------------------------------------------- /pythonqt_app/dialog.h: -------------------------------------------------------------------------------- 1 | #ifndef DIALOG_H 2 | #define DIALOG_H 3 | 4 | #include 5 | 6 | #include 7 | 8 | #include "ui_dialog.h" 9 | 10 | class Dialog : public QDialog, private Ui::pythonqtapp { 11 | Q_OBJECT 12 | 13 | public: 14 | explicit Dialog(const QString& script = QString(), bool openconsole = false, QWidget *parent = 0); 15 | ~Dialog(); 16 | protected slots: 17 | void executeScript(const QString& filename); 18 | void openConsole(); 19 | private slots: 20 | void on_fileButton_clicked(); 21 | void on_fileEdit_textChanged(const QString &arg1); 22 | void on_consoleButton_clicked(); 23 | void on_executeButton_clicked(); 24 | private: 25 | QDir m_curpath; 26 | }; 27 | 28 | #endif // DIALOG_H 29 | -------------------------------------------------------------------------------- /pythonqt_app/dialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | pythonqtapp 4 | 5 | 6 | 7 | 0 8 | 0 9 | 302 10 | 217 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | Execute file 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ... 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | false 41 | 42 | 43 | Execute 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | Scripting console 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /pythonqt_app/dummyts3lib.cpp: -------------------------------------------------------------------------------- 1 | #include "dummyts3lib.h" 2 | 3 | #include "global_shared.h" 4 | 5 | static PyMethodDef ts3moddummyfuncs[] = { 6 | {"getConfigPath", getConfigPath, METH_VARARGS, "fake config path function"}, 7 | {"getResourcesPath", getResourcesPath, METH_VARARGS, "fake resources path function"}, 8 | {"logMessage", logMessage, METH_VARARGS, "fake logMessage function"}, 9 | {NULL, NULL, 0, NULL} 10 | }; 11 | 12 | static PyModuleDef mdef = { 13 | PyModuleDef_HEAD_INIT, 14 | "ts3lib", 15 | NULL, 16 | -1, 17 | ts3moddummyfuncs, 18 | NULL, 19 | NULL, 20 | NULL, 21 | NULL 22 | }; 23 | 24 | PyMODINIT_FUNC PyInit_dummyts3lib(void) { 25 | return PyModule_Create(&mdef); 26 | } 27 | 28 | PyObject* getConfigPath(PyObject* /*self*/, PyObject* args) { 29 | unsigned int maxLen = 256; 30 | 31 | if (!PyArg_ParseTuple(args, "|I", &maxLen)) 32 | return NULL; 33 | 34 | if (maxLen == 0) { 35 | PyErr_SetString(PyExc_AttributeError, "maxLen must be greater than zero"); 36 | return NULL; 37 | } 38 | 39 | PyObject* ret; 40 | if (config_path) { 41 | char* path = new char[maxLen]; 42 | strncpy(path, config_path, maxLen -1); 43 | 44 | ret = Py_BuildValue("s", path); 45 | delete[] path; 46 | } 47 | else ret = Py_BuildValue("s", "no path given"); 48 | 49 | return ret; 50 | } 51 | 52 | PyObject* getResourcesPath(PyObject* /*self*/, PyObject* args) { 53 | unsigned int maxLen = 256; 54 | 55 | if (!PyArg_ParseTuple(args, "|I", &maxLen)) 56 | return NULL; 57 | 58 | if (maxLen == 0) { 59 | PyErr_SetString(PyExc_AttributeError, "maxLen must be greater than zero"); 60 | return NULL; 61 | } 62 | 63 | PyObject* ret; 64 | if (resources_path) { 65 | char* path = new char[maxLen]; 66 | strncpy(path, resources_path, maxLen -1); 67 | 68 | ret = Py_BuildValue("s", path); 69 | delete[] path; 70 | } 71 | else ret = Py_BuildValue("s", "no path given"); 72 | 73 | return ret; 74 | } 75 | 76 | 77 | PyObject* logMessage(PyObject* /*self*/, PyObject* args) { 78 | char* msg; 79 | int severity; 80 | char* channel; 81 | unsigned long long logID; 82 | 83 | if (!PyArg_ParseTuple(args, "sisK", &msg, &severity, &channel, &logID)) 84 | return NULL; 85 | 86 | printf("logMessage: %s, (%d, %s, %llu)\n", msg, severity, channel, logID); 87 | 88 | return Py_BuildValue("I", 0); 89 | } 90 | -------------------------------------------------------------------------------- /pythonqt_app/dummyts3lib.h: -------------------------------------------------------------------------------- 1 | #ifndef DUMMYTS3LIB_H 2 | #define DUMMYTS3LIB_H 3 | 4 | #include 5 | 6 | PyMODINIT_FUNC PyInit_dummyts3lib(void); 7 | 8 | PyObject* getConfigPath(PyObject* self, PyObject* args); 9 | PyObject* getResourcesPath(PyObject* self, PyObject* args); 10 | PyObject* logMessage(PyObject* self, PyObject* args); 11 | 12 | #endif // DUMMYTS3LIB_H 13 | -------------------------------------------------------------------------------- /pythonqt_app/global_shared.cpp: -------------------------------------------------------------------------------- 1 | #include "global_shared.h" 2 | 3 | #include 4 | 5 | char* resources_path = NULL; 6 | char* config_path = NULL; 7 | -------------------------------------------------------------------------------- /pythonqt_app/global_shared.h: -------------------------------------------------------------------------------- 1 | #ifndef GLOBAL_SHARED_H 2 | #define GLOBAL_SHARED_H 3 | 4 | extern char* resources_path; 5 | extern char* config_path; 6 | 7 | #endif // GLOBAL_SHARED_H 8 | -------------------------------------------------------------------------------- /pythonqt_app/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | #include "pythonqtapphost.h" 9 | #include "dialog.h" 10 | #include "global_shared.h" 11 | 12 | void printHelp(const char* execname) { 13 | std::cout << execname << " [-h] [-p pyTSon-dir] [-e script] [-c]" << std::endl; 14 | std::cout << "-h\tShow this help" << std::endl; 15 | std::cout << "-p pyTSon-dir\tThe directory where pyTSon lives in (this might be your TS3 plugin path)" << std::endl; 16 | std::cout << "-e script\tScript to execute on startup" << std::endl; 17 | std::cout << "-s\tOpen scripting console on startup" << std::endl; 18 | std::cout << "-r\tResources path of the ts3 client" << std::endl; 19 | std::cout << "-c\tConfig path of the ts3 client" << std::endl; 20 | } 21 | 22 | int main(int argc, char** argv) { 23 | QApplication app(argc, argv); 24 | 25 | 26 | QStringList args = app.arguments(); 27 | if (args.indexOf("-h") != -1) { 28 | printHelp(argv[0]); 29 | return 0; 30 | } 31 | 32 | QDir dir; 33 | QString script; 34 | QString respath; 35 | QString cfgpath; 36 | bool console = false; 37 | for (auto it = args.begin() +1; it != args.end(); ++it) { 38 | if (*it == "-p") { 39 | ++it; 40 | if (it == args.end()) { 41 | printHelp(argv[0]); 42 | std::cerr << "missing pyTSon-dir argument" << std::endl; 43 | return 1; 44 | } 45 | 46 | dir = *it; 47 | if (!dir.exists()) { 48 | printHelp(argv[0]); 49 | std::cerr << "pyTSon-dir does not exist" << std::endl; 50 | return 1; 51 | } 52 | } 53 | else if (*it == "-e") { 54 | ++it; 55 | if (it == args.end()) { 56 | printHelp(argv[0]); 57 | std::cerr << "missing script argument" << std::endl; 58 | return 1; 59 | } 60 | 61 | script = *it; 62 | if (!QFile::exists(script)) { 63 | printHelp(argv[0]); 64 | std::cerr << "script does not exist" << std::endl; 65 | return 1; 66 | } 67 | } 68 | else if (*it == "-s") 69 | console = true; 70 | else if (*it == "-r") { 71 | ++it; 72 | if (it == args.end()) { 73 | printHelp(argv[0]); 74 | std::cerr << "missing resources path argument" << std::endl; 75 | return 1; 76 | } 77 | 78 | respath = *it; 79 | } 80 | else if (*it == "-c") { 81 | ++it; 82 | if (it == args.end()) { 83 | printHelp(argv[0]); 84 | std::cerr << "missing config path argument" << std::endl; 85 | return 1; 86 | } 87 | 88 | cfgpath = *it; 89 | } 90 | else { 91 | printHelp(argv[0]); 92 | std::cerr << "can't interpret argument: " << (*it).toUtf8().constData() << std::endl; 93 | return 1; 94 | } 95 | } 96 | 97 | QString error; 98 | PythonQtAppHost pythonhost; 99 | if (pythonhost.init(dir, error)) { 100 | if (!error.isEmpty()) 101 | std::cout << error.toUtf8().data() << std::endl; 102 | 103 | if (!respath.isEmpty()) { 104 | QByteArray bytes = respath.toUtf8(); 105 | resources_path = new char[bytes.length() +1]; 106 | strncpy(resources_path, bytes.constData(), bytes.length()); 107 | resources_path[bytes.length()] = '\0'; 108 | } 109 | 110 | if (!cfgpath.isEmpty()) { 111 | QByteArray bytes = cfgpath.toUtf8(); 112 | config_path = new char[bytes.length() +1]; 113 | strncpy(config_path, bytes.constData(), bytes.length()); 114 | config_path[bytes.length()] = '\0'; 115 | } 116 | 117 | Dialog* dlg = new Dialog(script, console); 118 | dlg->show(); 119 | 120 | app.connect(&app, &QApplication::aboutToQuit, [&]() { 121 | delete dlg; 122 | pythonhost.shutdown(); 123 | 124 | delete[] config_path; 125 | delete[] resources_path; 126 | }); 127 | 128 | return app.exec(); 129 | } 130 | else { 131 | std::cerr << error.toUtf8().data() << std::endl; 132 | return 1; 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /pythonqt_app/pythonqt_app.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | TARGET = pythonqt_app 3 | 4 | CONFIG += c++11 5 | 6 | QT += gui widgets network uitools sql 7 | 8 | DESTDIR = ../build 9 | OBJECTS_DIR = build 10 | MOC_DIR = build 11 | RCC_DIR = build 12 | UI_DIR = build 13 | 14 | include (../python.pri) 15 | include (../pythonqt.pri) 16 | 17 | SOURCES += main.cpp \ 18 | dialog.cpp \ 19 | ../shared/pythonhost.cpp \ 20 | ../shared/pythonqt/eventfilterobject.cpp \ 21 | ../shared/pythonqt/pythonqtpytson.cpp \ 22 | dummyts3lib.cpp \ 23 | global_shared.cpp 24 | 25 | HEADERS += \ 26 | dialog.h \ 27 | ../shared/pythonhost.h \ 28 | ../shared/pythonqt/eventfilterobject.h \ 29 | ../shared/pythonqt/pythonqtpytson.h \ 30 | pythonqtapphost.h \ 31 | dummyts3lib.h \ 32 | global_shared.h 33 | 34 | FORMS += \ 35 | dialog.ui 36 | 37 | unix { 38 | QMAKE_RPATHDIR += $ORIGIN 39 | } 40 | 41 | macx { 42 | CONFIG -= app_bundle 43 | QMAKE_POST_LINK += install_name_tool -change $$absolute_path("$${PYTHONPATH}/lib/libpython3.5m.dylib") @loader_path/libpython3.5m.dylib ${DESTDIR}${TARGET} & 44 | } 45 | 46 | INCLUDEPATH += ../shared 47 | -------------------------------------------------------------------------------- /pythonqt_app/pythonqtapphost.h: -------------------------------------------------------------------------------- 1 | #ifndef PYTHONQTAPPHOST_H 2 | #define PYTHONQTAPPHOST_H 3 | 4 | #include "pythonhost.h" 5 | 6 | #include "dummyts3lib.h" 7 | 8 | class PythonQtAppHost: public PythonHost { 9 | public: 10 | PythonQtAppHost(): PythonHost() { 11 | m_inittabs.append({"ts3lib", PyInit_dummyts3lib}); 12 | } 13 | }; 14 | 15 | #endif // PYTHONQTAPPHOST_H 16 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/requirements.txt -------------------------------------------------------------------------------- /ressources/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/loading.gif -------------------------------------------------------------------------------- /ressources/octicons/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2012-2016 GitHub, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ressources/octicons/alert.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/alert.svg.png -------------------------------------------------------------------------------- /ressources/octicons/arrow-down.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/arrow-down.svg.png -------------------------------------------------------------------------------- /ressources/octicons/arrow-left.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/arrow-left.svg.png -------------------------------------------------------------------------------- /ressources/octicons/arrow-right.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/arrow-right.svg.png -------------------------------------------------------------------------------- /ressources/octicons/arrow-small-down.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/arrow-small-down.svg.png -------------------------------------------------------------------------------- /ressources/octicons/arrow-small-left.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/arrow-small-left.svg.png -------------------------------------------------------------------------------- /ressources/octicons/arrow-small-right.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/arrow-small-right.svg.png -------------------------------------------------------------------------------- /ressources/octicons/arrow-small-up.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/arrow-small-up.svg.png -------------------------------------------------------------------------------- /ressources/octicons/arrow-up.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/arrow-up.svg.png -------------------------------------------------------------------------------- /ressources/octicons/beaker.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/beaker.svg.png -------------------------------------------------------------------------------- /ressources/octicons/bell.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/bell.svg.png -------------------------------------------------------------------------------- /ressources/octicons/bold.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/bold.svg.png -------------------------------------------------------------------------------- /ressources/octicons/book.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/book.svg.png -------------------------------------------------------------------------------- /ressources/octicons/bookmark.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/bookmark.svg.png -------------------------------------------------------------------------------- /ressources/octicons/briefcase.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/briefcase.svg.png -------------------------------------------------------------------------------- /ressources/octicons/broadcast.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/broadcast.svg.png -------------------------------------------------------------------------------- /ressources/octicons/browser.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/browser.svg.png -------------------------------------------------------------------------------- /ressources/octicons/bug.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/bug.svg.png -------------------------------------------------------------------------------- /ressources/octicons/calendar.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/calendar.svg.png -------------------------------------------------------------------------------- /ressources/octicons/check.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/check.svg.png -------------------------------------------------------------------------------- /ressources/octicons/checklist.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/checklist.svg.png -------------------------------------------------------------------------------- /ressources/octicons/chevron-down.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/chevron-down.svg.png -------------------------------------------------------------------------------- /ressources/octicons/chevron-left.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/chevron-left.svg.png -------------------------------------------------------------------------------- /ressources/octicons/chevron-right.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/chevron-right.svg.png -------------------------------------------------------------------------------- /ressources/octicons/chevron-up.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/chevron-up.svg.png -------------------------------------------------------------------------------- /ressources/octicons/circle-slash.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/circle-slash.svg.png -------------------------------------------------------------------------------- /ressources/octicons/circuit-board.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/circuit-board.svg.png -------------------------------------------------------------------------------- /ressources/octicons/clippy.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/clippy.svg.png -------------------------------------------------------------------------------- /ressources/octicons/clock.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/clock.svg.png -------------------------------------------------------------------------------- /ressources/octicons/cloud-download.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/cloud-download.svg.png -------------------------------------------------------------------------------- /ressources/octicons/cloud-upload.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/cloud-upload.svg.png -------------------------------------------------------------------------------- /ressources/octicons/code.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/code.svg.png -------------------------------------------------------------------------------- /ressources/octicons/comment-discussion.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/comment-discussion.svg.png -------------------------------------------------------------------------------- /ressources/octicons/comment.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/comment.svg.png -------------------------------------------------------------------------------- /ressources/octicons/credit-card.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/credit-card.svg.png -------------------------------------------------------------------------------- /ressources/octicons/dash.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/dash.svg.png -------------------------------------------------------------------------------- /ressources/octicons/dashboard.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/dashboard.svg.png -------------------------------------------------------------------------------- /ressources/octicons/database.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/database.svg.png -------------------------------------------------------------------------------- /ressources/octicons/desktop-download.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/desktop-download.svg.png -------------------------------------------------------------------------------- /ressources/octicons/device-camera-video.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/device-camera-video.svg.png -------------------------------------------------------------------------------- /ressources/octicons/device-camera.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/device-camera.svg.png -------------------------------------------------------------------------------- /ressources/octicons/device-desktop.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/device-desktop.svg.png -------------------------------------------------------------------------------- /ressources/octicons/device-mobile.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/device-mobile.svg.png -------------------------------------------------------------------------------- /ressources/octicons/diff-added.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/diff-added.svg.png -------------------------------------------------------------------------------- /ressources/octicons/diff-ignored.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/diff-ignored.svg.png -------------------------------------------------------------------------------- /ressources/octicons/diff-modified.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/diff-modified.svg.png -------------------------------------------------------------------------------- /ressources/octicons/diff-removed.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/diff-removed.svg.png -------------------------------------------------------------------------------- /ressources/octicons/diff-renamed.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/diff-renamed.svg.png -------------------------------------------------------------------------------- /ressources/octicons/diff.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/diff.svg.png -------------------------------------------------------------------------------- /ressources/octicons/ellipses.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/ellipses.svg.png -------------------------------------------------------------------------------- /ressources/octicons/ellipsis.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/ellipsis.svg.png -------------------------------------------------------------------------------- /ressources/octicons/eye.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/eye.svg.png -------------------------------------------------------------------------------- /ressources/octicons/file-binary.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/file-binary.svg.png -------------------------------------------------------------------------------- /ressources/octicons/file-code.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/file-code.svg.png -------------------------------------------------------------------------------- /ressources/octicons/file-directory.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/file-directory.svg.png -------------------------------------------------------------------------------- /ressources/octicons/file-media.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/file-media.svg.png -------------------------------------------------------------------------------- /ressources/octicons/file-pdf.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/file-pdf.svg.png -------------------------------------------------------------------------------- /ressources/octicons/file-submodule.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/file-submodule.svg.png -------------------------------------------------------------------------------- /ressources/octicons/file-symlink-directory.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/file-symlink-directory.svg.png -------------------------------------------------------------------------------- /ressources/octicons/file-symlink-file.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/file-symlink-file.svg.png -------------------------------------------------------------------------------- /ressources/octicons/file-text.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/file-text.svg.png -------------------------------------------------------------------------------- /ressources/octicons/file-zip.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/file-zip.svg.png -------------------------------------------------------------------------------- /ressources/octicons/file.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/file.svg.png -------------------------------------------------------------------------------- /ressources/octicons/flame.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/flame.svg.png -------------------------------------------------------------------------------- /ressources/octicons/fold.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/fold.svg.png -------------------------------------------------------------------------------- /ressources/octicons/gear.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/gear.svg.png -------------------------------------------------------------------------------- /ressources/octicons/gift.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/gift.svg.png -------------------------------------------------------------------------------- /ressources/octicons/gist-secret.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/gist-secret.svg.png -------------------------------------------------------------------------------- /ressources/octicons/gist.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/gist.svg.png -------------------------------------------------------------------------------- /ressources/octicons/git-branch.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/git-branch.svg.png -------------------------------------------------------------------------------- /ressources/octicons/git-commit.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/git-commit.svg.png -------------------------------------------------------------------------------- /ressources/octicons/git-compare.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/git-compare.svg.png -------------------------------------------------------------------------------- /ressources/octicons/git-merge.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/git-merge.svg.png -------------------------------------------------------------------------------- /ressources/octicons/git-pull-request.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/git-pull-request.svg.png -------------------------------------------------------------------------------- /ressources/octicons/globe.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/globe.svg.png -------------------------------------------------------------------------------- /ressources/octicons/grabber.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/grabber.svg.png -------------------------------------------------------------------------------- /ressources/octicons/graph.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/graph.svg.png -------------------------------------------------------------------------------- /ressources/octicons/heart.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/heart.svg.png -------------------------------------------------------------------------------- /ressources/octicons/history.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/history.svg.png -------------------------------------------------------------------------------- /ressources/octicons/home.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/home.svg.png -------------------------------------------------------------------------------- /ressources/octicons/horizontal-rule.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/horizontal-rule.svg.png -------------------------------------------------------------------------------- /ressources/octicons/hubot.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/hubot.svg.png -------------------------------------------------------------------------------- /ressources/octicons/inbox.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/inbox.svg.png -------------------------------------------------------------------------------- /ressources/octicons/info.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/info.svg.png -------------------------------------------------------------------------------- /ressources/octicons/issue-closed.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/issue-closed.svg.png -------------------------------------------------------------------------------- /ressources/octicons/issue-opened.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/issue-opened.svg.png -------------------------------------------------------------------------------- /ressources/octicons/issue-reopened.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/issue-reopened.svg.png -------------------------------------------------------------------------------- /ressources/octicons/italic.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/italic.svg.png -------------------------------------------------------------------------------- /ressources/octicons/jersey.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/jersey.svg.png -------------------------------------------------------------------------------- /ressources/octicons/key.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/key.svg.png -------------------------------------------------------------------------------- /ressources/octicons/keyboard.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/keyboard.svg.png -------------------------------------------------------------------------------- /ressources/octicons/law.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/law.svg.png -------------------------------------------------------------------------------- /ressources/octicons/light-bulb.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/light-bulb.svg.png -------------------------------------------------------------------------------- /ressources/octicons/link-external.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/link-external.svg.png -------------------------------------------------------------------------------- /ressources/octicons/link.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/link.svg.png -------------------------------------------------------------------------------- /ressources/octicons/list-ordered.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/list-ordered.svg.png -------------------------------------------------------------------------------- /ressources/octicons/list-unordered.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/list-unordered.svg.png -------------------------------------------------------------------------------- /ressources/octicons/location.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/location.svg.png -------------------------------------------------------------------------------- /ressources/octicons/lock.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/lock.svg.png -------------------------------------------------------------------------------- /ressources/octicons/logo-gist.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/logo-gist.svg.png -------------------------------------------------------------------------------- /ressources/octicons/logo-github.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/logo-github.svg.png -------------------------------------------------------------------------------- /ressources/octicons/mail-read.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/mail-read.svg.png -------------------------------------------------------------------------------- /ressources/octicons/mail-reply.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/mail-reply.svg.png -------------------------------------------------------------------------------- /ressources/octicons/mail.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/mail.svg.png -------------------------------------------------------------------------------- /ressources/octicons/mark-github.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/mark-github.svg.png -------------------------------------------------------------------------------- /ressources/octicons/markdown.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/markdown.svg.png -------------------------------------------------------------------------------- /ressources/octicons/megaphone.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/megaphone.svg.png -------------------------------------------------------------------------------- /ressources/octicons/mention.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/mention.svg.png -------------------------------------------------------------------------------- /ressources/octicons/milestone.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/milestone.svg.png -------------------------------------------------------------------------------- /ressources/octicons/mirror.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/mirror.svg.png -------------------------------------------------------------------------------- /ressources/octicons/mortar-board.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/mortar-board.svg.png -------------------------------------------------------------------------------- /ressources/octicons/mute.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/mute.svg.png -------------------------------------------------------------------------------- /ressources/octicons/no-newline.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/no-newline.svg.png -------------------------------------------------------------------------------- /ressources/octicons/note.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/note.svg.png -------------------------------------------------------------------------------- /ressources/octicons/octoface.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/octoface.svg.png -------------------------------------------------------------------------------- /ressources/octicons/organization.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/organization.svg.png -------------------------------------------------------------------------------- /ressources/octicons/package.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/package.svg.png -------------------------------------------------------------------------------- /ressources/octicons/paintcan.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/paintcan.svg.png -------------------------------------------------------------------------------- /ressources/octicons/pencil.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/pencil.svg.png -------------------------------------------------------------------------------- /ressources/octicons/person.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/person.svg.png -------------------------------------------------------------------------------- /ressources/octicons/pin.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/pin.svg.png -------------------------------------------------------------------------------- /ressources/octicons/plug.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/plug.svg.png -------------------------------------------------------------------------------- /ressources/octicons/plus-small.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/plus-small.svg.png -------------------------------------------------------------------------------- /ressources/octicons/plus.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/plus.svg.png -------------------------------------------------------------------------------- /ressources/octicons/primitive-dot.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/primitive-dot.svg.png -------------------------------------------------------------------------------- /ressources/octicons/primitive-square.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/primitive-square.svg.png -------------------------------------------------------------------------------- /ressources/octicons/project.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/project.svg.png -------------------------------------------------------------------------------- /ressources/octicons/pulse.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/pulse.svg.png -------------------------------------------------------------------------------- /ressources/octicons/question.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/question.svg.png -------------------------------------------------------------------------------- /ressources/octicons/quote.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/quote.svg.png -------------------------------------------------------------------------------- /ressources/octicons/radio-tower.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/radio-tower.svg.png -------------------------------------------------------------------------------- /ressources/octicons/reply.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/reply.svg.png -------------------------------------------------------------------------------- /ressources/octicons/repo-clone.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/repo-clone.svg.png -------------------------------------------------------------------------------- /ressources/octicons/repo-force-push.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/repo-force-push.svg.png -------------------------------------------------------------------------------- /ressources/octicons/repo-forked.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/repo-forked.svg.png -------------------------------------------------------------------------------- /ressources/octicons/repo-pull.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/repo-pull.svg.png -------------------------------------------------------------------------------- /ressources/octicons/repo-push.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/repo-push.svg.png -------------------------------------------------------------------------------- /ressources/octicons/repo.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/repo.svg.png -------------------------------------------------------------------------------- /ressources/octicons/rocket.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/rocket.svg.png -------------------------------------------------------------------------------- /ressources/octicons/rss.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/rss.svg.png -------------------------------------------------------------------------------- /ressources/octicons/ruby.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/ruby.svg.png -------------------------------------------------------------------------------- /ressources/octicons/screen-full.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/screen-full.svg.png -------------------------------------------------------------------------------- /ressources/octicons/screen-normal.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/screen-normal.svg.png -------------------------------------------------------------------------------- /ressources/octicons/search.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/search.svg.png -------------------------------------------------------------------------------- /ressources/octicons/server.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/server.svg.png -------------------------------------------------------------------------------- /ressources/octicons/settings.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/settings.svg.png -------------------------------------------------------------------------------- /ressources/octicons/shield.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/shield.svg.png -------------------------------------------------------------------------------- /ressources/octicons/sign-in.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/sign-in.svg.png -------------------------------------------------------------------------------- /ressources/octicons/sign-out.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/sign-out.svg.png -------------------------------------------------------------------------------- /ressources/octicons/smiley.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/smiley.svg.png -------------------------------------------------------------------------------- /ressources/octicons/squirrel.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/squirrel.svg.png -------------------------------------------------------------------------------- /ressources/octicons/star.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/star.svg.png -------------------------------------------------------------------------------- /ressources/octicons/stop.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/stop.svg.png -------------------------------------------------------------------------------- /ressources/octicons/sync.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/sync.svg.png -------------------------------------------------------------------------------- /ressources/octicons/tag.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/tag.svg.png -------------------------------------------------------------------------------- /ressources/octicons/tasklist.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/tasklist.svg.png -------------------------------------------------------------------------------- /ressources/octicons/telescope.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/telescope.svg.png -------------------------------------------------------------------------------- /ressources/octicons/terminal.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/terminal.svg.png -------------------------------------------------------------------------------- /ressources/octicons/text-size.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/text-size.svg.png -------------------------------------------------------------------------------- /ressources/octicons/three-bars.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/three-bars.svg.png -------------------------------------------------------------------------------- /ressources/octicons/thumbsdown.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/thumbsdown.svg.png -------------------------------------------------------------------------------- /ressources/octicons/thumbsup.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/thumbsup.svg.png -------------------------------------------------------------------------------- /ressources/octicons/tools.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/tools.svg.png -------------------------------------------------------------------------------- /ressources/octicons/trashcan.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/trashcan.svg.png -------------------------------------------------------------------------------- /ressources/octicons/triangle-down.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/triangle-down.svg.png -------------------------------------------------------------------------------- /ressources/octicons/triangle-left.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/triangle-left.svg.png -------------------------------------------------------------------------------- /ressources/octicons/triangle-right.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/triangle-right.svg.png -------------------------------------------------------------------------------- /ressources/octicons/triangle-up.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/triangle-up.svg.png -------------------------------------------------------------------------------- /ressources/octicons/unfold.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/unfold.svg.png -------------------------------------------------------------------------------- /ressources/octicons/unmute.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/unmute.svg.png -------------------------------------------------------------------------------- /ressources/octicons/unverified.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/unverified.svg.png -------------------------------------------------------------------------------- /ressources/octicons/verified.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/verified.svg.png -------------------------------------------------------------------------------- /ressources/octicons/versions.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/versions.svg.png -------------------------------------------------------------------------------- /ressources/octicons/watch.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/watch.svg.png -------------------------------------------------------------------------------- /ressources/octicons/x.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/x.svg.png -------------------------------------------------------------------------------- /ressources/octicons/zap.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/octicons/zap.svg.png -------------------------------------------------------------------------------- /ressources/python.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pathmann/pyTSon/9a7fcd3657e2bd82b30ecdfb6f7262e12cb0c496/ressources/python.png -------------------------------------------------------------------------------- /ressources/python/pythonqtpytson.py: -------------------------------------------------------------------------------- 1 | """ 2 | Module PythonQt.pytson 3 | """ 4 | 5 | from PythonQt.QtCore import QObject 6 | 7 | 8 | class EventFilterObject(QObject): 9 | """ 10 | Class to install as eventfilter on QObject-based objects. Connect to the 11 | signal eventFiltered(QObject*, QEvent*) to receive the filtered event per 12 | installEventFilter. 13 | """ 14 | 15 | def __init__(self, typelist=list(), parent=None): 16 | """ 17 | Instantiates a new object. 18 | @param typelist: list of Eventtypes to filter (see QEvent::Type). 19 | Defaults to an empty list. 20 | @type typelist: list(int) 21 | @param parent: QObject-parent 22 | @type parent: QObject 23 | """ 24 | pass 25 | 26 | def setFilterResult(self, val): 27 | """ 28 | Sets the return value the object should return in the 29 | eventFilter-method. If not set, False will be returned 30 | @param val: the value 31 | @type val: bool 32 | """ 33 | pass 34 | 35 | def types(self): 36 | """ 37 | Returns the current list of eventtypes. 38 | @return: the current eventtypes 39 | @rtype: list(int) 40 | """ 41 | pass 42 | 43 | def addType(self, eventtype): 44 | """ 45 | Adds an eventtype to the list. 46 | @param eventtype: an eventtype (see QEvent::Type) 47 | @type eventtype: int 48 | """ 49 | pass 50 | 51 | def removeType(self, eventtype): 52 | """ 53 | Removes an eventtype from the list. 54 | @param eventtype: an eventtype (see QEvent::Type) 55 | @type eventtype: int 56 | """ 57 | pass 58 | -------------------------------------------------------------------------------- /ressources/python/pytson.py: -------------------------------------------------------------------------------- 1 | import os 2 | import shutil 3 | import platform 4 | import glob 5 | import re 6 | 7 | import ts3lib 8 | 9 | from PythonQt.QtGui import QApplication 10 | 11 | 12 | _PYTSON_VERSION = "1.2.4" 13 | 14 | 15 | def tr(context, sourcetext, *, disambiguation="", n=-1): 16 | """ 17 | Returns the current translation for a string. This function calls can be 18 | extracted by pyTSon's pylupdate.py. 19 | @param context: context of the string literal, must be a raw string, not 20 | the return value of another function, an attribute or such 21 | @type context: str 22 | @param sourcetext: translatable string, must be a raw string, not the 23 | return value of another function, an attribute or such 24 | @type sourcetext: str 25 | @param disambiguation: used to distinguish between two equal sourcetexts 26 | int the same context, or as comment, optional, defaults to an empty string, 27 | must be a raw string, not the return value of another function, an 28 | attribute or such 29 | @type disambiguation: str 30 | @param n: used for strings containing plurals, optional, defaults to -1 31 | @type n: int 32 | """ 33 | return QApplication.translate(context, sourcetext, disambiguation, n) 34 | 35 | 36 | class Translatable(object): 37 | """ 38 | Baseclass for a class using translatable string literals. 39 | """ 40 | @classmethod 41 | def _tr(cls, sourcetext, *, disambiguation="", n=-1, context=None): 42 | """ 43 | Returns the current translation for a string. This method calls can be 44 | extracted by pyTSon's pylupdate.py. 45 | @param sourcetext: translatable string, must be a raw string, not the 46 | return value of another function, an attribute or such 47 | @type sourcetext: str 48 | @param disambiguation: used to distinguish between two equal 49 | sourcetexts int the same context, or as comment, optional, defaults 50 | to an empty string, must be a raw string, not the return value of 51 | another function, an attribute or such 52 | @type disambiguation: str 53 | @param n: used for strings containing plurals, optional, defaults to -1 54 | @type n: int 55 | @param context: context to use for the string, optional, if set to 56 | None, the classname is used as context, defaults to None 57 | @type context: str 58 | """ 59 | if not context: 60 | return tr(cls.__name__, sourcetext, disambiguation=disambiguation, 61 | n=n) 62 | else: 63 | return tr(context, sourcetext, disambiguation=disambiguation, n=n) 64 | 65 | 66 | def locales(): 67 | """ 68 | Generator function to return all locale codes available for translation 69 | in format language_country (see ISO 639 and ISO 3166) 70 | @return: Generator function to return the language codes 71 | @rtype: Generator[str] 72 | """ 73 | for f in glob.glob(getPluginPath("ressources", "i18n", "pyTSon-*.qm")): 74 | m = re.match(r'^pyTSon-(\w\w_\w\w).qm$', os.path.split(f)[-1]) 75 | if m: 76 | yield m.group(1) 77 | 78 | 79 | def getConfigPath(*args): 80 | """ 81 | Returns pyTSon's configpath, that is, the subdirectory 'pyTSon' in the 82 | TeamSpeak 3 config directory. 83 | @param args: path fields joined to the result as list of strings 84 | @type args: list[str] 85 | @return: The accumulated path 86 | @rtype: str 87 | """ 88 | return os.path.join(ts3lib.getConfigPath(), "pyTSon", *args) 89 | 90 | 91 | def getPluginPath(*args): 92 | """ 93 | Returns pyTSon's pluginpath, that is, the subdirectory 'pyTSon' in the 94 | TeamSpeak 3 plugins directory. 95 | @param args: path fields joined to the result as list of strings 96 | @type args: list[str] 97 | @return: The accumulated path 98 | @rtype: str 99 | """ 100 | return os.path.join(ts3lib.getPluginPath(), "pyTSon", *args) 101 | 102 | 103 | def _setup(): 104 | """ 105 | Sets up pyTSon's infrastructure. 106 | """ 107 | if not os.path.isdir(getConfigPath()): 108 | os.mkdir(getConfigPath()) 109 | 110 | respath = getPluginPath("ressources", "repositorymaster.json") 111 | confpath = getConfigPath("repositorymaster.json") 112 | if not os.path.exists(confpath): 113 | shutil.copy(respath, confpath) 114 | 115 | with open(getPluginPath("VERSION"), "r") as f: 116 | global _PYTSON_VERSION 117 | _PYTSON_VERSION = f.readline().strip() 118 | 119 | 120 | def platformstr(): 121 | """ 122 | Returns the platform pyTSon is currently running on. 123 | @return: the platform (and architecture) string 124 | @rtype: str 125 | """ 126 | if platform.system() == "Mac": 127 | return "Mac" 128 | else: 129 | return "%s-%s" % (platform.system(), platform.architecture()[0]) 130 | 131 | 132 | def getVersion(): 133 | """ 134 | Returns the current version of pyTSon. 135 | @return: the version as string 136 | @rtype: str 137 | """ 138 | return _PYTSON_VERSION 139 | 140 | 141 | def getCurrentApiVersion(): 142 | """ 143 | Returns the current apiversion of the ts3 plugin sdk. This should not be 144 | used in ts3plugin.apiVersion. Be fair and update your plugin manually! 145 | @return: the apiVersion 146 | @rtype: str 147 | """ 148 | return 21 149 | -------------------------------------------------------------------------------- /ressources/python/pytsonui/dialogs.py: -------------------------------------------------------------------------------- 1 | from PythonQt.QtGui import (QDialog, QVBoxLayout, QHBoxLayout, QLabel, 2 | QLineEdit, QDialogButtonBox) 3 | 4 | 5 | class MultiInputDialog(QDialog): 6 | def __init__(self, title, label1, label2, parent=None): 7 | super().__init__(parent) 8 | self.setWindowTitle(title) 9 | self.lay = QVBoxLayout(self) 10 | 11 | self.lay1 = QHBoxLayout() 12 | self.label1 = QLabel(label1, self) 13 | self.lay1.addWidget(self.label1) 14 | self.input1 = QLineEdit(self) 15 | self.lay1.addWidget(self.input1) 16 | self.lay.addLayout(self.lay1) 17 | 18 | self.lay2 = QHBoxLayout() 19 | self.label2 = QLabel(label2, self) 20 | self.lay2.addWidget(self.label2) 21 | self.input2 = QLineEdit(self) 22 | self.lay2.addWidget(self.input2) 23 | self.lay.addLayout(self.lay2) 24 | 25 | bbox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel, 26 | self) 27 | bbox.connect("accepted()", self.accept) 28 | bbox.connect("rejected()", self.reject) 29 | self.lay.addWidget(bbox) 30 | 31 | def cleanup(self): 32 | self.lay1.delete() 33 | self.lay2.delete() 34 | 35 | @staticmethod 36 | def getTexts(title, label1, label2, text1="", text2="", parent=None): 37 | dlg = MultiInputDialog(title, label1, label2, parent) 38 | 39 | dlg.label1.setText(label1) 40 | dlg.input1.setText(text1) 41 | dlg.label2.setText(label2) 42 | dlg.input2.setText(text2) 43 | 44 | if dlg.exec_() == QDialog.Accepted: 45 | ret1 = dlg.input1.text 46 | ret2 = dlg.input2.text 47 | 48 | dlg.cleanup() 49 | dlg.delete() 50 | 51 | return (True, ret1, ret2) 52 | else: 53 | return (False, "", "") 54 | -------------------------------------------------------------------------------- /ressources/python/signalslot.py: -------------------------------------------------------------------------------- 1 | from weakref import WeakSet, WeakKeyDictionary 2 | import inspect 3 | 4 | 5 | class Signal(object): 6 | """ 7 | Simple class to emit signals to connected callable receivers. 8 | """ 9 | 10 | def __init__(self): 11 | """ 12 | Instantiate a new object 13 | """ 14 | self.funcs = WeakSet() 15 | self.meths = WeakKeyDictionary() 16 | 17 | def connect(self, c): 18 | """ 19 | Connect a callable as receiver for the signal 20 | @param c: signal receiver 21 | @type c: Callable 22 | """ 23 | if inspect.ismethod(c): 24 | if c.__self__ not in self.meths: 25 | self.meths[c.__self__] = set() 26 | 27 | self.meths[c.__self__].add(c.__func__) 28 | else: 29 | if c not in self.funcs: 30 | self.funcs.add(c) 31 | 32 | def disconnect(self, c): 33 | """ 34 | Disconnect the callable from receiving the signal 35 | @param c: signal receiver 36 | @type c: Callable 37 | """ 38 | if inspect.ismethod(c): 39 | if c.__self__ in self.meths: 40 | self.meths[c.__self__].remove(c.__func__) 41 | else: 42 | if c in self.funcs: 43 | self.funcs.remove(c) 44 | 45 | def disconnectAll(self): 46 | """ 47 | Disconnects all signal receivers 48 | """ 49 | self.funcs.clear() 50 | self.meths.clear() 51 | 52 | def emit(self, *args, **kwargs): 53 | """ 54 | Fires the signal to all connected receivers 55 | """ 56 | for c in self.funcs: 57 | c(*args, **kwargs) 58 | 59 | for obj, funcs in self.meths.items(): 60 | for func in funcs: 61 | func(obj, *args, **kwargs) 62 | -------------------------------------------------------------------------------- /ressources/python/ts3plugin.py: -------------------------------------------------------------------------------- 1 | import ts3lib 2 | import ts3defines 3 | 4 | from pluginhost import PluginHost 5 | 6 | import pytson 7 | 8 | 9 | class PluginMount(type, pytson.Translatable): 10 | def __init__(cls, name, bases, attrs): 11 | super(PluginMount, cls).__init__(name, bases, attrs) 12 | if not hasattr(PluginHost, 'plugins'): 13 | PluginHost.plugins = {} 14 | PluginHost.active = {} 15 | else: 16 | for a in ['requestAutoload', 'name', 'version', 'apiVersion', 17 | 'author', 'description', 'offersConfigure', 18 | 'commandKeyword', 'infoTitle', 'menuItems', 'hotkeys']: 19 | if not hasattr(cls, a): 20 | msg = cls._tr("Plugin {name} not loaded, missing required " 21 | "attribute {attrib}").format(name=name, 22 | attrib=a) 23 | err = ts3lib.logMessage(msg, 24 | ts3defines.LogLevel.LogLevel_ERROR, 25 | "pyTSon.PluginMount.init", 0) 26 | if err != ts3defines.ERROR_ok: 27 | print(msg) 28 | 29 | return 30 | 31 | if cls.name not in PluginHost.plugins: 32 | PluginHost.plugins[cls.name] = cls 33 | else: 34 | msg = cls._tr("Error loading python plugin {name}, already " 35 | "registered or a plugin with that name already " 36 | "exists").format(name=cls.name) 37 | err = ts3lib.logMessage(msg, 38 | ts3defines.LogLevel.LogLevel_ERROR, 39 | "pyTSon.PluginMount.init", 0) 40 | if err != ts3defines.ERROR_ok: 41 | print(msg) 42 | 43 | 44 | class ts3plugin(object, metaclass=PluginMount): 45 | """ 46 | requestAutoload = False 47 | name = "__ts3plugin__" 48 | version = "1.0" 49 | apiVersion = 21 50 | author = "Thomas \"PLuS\" Pathmann" 51 | description = "This is the baseclass for all ts3 python plugins" 52 | offersConfigure = False 53 | commandKeyword = "py" 54 | infoTitle = "pyTSon" #pass None to not show any info 55 | menuItems = []#[(ts3defines.PluginMenuType.PLUGIN_MENU_TYPE_CLIENT, 0, 56 | "text", "icon.png")] 57 | hotkeys = []#[("keyword", "description")] 58 | """ 59 | 60 | def __init__(self): 61 | pass 62 | 63 | def stop(self): 64 | pass 65 | -------------------------------------------------------------------------------- /ressources/python/ts3widgets/__init__.py: -------------------------------------------------------------------------------- 1 | import ts3lib 2 | import ts3defines 3 | 4 | 5 | def _errprint(msg, errcode, aid, secid=None): 6 | if secid: 7 | err = ts3lib.logMessage("%s (%s): %s" % (msg, secid, errcode), 8 | ts3defines.LogLevel.LogLevel_ERROR, 9 | "pyTSon.ts3widgets", aid) 10 | else: 11 | err = ts3lib.logMessage("%s: %s" % (msg, errcode), 12 | ts3defines.LogLevel.LogLevel_ERROR, 13 | "pyTSon.ts3widgets", aid) 14 | 15 | if err != ts3defines.ERROR_ok: 16 | if secid: 17 | print("%s (%s, %s): %s" % (msg, aid, secid, errcode)) 18 | else: 19 | print("%s (%s): %s" % (msg, aid, errcode)) 20 | -------------------------------------------------------------------------------- /ressources/repositorymaster.json: -------------------------------------------------------------------------------- 1 | [{"active": true, "url": "https://raw.githubusercontent.com/pathmann/pyTSon_repository/master/repositorymaster.json", "name": "pyTSon master", "origin": "online"}] 2 | -------------------------------------------------------------------------------- /ressources/ui/filecollision.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | filecollisiondialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 553 10 | 449 11 | 12 | 13 | 14 | File Transfer 15 | 16 | 17 | 18 | 19 | 20 | This folder already contains a file 21 | 22 | 23 | 24 | 25 | 26 | 27 | TextLabel 28 | 29 | 30 | 31 | 32 | 33 | 34 | TextLabel 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | Qt::Horizontal 44 | 45 | 46 | QSizePolicy::Minimum 47 | 48 | 49 | 50 | 40 51 | 20 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | TextLabel 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | with this file 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | Qt::Horizontal 78 | 79 | 80 | QSizePolicy::Minimum 81 | 82 | 83 | 84 | 40 85 | 20 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | TextLabel 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | &Apply to all files 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | &Overwrite 112 | 113 | 114 | 115 | 116 | 117 | 118 | &Resume 119 | 120 | 121 | 122 | 123 | 124 | 125 | &Skip 126 | 127 | 128 | 129 | 130 | 131 | 132 | S&kip All 133 | 134 | 135 | 136 | 137 | 138 | 139 | &Cancel 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /ressources/ui/filetransfer.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | filetransfer 4 | 5 | 6 | 7 | 0 8 | 0 9 | 770 10 | 246 11 | 12 | 13 | 14 | File Transfers 15 | 16 | 17 | 18 | 19 | 20 | 150 21 | 22 | 23 | true 24 | 25 | 26 | false 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | Clean Up 36 | 37 | 38 | 39 | 40 | 41 | 42 | Qt::Horizontal 43 | 44 | 45 | 46 | 40 47 | 20 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | Close 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /ressources/ui/installer.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | installer 4 | 5 | 6 | 7 | 0 8 | 0 9 | 470 10 | 355 11 | 12 | 13 | 14 | pyTSon Plugin Installer 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | true 24 | 25 | 26 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> 27 | <html><head><meta name="qrichtext" content="1" /><style type="text/css"> 28 | p, li { white-space: pre-wrap; } 29 | </style></head><body style=" font-family:'Cantarell'; font-size:11pt; font-weight:400; font-style:normal;"> 30 | <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html> 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 0 42 | 43 | 44 | 0 45 | 46 | 47 | 0 48 | 49 | 50 | 0 51 | 52 | 53 | 54 | 55 | Qt::Horizontal 56 | 57 | 58 | 59 | 40 60 | 20 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | Close 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /shared/pythonhost.h: -------------------------------------------------------------------------------- 1 | #ifndef PYTHONHOST_H 2 | #define PYTHONHOST_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | class PythonHost { 11 | public: 12 | typedef struct { 13 | const char* name; 14 | PyObject* (*initfunc)(void); 15 | } pythoninittab; 16 | 17 | PythonHost(); 18 | ~PythonHost(); 19 | 20 | virtual bool init(const QDir& basedir, QString& error); 21 | virtual void shutdown(); 22 | 23 | QString formatError(const QString& fallback); 24 | protected: 25 | bool setupDirectories(QString& error); 26 | bool isReady(); 27 | 28 | bool setModuleSearchpath(QString& error); 29 | 30 | bool setSysPath(QString& error); 31 | 32 | void initPythonQt(); 33 | 34 | QList m_inittabs; 35 | private: 36 | QDir m_scriptsdir; 37 | QDir m_includedir; 38 | QDir m_libdir; 39 | QDir m_dynloaddir; 40 | QDir m_sitepackdir; 41 | QDir m_base; 42 | wchar_t* m_interpreter; 43 | PyObject* m_trace; 44 | bool m_inited; 45 | }; 46 | 47 | #endif // PYTHONHOST_H 48 | -------------------------------------------------------------------------------- /shared/pythonqt/eventfilterobject.cpp: -------------------------------------------------------------------------------- 1 | #include "eventfilterobject.h" 2 | 3 | EventFilterObject::EventFilterObject(const QList& types, QObject* parent): QObject(parent), m_types(types) { 4 | 5 | } 6 | 7 | bool EventFilterObject::eventFilter(QObject* watched, QEvent* event) { 8 | if (m_types.contains(event->type())) { 9 | m_filterresult = false; 10 | emit eventFiltered(watched, event); 11 | return m_filterresult; 12 | } 13 | 14 | return QObject::eventFilter(watched, event); 15 | } 16 | 17 | void EventFilterObject::setFilterResult(bool res) { 18 | m_filterresult = res; 19 | } 20 | 21 | const QList& EventFilterObject::types() const { 22 | return m_types; 23 | } 24 | 25 | void EventFilterObject::addType(int type) { 26 | if (!m_types.contains(type)) 27 | m_types.append(type); 28 | } 29 | 30 | void EventFilterObject::removeType(int type) { 31 | int id = m_types.indexOf(type); 32 | if (id != -1) 33 | m_types.removeAt(id); 34 | } 35 | -------------------------------------------------------------------------------- /shared/pythonqt/eventfilterobject.h: -------------------------------------------------------------------------------- 1 | #ifndef EVENTFILTEROBJECT_H 2 | #define EVENTFILTEROBJECT_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | class EventFilterObject: public QObject { 10 | Q_OBJECT 11 | 12 | public: 13 | EventFilterObject(const QList& types = QList(), QObject* parent = 0); 14 | 15 | public slots: 16 | void setFilterResult(bool res); 17 | 18 | const QList& types() const; 19 | void addType(int type); 20 | void removeType(int type); 21 | signals: 22 | void eventFiltered(QObject* obj, QEvent* event); 23 | 24 | protected: 25 | bool eventFilter(QObject* watched, QEvent* event); 26 | 27 | private: 28 | QList m_types; 29 | bool m_filterresult; 30 | }; 31 | 32 | #endif // EVENTFILTEROBJECT_H 33 | -------------------------------------------------------------------------------- /shared/pythonqt/pythonqtpytson.cpp: -------------------------------------------------------------------------------- 1 | #include "pythonqtpytson.h" 2 | 3 | #include 4 | 5 | const QVariantList pytsondecorator::getContentsMargins(QLayout* layout) { 6 | int top, left, bottom, right; 7 | layout->getContentsMargins(&left, &top, &right, &bottom); 8 | 9 | return QVariantList() << left << top << right << bottom; 10 | } 11 | -------------------------------------------------------------------------------- /shared/pythonqt/pythonqtpytson.h: -------------------------------------------------------------------------------- 1 | #ifndef PYTHONQTPYTSON_H 2 | #define PYTHONQTPYTSON_H 3 | 4 | #include 5 | 6 | #include 7 | 8 | #include "eventfilterobject.h" 9 | 10 | class QLayout; 11 | 12 | class pytsondecorator: public QObject { 13 | Q_OBJECT 14 | 15 | public slots: 16 | EventFilterObject* new_EventFilterObject(const QList& types = QList(), QObject* parent = 0) { return new EventFilterObject(types, parent); } 17 | void delete_EventFilterObject(EventFilterObject* obj) { delete obj; } 18 | 19 | const QVariantList getContentsMargins(QLayout* layout); 20 | }; 21 | 22 | #endif // PYTHONQTPYTSON_H 23 | -------------------------------------------------------------------------------- /src/global_shared.cpp: -------------------------------------------------------------------------------- 1 | #include "global_shared.h" 2 | 3 | #include 4 | 5 | struct TS3Functions ts3_funcs; 6 | char* ts3_pluginid = NULL; 7 | pytsonhost* pyhost = NULL; 8 | char* pytson_version = NULL; 9 | -------------------------------------------------------------------------------- /src/global_shared.h: -------------------------------------------------------------------------------- 1 | #ifndef GLOBAL_SHARED_H 2 | #define GLOBAL_SHARED_H 3 | 4 | #include "ts3_functions.h" 5 | #include "pytsonhost.h" 6 | 7 | extern struct TS3Functions ts3_funcs; 8 | extern char* ts3_pluginid; 9 | extern pytsonhost* pyhost; 10 | extern char* pytson_version; 11 | 12 | #endif // GLOBAL_SHARED_H 13 | -------------------------------------------------------------------------------- /src/pyconversion.cpp: -------------------------------------------------------------------------------- 1 | #include "pyconversion.h" 2 | 3 | bool deviceArrayToPyList(char*** devices, QString& error, PyObject** ret) { 4 | if (!devices) { 5 | error = QObject::tr("No array given in function deviceArrayToPyList"); 6 | return false; 7 | } 8 | 9 | *ret = PyList_New(0); 10 | 11 | if (!ret) { 12 | error = QObject::tr("Memory error in function deviceArrayToPyList"); 13 | return false; 14 | } 15 | 16 | PyObject* tuple; 17 | for (int i = 0; devices[i] != NULL; ++i) { 18 | tuple = PyTuple_New(2); 19 | 20 | if (!tuple) { 21 | Py_DECREF(*ret); 22 | error = QObject::tr("Memory error (2) in function deviceArrayToPyList"); 23 | return false; 24 | } 25 | 26 | if (PyTuple_SetItem(tuple, 0, PyUnicode_FromString(devices[i][0])) != 0) { 27 | Py_DECREF(tuple); 28 | Py_DECREF(*ret); 29 | error = QObject::tr("Error appending item in tuple in function deviceArrayToPyList"); 30 | return false; 31 | } 32 | 33 | if (PyTuple_SetItem(tuple, 1, PyUnicode_FromString(devices[i][1])) != 0) { 34 | Py_DECREF(tuple); 35 | Py_DECREF(*ret); 36 | error = QObject::tr("Error appending item in tuple (2) in function deviceArrayToPyList"); 37 | return false; 38 | } 39 | 40 | if (PyList_Append(*ret, tuple) != 0) { 41 | Py_DECREF(tuple); 42 | Py_DECREF(*ret); 43 | error = QObject::tr("Error appending item in list in function deviceArrayToPyList"); 44 | return false; 45 | } 46 | Py_DECREF(tuple); 47 | } 48 | 49 | return true; 50 | } 51 | 52 | bool bookmarksToPyList(struct PluginBookmarkList* bm, QString& error, PyObject** ret) { 53 | if (!bm) { 54 | error = QObject::tr("No bookmarks given in function bookMarksToPyList"); 55 | return false; 56 | } 57 | 58 | *ret = PyList_New(bm->itemcount); 59 | if (!*ret) { 60 | error = QObject::tr("Memory error in function bookMarksToPyList"); 61 | return false; 62 | } 63 | 64 | PyObject* it; 65 | for (int i = 0; i < bm->itemcount; ++i) { 66 | it = PyTuple_New(4); 67 | 68 | if (!it) { 69 | Py_DECREF(*ret); 70 | error = QObject::tr("Memory error (2) in function bookMarksToPyList"); 71 | return false; 72 | } 73 | 74 | if (PyTuple_SetItem(it, 0, PyUnicode_FromString(bm->items[i].name)) != 0) { 75 | Py_DECREF(it); 76 | Py_DECREF(*ret); 77 | error = QObject::tr("Error appending item in tuple in function bookMarksToPyList"); 78 | return false; 79 | } 80 | 81 | if (PyTuple_SetItem(it, 1, PyLong_FromLong(bm->items[i].isFolder ? 1 : 0)) != 0) { 82 | Py_DECREF(it); 83 | Py_DECREF(*ret); 84 | error = QObject::tr("Error appending item in tuple (2) in function bookMarksToPyList"); 85 | return false; 86 | } 87 | 88 | if (bm->items[i].isFolder) { 89 | if (PyTuple_SetItem(it, 2, Py_None) != 0) { 90 | Py_DECREF(it); 91 | Py_DECREF(*ret); 92 | error = QObject::tr("Error appending item in tuple (3) in function bookMarksToPyList"); 93 | return false; 94 | } 95 | Py_INCREF(Py_None); 96 | 97 | PyObject* childs; 98 | if (!bookmarksToPyList(bm->items[i].folder, error, &childs)) { 99 | Py_DECREF(it); 100 | Py_DECREF(*ret); 101 | return false; 102 | } 103 | 104 | if (PyTuple_SetItem(it, 3, childs) != 0) { 105 | Py_DECREF(childs); 106 | Py_DECREF(it); 107 | Py_DECREF(*ret); 108 | error = QObject::tr("Error appending item in tuple (4) in function bookMarksToPyList"); 109 | return false; 110 | } 111 | } 112 | else { 113 | if (PyTuple_SetItem(it, 2, PyUnicode_FromString(bm->items[i].uuid)) != 0) { 114 | Py_DECREF(it); 115 | Py_DECREF(*ret); 116 | error = QObject::tr("Error appending item in tuple (5) in function bookMarksToPyList"); 117 | return false; 118 | } 119 | 120 | if (PyTuple_SetItem(it, 3, Py_None) != 0) { 121 | Py_DECREF(it); 122 | Py_DECREF(*ret); 123 | error = QObject::tr("Error appending item in tuple (6) in function bookMarksToPyList"); 124 | return false; 125 | } 126 | Py_INCREF(Py_None); 127 | } 128 | 129 | if (PyList_SetItem(*ret, i, it) != 0) { 130 | Py_DECREF(it); 131 | Py_DECREF(*ret); 132 | error = QObject::tr("Error appending item in list in function bookMarksToPyList"); 133 | return false; 134 | } 135 | } 136 | 137 | return true; 138 | } 139 | -------------------------------------------------------------------------------- /src/pytson.cpp: -------------------------------------------------------------------------------- 1 | #include "pytson.h" 2 | 3 | #include "pythonhost.h" 4 | #include "ts3logdispatcher.h" 5 | #include "global_shared.h" 6 | 7 | #ifndef WIN32 8 | #include 9 | #include 10 | 11 | void unixDllMain() { 12 | Dl_info dl_info; 13 | 14 | if (dladdr((void *)loadVersion, &dl_info) != 0) { 15 | loadVersion(QString(dl_info.dli_fname)); 16 | return; 17 | } 18 | 19 | setVersion("unkown"); 20 | } 21 | #else 22 | #define PATH_LEN 256 23 | 24 | BOOL DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID /*lpReserved*/) { 25 | wchar_t path[PATH_LEN]; 26 | switch (ul_reason_for_call) { 27 | case DLL_PROCESS_ATTACH: 28 | if (GetModuleFileName(hModule, path, PATH_LEN) != 0) 29 | loadVersion(QString::fromWCharArray(path)); 30 | else setVersion("unknown"); 31 | 32 | break; 33 | case DLL_PROCESS_DETACH: 34 | freeVersion(); 35 | break; 36 | default: 37 | break; 38 | } 39 | 40 | return TRUE; 41 | } 42 | 43 | #endif 44 | 45 | void loadVersion(const QString &thislibpath) { 46 | QFileInfo info(thislibpath); 47 | QDir dir = info.absoluteDir(); 48 | 49 | if (dir.cd("pyTSon")) { 50 | if (dir.exists("VERSION")) { 51 | QFile file(dir.absoluteFilePath("VERSION")); 52 | 53 | if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { 54 | QByteArray ver = file.readLine().trimmed(); 55 | file.close(); 56 | 57 | setVersion(ver.trimmed()); 58 | return; 59 | } 60 | } 61 | } 62 | 63 | setVersion("unkown"); 64 | } 65 | 66 | void setVersion(const QByteArray& ver) { 67 | pytson_version = new char[ver.length() + 1]; 68 | strncpy(pytson_version, ver, ver.length()); 69 | pytson_version[ver.length()] = '\0'; 70 | } 71 | 72 | void freeVersion() { 73 | delete[] pytson_version; 74 | } 75 | 76 | const char* ts3plugin_name() { 77 | return "pyTSon"; 78 | } 79 | 80 | const char* ts3plugin_version() { 81 | return pytson_version; 82 | } 83 | 84 | int ts3plugin_apiVersion() { 85 | return 23; 86 | } 87 | 88 | const char* ts3plugin_author() { 89 | return "Thomas \"PLuS\" Pathmann"; 90 | } 91 | 92 | const char* ts3plugin_description() { 93 | return "Plugin to customize the TS3 client with python plugins and/or scripts"; 94 | } 95 | 96 | void ts3plugin_setFunctionPointers(const struct TS3Functions functions) { 97 | ts3_funcs = functions; 98 | } 99 | 100 | void ts3plugin_freeMemory(void* data) { 101 | pyhost->freeMemory(data); 102 | } 103 | 104 | void ts3plugin_registerPluginID(const char* id) { 105 | ts3_pluginid = (char*)malloc((strlen(id) +1) * sizeof(char)); 106 | strncpy(ts3_pluginid, id, strlen(id) +1); 107 | } 108 | 109 | int ts3plugin_init() { 110 | qRegisterMetaType("quintptr"); 111 | 112 | ts3logdispatcher::instance()->init("pyTSon"); 113 | 114 | char path[256]; 115 | ts3_funcs.getPluginPath(path, 256, ts3_pluginid); 116 | 117 | QString error; 118 | pyhost = new pytsonhost; 119 | if (pyhost->init(QDir(path), error)) { 120 | return 0; 121 | } 122 | else { 123 | ts3logdispatcher::instance()->add(QString("Initializing PythonHost failed with \"%1\"").arg(error), LogLevel_ERROR); 124 | return 1; 125 | } 126 | } 127 | 128 | void ts3plugin_shutdown() { 129 | pyhost->shutdown(); 130 | delete pyhost; 131 | 132 | if (ts3_pluginid) { 133 | free(ts3_pluginid); 134 | ts3_pluginid = NULL; 135 | } 136 | } 137 | 138 | int ts3plugin_offersConfigure() { 139 | return PLUGIN_OFFERS_CONFIGURE_QT_THREAD; 140 | } 141 | 142 | void ts3plugin_configure(void* /*handle*/, void* qParentWidget) { 143 | pyhost->configure(qParentWidget); 144 | } 145 | 146 | const char* ts3plugin_commandKeyword() { 147 | return "py"; 148 | } 149 | 150 | int ts3plugin_processCommand(uint64 schid, const char* command) { 151 | return pyhost->processCommand(schid, command); 152 | } 153 | 154 | const char* ts3plugin_infoTitle() { 155 | return "pyTSon"; 156 | } 157 | 158 | void ts3plugin_infoData(uint64 schid, uint64 id, enum PluginItemType type, char** data) { 159 | pyhost->infoData(schid, id, type, data); 160 | } 161 | 162 | void ts3plugin_initMenus(struct PluginMenuItem*** menuItems, char** menuIcon) { 163 | pyhost->initMenus(menuItems, menuIcon); 164 | } 165 | 166 | void ts3plugin_initHotkeys(struct PluginHotkey*** hotkeys) { 167 | pyhost->initHotkeys(hotkeys); 168 | } 169 | 170 | int ts3plugin_requestAutoload() { 171 | return 0; 172 | } 173 | 174 | int ts3plugin_onServerErrorEvent(uint64 schid, const char* errorMessage, unsigned int error, const char* returnCode, const char* extraMessage) { 175 | return pyhost->onServerErrorEvent(schid, errorMessage, error, returnCode, extraMessage); 176 | } 177 | 178 | int ts3plugin_onTextMessageEvent(uint64 schid, anyID targetMode, anyID toID, anyID fromID, const char* fromName, const char* fromUniqueIdentifier, const char* message, int ffIgnored) { 179 | return pyhost->onTextMessageEvent(schid, targetMode, toID, fromID, fromName, fromUniqueIdentifier, message, ffIgnored); 180 | } 181 | 182 | int ts3plugin_onClientPokeEvent(uint64 schid, anyID fromClientID, const char* pokerName, const char* pokerUniqueIdentity, const char* message, int ffIgnored) { 183 | return pyhost->onClientPokeEvent(schid, fromClientID, pokerName, pokerUniqueIdentity, message, ffIgnored); 184 | } 185 | 186 | int ts3plugin_onServerPermissionErrorEvent(uint64 schid, const char* errorMessage, unsigned int error, const char* returnCode, unsigned int failedPermissionID) { 187 | return pyhost->onServerPermissionErrorEvent(schid, errorMessage, error, returnCode, failedPermissionID); 188 | } 189 | 190 | void ts3plugin_onUserLoggingMessageEvent(const char* logMessage, int logLevel, const char* logChannel, uint64 logID, const char* logTime, const char* completeLogString) { 191 | pyhost->onUserLoggingMessageEvent(logMessage, logLevel, logChannel, logID, logTime, completeLogString); 192 | } 193 | 194 | void ts3plugin_onEditPlaybackVoiceDataEvent(uint64 schid, anyID clientID, short* samples, int sampleCount, int channels) { 195 | pyhost->onEditPlaybackVoiceDataEvent(schid, clientID, samples, sampleCount, channels); 196 | } 197 | 198 | void ts3plugin_onEditPostProcessVoiceDataEvent(uint64 schid, anyID clientID, short* samples, int sampleCount, int channels, const unsigned int* channelSpeakerArray, unsigned int* channelFillMask) { 199 | pyhost->onEditPostProcessVoiceDataEvent(schid, clientID, samples, sampleCount, channels, channelSpeakerArray, channelFillMask); 200 | } 201 | 202 | void ts3plugin_onEditMixedPlaybackVoiceDataEvent(uint64 schid, short* samples, int sampleCount, int channels, const unsigned int* channelSpeakerArray, unsigned int* channelFillMask) { 203 | pyhost->onEditMixedPlaybackVoiceDataEvent(schid, samples, sampleCount, channels, channelSpeakerArray, channelFillMask); 204 | } 205 | 206 | void ts3plugin_onEditCapturedVoiceDataEvent(uint64 schid, short* samples, int sampleCount, int channels, int* edited) { 207 | pyhost->onEditCapturedVoiceDataEvent(schid, samples, sampleCount, channels, edited); 208 | } 209 | 210 | void ts3plugin_onCustom3dRolloffCalculationClientEvent(uint64 schid, anyID clientID, float distance, float* volume) { 211 | pyhost->onCustom3dRolloffCalculationClientEvent(schid, clientID, distance, volume); 212 | } 213 | 214 | void ts3plugin_onCustom3dRolloffCalculationWaveEvent(uint64 schid, uint64 waveHandle, float distance, float* volume) { 215 | pyhost->onCustom3dRolloffCalculationWaveEvent(schid, waveHandle, distance, volume); 216 | } 217 | 218 | void ts3plugin_onFileTransferStatusEvent(anyID transferID, unsigned int status, const char* statusMessage, uint64 remotefileSize, uint64 schid) { 219 | pyhost->onFileTransferStatusEvent(transferID, status, statusMessage, remotefileSize, schid); 220 | } 221 | -------------------------------------------------------------------------------- /src/pytson.h: -------------------------------------------------------------------------------- 1 | #ifndef PYTSON_H 2 | #define PYTSON_H 3 | 4 | #ifdef WIN32 5 | #define EXPORT_SYMBOL __declspec(dllexport) 6 | #else 7 | #define EXPORT_SYMBOL __attribute__ ((visibility("default"))) 8 | #endif 9 | 10 | #include 11 | 12 | #include 13 | 14 | #include "teamspeak/public_definitions.h" 15 | #include "plugin_definitions.h" 16 | #include "ts3_functions.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | #ifdef WIN32 23 | #include 24 | BOOL DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved); 25 | void freeVersion(); 26 | #else 27 | __attribute__((constructor)) void unixDllMain(); 28 | __attribute__((destructor)) void freeVersion(); 29 | #endif 30 | 31 | void loadVersion(const QString& thislibpath); 32 | void setVersion(const QByteArray& ver); 33 | 34 | EXPORT_SYMBOL const char* ts3plugin_name(); 35 | EXPORT_SYMBOL const char* ts3plugin_version(); 36 | EXPORT_SYMBOL int ts3plugin_apiVersion(); 37 | EXPORT_SYMBOL const char* ts3plugin_author(); 38 | EXPORT_SYMBOL const char* ts3plugin_description(); 39 | EXPORT_SYMBOL void ts3plugin_setFunctionPointers(const struct TS3Functions functions); 40 | EXPORT_SYMBOL void ts3plugin_freeMemory(void* data); 41 | EXPORT_SYMBOL void ts3plugin_registerPluginID(const char* id); 42 | EXPORT_SYMBOL int ts3plugin_init(); 43 | EXPORT_SYMBOL void ts3plugin_shutdown(); 44 | EXPORT_SYMBOL int ts3plugin_offersConfigure(); 45 | EXPORT_SYMBOL void ts3plugin_configure(void* handle, void* qParentWidget); 46 | EXPORT_SYMBOL const char* ts3plugin_commandKeyword(); 47 | EXPORT_SYMBOL int ts3plugin_processCommand(uint64 schid, const char* command); 48 | EXPORT_SYMBOL const char* ts3plugin_infoTitle(); 49 | EXPORT_SYMBOL void ts3plugin_infoData(uint64 schid, uint64 id, enum PluginItemType type, char** data); 50 | EXPORT_SYMBOL void ts3plugin_initMenus(struct PluginMenuItem*** menuItems, char** menuIcon); 51 | EXPORT_SYMBOL void ts3plugin_initHotkeys(struct PluginHotkey*** hotkeys); 52 | EXPORT_SYMBOL int ts3plugin_requestAutoload(); 53 | EXPORT_SYMBOL int ts3plugin_onServerErrorEvent(uint64 schid, const char* errorMessage, unsigned int error, const char* returnCode, const char* extraMessage); 54 | EXPORT_SYMBOL int ts3plugin_onTextMessageEvent(uint64 schid, anyID targetMode, anyID toID, anyID fromID, const char* fromName, const char* fromUniqueIdentifier, const char* message, int ffIgnored); 55 | EXPORT_SYMBOL int ts3plugin_onClientPokeEvent(uint64 schid, anyID fromClientID, const char* pokerName, const char* pokerUniqueIdentity, const char* message, int ffIgnored); 56 | EXPORT_SYMBOL int ts3plugin_onServerPermissionErrorEvent(uint64 schid, const char* errorMessage, unsigned int error, const char* returnCode, unsigned int failedPermissionID); 57 | EXPORT_SYMBOL void ts3plugin_onUserLoggingMessageEvent(const char* logMessage, int logLevel, const char* logChannel, uint64 logID, const char* logTime, const char* completeLogString); 58 | EXPORT_SYMBOL void ts3plugin_onEditPlaybackVoiceDataEvent(uint64 schid, anyID clientID, short* samples, int sampleCount, int channels); 59 | EXPORT_SYMBOL void ts3plugin_onEditPostProcessVoiceDataEvent(uint64 schid, anyID clientID, short* samples, int sampleCount, int channels, const unsigned int* channelSpeakerArray, unsigned int* channelFillMask); 60 | EXPORT_SYMBOL void ts3plugin_onEditMixedPlaybackVoiceDataEvent(uint64 schid, short* samples, int sampleCount, int channels, const unsigned int* channelSpeakerArray, unsigned int* channelFillMask); 61 | EXPORT_SYMBOL void ts3plugin_onEditCapturedVoiceDataEvent(uint64 schid, short* samples, int sampleCount, int channels, int* edited); 62 | EXPORT_SYMBOL void ts3plugin_onCustom3dRolloffCalculationClientEvent(uint64 schid, anyID clientID, float distance, float* volume); 63 | EXPORT_SYMBOL void ts3plugin_onCustom3dRolloffCalculationWaveEvent(uint64 schid, uint64 waveHandle, float distance, float* volume); 64 | EXPORT_SYMBOL void ts3plugin_onFileTransferStatusEvent(anyID transferID, unsigned int status, const char* statusMessage, uint64 remotefileSize, uint64 schid); 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | 71 | #endif // PYTSON_H 72 | -------------------------------------------------------------------------------- /src/pytsonhost.h: -------------------------------------------------------------------------------- 1 | #ifndef PYTSONHOST_H 2 | #define PYTSONHOST_H 3 | 4 | #include 5 | 6 | #include 7 | 8 | #include "pythonhost.h" 9 | 10 | #include "teamspeak/public_definitions.h" 11 | #include "plugin_definitions.h" 12 | 13 | #include 14 | 15 | #include "ts3callbackarguments.h" 16 | 17 | class pytsonhost: public QObject, PythonHost { 18 | Q_OBJECT 19 | 20 | public: 21 | pytsonhost(); 22 | ~pytsonhost(); 23 | 24 | bool init(const QDir& basedir, QString& error); 25 | void shutdown(); 26 | 27 | void freeMemory(void* data); 28 | void configure(void* qParentWidget); 29 | int processCommand(uint64 schid, const char* command); 30 | void infoData(uint64 schid, uint64 id, enum PluginItemType type, char** data); 31 | void initMenus(struct PluginMenuItem*** menuItems, char** menuIcon); 32 | void initHotkeys(struct PluginHotkey*** hotkeys); 33 | int onServerErrorEvent(uint64 schid, const char* errorMessage, unsigned int error, const char* returnCode, const char* extraMessage); 34 | int onTextMessageEvent(uint64 schid, anyID targetMode, anyID toID, anyID fromID, const char* fromName, const char* fromUniqueIdentifier, const char* message, int ffIgnored); 35 | int onClientPokeEvent(uint64 schid, anyID fromClientID, const char* pokerName, const char* pokerUniqueIdentity, const char* message, int ffIgnored); 36 | int onServerPermissionErrorEvent(uint64 schid, const char* errorMessage, unsigned int error, const char* returnCode, unsigned int failedPermissionID); 37 | void onUserLoggingMessageEvent(const char* logMessage, int logLevel, const char* logChannel, uint64 logID, const char* logTime, const char* completeLogString); 38 | void onEditPlaybackVoiceDataEvent(uint64 schid, anyID clientID, short* samples, int sampleCount, int channels); 39 | void onEditPostProcessVoiceDataEvent(uint64 schid, anyID clientID, short* samples, int sampleCount, int channels, const unsigned int* channelSpeakerArray, unsigned int* channelFillMask); 40 | void onEditMixedPlaybackVoiceDataEvent(uint64 schid, short* samples, int sampleCount, int channels, const unsigned int* channelSpeakerArray, unsigned int* channelFillMask); 41 | void onEditCapturedVoiceDataEvent(uint64 schid, short* samples, int sampleCount, int channels, int* edited); 42 | void onCustom3dRolloffCalculationClientEvent(uint64 schid, anyID clientID, float distance, float* volume); 43 | void onCustom3dRolloffCalculationWaveEvent(uint64 schid, uint64 waveHandle, float distance, float* volume); 44 | void onFileTransferStatusEvent(anyID transferID, unsigned int status, const char* statusMessage, uint64 remotefileSize, uint64 schid); 45 | 46 | bool callMethod(PyObject** ret, QString& error, const char* format, ...); 47 | 48 | signals: 49 | void callInMainThread(const ts3callbackarguments args); 50 | 51 | protected slots: 52 | void onCallInMainThread(const ts3callbackarguments args); 53 | 54 | protected: 55 | bool isReady(); 56 | 57 | private: 58 | PyObject* m_pluginmod; 59 | PyObject* m_pmod; 60 | PyObject* m_pyhost; 61 | PyObject* m_callmeth; 62 | 63 | std::thread::id m_mainthread; 64 | }; 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /src/singleton.h: -------------------------------------------------------------------------------- 1 | #ifndef __SINGLETON__H 2 | #define __SINGLETON__H 3 | 4 | template 5 | class singleton { 6 | public: 7 | static T* instance() { 8 | return ((m_watcher.m_object) ? m_watcher.m_object : m_watcher.m_object = new T); 9 | } 10 | 11 | static void clip() { 12 | instance(); 13 | 14 | if (m_clip.m_object) 15 | return; 16 | 17 | m_clip.m_object = new T(*m_watcher.m_object); 18 | } 19 | 20 | static void accept() { 21 | if (!m_clip.m_object) 22 | return; 23 | 24 | delete m_clip.m_object; 25 | } 26 | 27 | static void revert() { 28 | if (!m_clip.m_object) 29 | return; 30 | 31 | T* tmp = m_watcher.m_object; 32 | m_watcher.m_object = m_clip.m_object; 33 | 34 | delete tmp; 35 | m_clip.m_object = 0; 36 | } 37 | private: 38 | struct watcher { 39 | T* m_object; 40 | watcher() { 41 | m_object = 0; 42 | } 43 | 44 | ~watcher() { 45 | if (m_object) 46 | delete m_object; 47 | } 48 | }; 49 | 50 | static watcher m_watcher; 51 | static watcher m_clip; 52 | protected: 53 | singleton() {} 54 | ~singleton() {} 55 | }; 56 | 57 | template typename singleton::watcher singleton::m_watcher; 58 | template typename singleton::watcher singleton::m_clip; 59 | 60 | #endif // __SINGLETON__H 61 | -------------------------------------------------------------------------------- /src/src.pro: -------------------------------------------------------------------------------- 1 | QT += gui widgets network uitools sql 2 | 3 | CONFIG += c++11 4 | 5 | TARGET = pyTSon 6 | TEMPLATE = lib 7 | 8 | DESTDIR = ../build 9 | OBJECTS_DIR = build 10 | MOC_DIR = build 11 | RCC_DIR = build 12 | UI_DIR = build 13 | 14 | INCLUDEPATH += ../includes/pluginsdk/23/include 15 | 16 | SOURCES += pytson.cpp \ 17 | pytsonhost.cpp \ 18 | global_shared.cpp \ 19 | ts3logdispatcher.cpp \ 20 | pyconversion.cpp \ 21 | ts3callbackarguments.cpp \ 22 | ../shared/pythonhost.cpp \ 23 | ../shared/pythonqt/eventfilterobject.cpp \ 24 | ../shared/pythonqt/pythonqtpytson.cpp 25 | 26 | HEADERS += pytson.h \ 27 | pytsonhost.h \ 28 | singleton.h \ 29 | global_shared.h \ 30 | ts3logdispatcher.h \ 31 | pyconversion.h \ 32 | ts3callbackarguments.h \ 33 | ../shared/pythonhost.h \ 34 | ../shared/pythonqt/eventfilterobject.h \ 35 | ../shared/pythonqt/pythonqtpytson.h 36 | 37 | OTHER_FILES += ../templates/ts3lib.h.tpl \ 38 | ../templates/ts3lib.cpp.tpl \ 39 | ../templates/ts3plugin.h.tpl \ 40 | ../templates/ts3plugin.cpp.tpl \ 41 | ../templates/ts3defines.py.tpl \ 42 | ../ressources/ui/pyTSon-configdialog.ui \ 43 | ../ressources/ui/repository.ui \ 44 | ../ressources/ui/repository-manager.ui \ 45 | ../ressources/ui/installer.ui \ 46 | ../ressources/python/pytsonui/__init__.py \ 47 | ../ressources/python/pytsonui/console.py \ 48 | ../ressources/python/pytsonui/config.py \ 49 | ../ressources/python/pytsonui/dialogs.py \ 50 | ../ressources/python/pytsonui/repository.py \ 51 | ../ressources/python/devtools.py \ 52 | ../ressources/repositorymaster.json \ 53 | ../ressources/python/pytson.py \ 54 | ../ressources/python/ts3client.py \ 55 | ../ressources/python/ts3plugin.py \ 56 | ../ressources/python/pluginhost.py \ 57 | ../ressources/python/pythonqtpytson.py \ 58 | ../ressources/python/ts3widgets/__init__.py \ 59 | ../ressources/python/ts3widgets/serverview.py \ 60 | ../ressources/python/ts3widgets/filetransfer.py \ 61 | ../ressources/ui/filebrowser.ui \ 62 | ../ressources/ui/filecollision.ui \ 63 | ../ressources/ui/filetransfer.ui 64 | 65 | INCLUDEPATH += ../shared 66 | 67 | unix:!mac { 68 | QMAKE_RPATHDIR += $ORIGIN/pyTSon 69 | } 70 | 71 | 72 | ########PYTHON SETTINGS############ 73 | include (../python.pri) 74 | 75 | macx { 76 | QT_MODULES = Core Gui Widgets Network Sql 77 | for(m, QT_MODULES) { 78 | QMAKE_POST_LINK += install_name_tool -change @rpath/libQt5$${m}.5.dylib @executable_path/../Frameworks/libQt5$${m}.dylib $${DESTDIR}/libpyTSon.dylib && 79 | } 80 | 81 | QMAKE_POST_LINK += install_name_tool -change $${PYTHONPATH}/lib/libpython3.5m.dylib @loader_path/pyTSon/libpython3.5m.dylib ${DESTDIR}${TARGET} & 82 | } 83 | 84 | 85 | #########GENERATED SOURCES######### 86 | SOURCES += ../generated/pregen/ts3lib.cpp \ 87 | ../generated/pregen/ts3plugin.cpp 88 | 89 | HEADERS += ../generated/pregen/ts3lib.h \ 90 | ../generated/pregen/ts3plugin.h 91 | 92 | INCLUDEPATH += ../generated/pregen 93 | 94 | 95 | #########PythonQt Settings######### 96 | include (../pythonqt.pri) 97 | -------------------------------------------------------------------------------- /src/ts3callbackarguments.cpp: -------------------------------------------------------------------------------- 1 | #include "ts3callbackarguments.h" 2 | 3 | #include 4 | 5 | ts3callbackarguments::ts3callbackarguments() { 6 | 7 | } 8 | 9 | bool ts3callbackarguments::init(QString& error, const char* format, va_list vl) { 10 | /* minimum is "(x)" */ 11 | if (strlen(format) < 3) { 12 | error = QObject::tr("Format string is too short"); 13 | return false; 14 | } 15 | 16 | if (format[0] != '(' || format[strlen(format) -1] != ')') { 17 | error = QObject::tr("Format string is no tuple"); 18 | return false; 19 | } 20 | 21 | for (unsigned int i = 1; i < strlen(format) -1; ++i) { 22 | switch (format[i]) { 23 | case 's': 24 | addString(va_arg(vl, char*)); 25 | break; 26 | case 'i': 27 | addInt(va_arg(vl, int)); 28 | break; 29 | case 'I': 30 | addUnsignedInt(va_arg(vl, unsigned int)); 31 | break; 32 | case 'K': 33 | addUnsignedLongLong(va_arg(vl, unsigned long long)); 34 | break; 35 | default: 36 | error = QObject::tr("Unrecognized format character \"%1\"").arg(format[i]); 37 | return false; 38 | } 39 | } 40 | 41 | return true; 42 | } 43 | 44 | void ts3callbackarguments::addInt(int val) { 45 | m_formats.append('i'); 46 | m_values.append(val); 47 | } 48 | 49 | void ts3callbackarguments::addUnsignedInt(unsigned int val) { 50 | m_formats.append('I'); 51 | m_values.append(val); 52 | } 53 | 54 | void ts3callbackarguments::addUnsignedLongLong(unsigned long long val) { 55 | m_formats.append('K'); 56 | m_values.append(val); 57 | } 58 | 59 | void ts3callbackarguments::addString(char *val) { 60 | m_formats.append('s'); 61 | m_values.append(QString(val)); 62 | } 63 | 64 | PyObject* ts3callbackarguments::toPythonTuple(QString& error) const { 65 | if (m_formats.size() != m_values.size()) { 66 | error = QObject::tr("Internal error: vector sizes do not match"); 67 | return NULL; 68 | } 69 | 70 | PyObject* ret = PyTuple_New(m_formats.size()); 71 | 72 | if (!ret) { 73 | error = QObject::tr("Memory error"); 74 | return NULL; 75 | } 76 | 77 | PyObject* it; 78 | for (int i = 0; i < m_formats.size(); ++i) { 79 | switch (m_formats[i]) { 80 | case 's': 81 | it = PyUnicode_FromString(m_values[i].toString().toUtf8().data()); 82 | if (!it) { 83 | error = QObject::tr("Memory error (2)"); 84 | Py_DECREF(ret); 85 | return NULL; 86 | } 87 | 88 | if (PyTuple_SetItem(ret, i, it) != 0) { 89 | error = QObject::tr("Error adding string to tuple"); 90 | Py_DECREF(it); 91 | Py_DECREF(ret); 92 | return NULL; 93 | } 94 | break; 95 | case 'i': 96 | it = PyLong_FromLong(m_values[i].toInt()); 97 | if (!it) { 98 | error = QObject::tr("Memory error (3)"); 99 | Py_DECREF(ret); 100 | return NULL; 101 | } 102 | 103 | if (PyTuple_SetItem(ret, i, it) != 0) { 104 | error = QObject::tr("Error adding int to tuple"); 105 | Py_DECREF(it); 106 | Py_DECREF(ret); 107 | return NULL; 108 | } 109 | break; 110 | case 'I': 111 | it = PyLong_FromUnsignedLong(m_values[i].toUInt()); 112 | if (!it) { 113 | error = QObject::tr("Memory error (4)"); 114 | Py_DECREF(ret); 115 | return NULL; 116 | } 117 | 118 | if (PyTuple_SetItem(ret, i, it) != 0) { 119 | error = QObject::tr("Error adding unsigned int to tuple"); 120 | Py_DECREF(it); 121 | Py_DECREF(ret); 122 | return NULL; 123 | } 124 | break; 125 | case 'K': 126 | it = PyLong_FromUnsignedLongLong(m_values[i].toULongLong()); 127 | if (!it) { 128 | error = QObject::tr("Memory error (5)"); 129 | Py_DECREF(ret); 130 | return NULL; 131 | } 132 | 133 | if (PyTuple_SetItem(ret, i, it) != 0) { 134 | error = QObject::tr("Error adding unsigned long long to tuple"); 135 | Py_DECREF(it); 136 | Py_DECREF(ret); 137 | return NULL; 138 | } 139 | break; 140 | default: 141 | error = QObject::tr("Internal error: unrecognized format character \"%1\"").arg(m_formats[i]); 142 | break; 143 | } 144 | } 145 | 146 | return ret; 147 | } 148 | -------------------------------------------------------------------------------- /src/ts3callbackarguments.h: -------------------------------------------------------------------------------- 1 | #ifndef TS3CALLBACKARGUMENTS_H 2 | #define TS3CALLBACKARGUMENTS_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | class ts3callbackarguments { 11 | public: 12 | ts3callbackarguments(); 13 | 14 | bool init(QString& error, const char* format, va_list vl); 15 | 16 | void addInt(int val); 17 | void addUnsignedInt(unsigned int val); 18 | void addUnsignedLongLong(unsigned long long val); 19 | void addString(char* val); 20 | 21 | PyObject* toPythonTuple(QString& error) const; 22 | 23 | private: 24 | QVector m_formats; 25 | QVector m_values; 26 | }; 27 | 28 | #endif // TS3CALLBACKARGUMENTS_H 29 | -------------------------------------------------------------------------------- /src/ts3logdispatcher.cpp: -------------------------------------------------------------------------------- 1 | #include "ts3logdispatcher.h" 2 | 3 | #include "global_shared.h" 4 | 5 | 6 | ts3logdispatcher::ts3logdispatcher(): singleton() { 7 | 8 | } 9 | 10 | ts3logdispatcher::~ts3logdispatcher() { 11 | 12 | } 13 | 14 | void ts3logdispatcher::init(const QString &channel) { 15 | m_chan = channel; 16 | } 17 | 18 | void ts3logdispatcher::add(const QString &msg, LogLevel level, uint64 id, bool totab) { 19 | ts3_funcs.logMessage(msg.toUtf8().data(), level, m_chan.toUtf8().data(), id); 20 | 21 | if (totab) 22 | ts3_funcs.printMessageToCurrentTab(msg.toUtf8().data()); 23 | } 24 | -------------------------------------------------------------------------------- /src/ts3logdispatcher.h: -------------------------------------------------------------------------------- 1 | #ifndef TS3LOGDISPATCHER_H 2 | #define TS3LOGDISPATCHER_H 3 | 4 | #include "singleton.h" 5 | 6 | #include "teamspeak/public_definitions.h" 7 | #include "teamlog/logtypes.h" 8 | 9 | #include 10 | 11 | class ts3logdispatcher: public singleton { 12 | friend class singleton; 13 | public: 14 | void init(const QString& channel); 15 | 16 | void add(const QString &msg, LogLevel level = LogLevel_INFO, uint64 id = 0, bool totab = false); 17 | private: 18 | ts3logdispatcher(); 19 | ~ts3logdispatcher(); 20 | 21 | QString m_chan; 22 | }; 23 | 24 | #endif // TS3LOGDISPATCHER_H 25 | -------------------------------------------------------------------------------- /templates/ts3defines.py.tpl: -------------------------------------------------------------------------------- 1 | from collections import namedtuple 2 | 3 | TS3Vector = namedtuple('TS3Vecor', 'x y') 4 | 5 | PLUGIN_MENU_BUFSZ = 128 6 | PLUGIN_HOTKEY_BUFSZ = 128 7 | 8 | TS3_MAX_SIZE_CHANNEL_NAME = 40 9 | TS3_MAX_SIZE_VIRTUALSERVER_NAME = 64 10 | TS3_MAX_SIZE_CLIENT_NICKNAME = 64 11 | TS3_MIN_SIZE_CLIENT_NICKNAME = 3 12 | TS3_MAX_SIZE_REASON_MESSAGE = 80 13 | 14 | TS3_MAX_SIZE_TEXTMESSAGE = 1024 15 | TS3_MAX_SIZE_CHANNEL_TOPIC = 255 16 | TS3_MAX_SIZE_CHANNEL_DESCRIPTION = 8192 17 | TS3_MAX_SIZE_VIRTUALSERVER_WELCOMEMESSAGE = 1024 18 | 19 | TS3_MIN_SECONDS_CLIENTID_REUSE = 300 20 | 21 | MAX_VARIABLES_EXPORT_COUNT = 64 22 | 23 | BANDWIDTH_LIMIT_UNLIMITED = 0xFFFFFFFFFFFFFFFF 24 | 25 | SPEAKER_FRONT_LEFT = 0x1 26 | SPEAKER_FRONT_RIGHT = 0x2 27 | SPEAKER_FRONT_CENTER = 0x4 28 | SPEAKER_LOW_FREQUENCY = 0x8 29 | SPEAKER_BACK_LEFT = 0x10 30 | SPEAKER_BACK_RIGHT = 0x20 31 | SPEAKER_FRONT_LEFT_OF_CENTER = 0x40 32 | SPEAKER_FRONT_RIGHT_OF_CENTER = 0x80 33 | SPEAKER_BACK_CENTER = 0x100 34 | SPEAKER_SIDE_LEFT = 0x200 35 | SPEAKER_SIDE_RIGHT = 0x400 36 | SPEAKER_TOP_CENTER = 0x800 37 | SPEAKER_TOP_FRONT_LEFT = 0x1000 38 | SPEAKER_TOP_FRONT_CENTER = 0x2000 39 | SPEAKER_TOP_FRONT_RIGHT = 0x4000 40 | SPEAKER_TOP_BACK_LEFT = 0x8000 41 | SPEAKER_TOP_BACK_CENTER = 0x10000 42 | SPEAKER_TOP_BACK_RIGHT = 0x20000 43 | SPEAKER_HEADPHONES_LEFT = 0x10000000 44 | SPEAKER_HEADPHONES_RIGHT = 0x20000000 45 | SPEAKER_MONO = 0x40000000 46 | 47 | TS3_MAX_SIZE_CLIENT_NICKNAME_NONSDK = 30 48 | TS3_MIN_SIZE_CLIENT_NICKNAME_NONSDK = 3 49 | TS3_MAX_SIZE_AWAY_MESSAGE = 80 50 | TS3_MAX_SIZE_GROUP_NAME = 30 51 | TS3_MAX_SIZE_TALK_REQUEST_MESSAGE = 50 52 | TS3_MAX_SIZE_COMPLAIN_MESSAGE = 200 53 | TS3_MAX_SIZE_CLIENT_DESCRIPTION = 200 54 | TS3_MAX_SIZE_HOST_MESSAGE = 200 55 | TS3_MAX_SIZE_HOSTBUTTON_TOOLTIP = 50 56 | TS3_MAX_SIZE_POKE_MESSAGE = 100 57 | TS3_MAX_SIZE_OFFLINE_MESSAGE = 4096 58 | TS3_MAX_SIZE_OFFLINE_MESSAGE_SUBJECT = 200 59 | 60 | TS3_MAX_SIZE_PLUGIN_COMMAND = 1024 * 8 61 | TS3_MAX_SIZE_VIRTUALSERVER_HOSTBANNER_GFX_URL = 2000 62 | 63 | {% for key, value in constants|dictsort %} 64 | {{key}} = {{value}} 65 | 66 | {% endfor %} 67 | {% for name, e in enums|dictsort %} 68 | 69 | {% if name in ("Ts3ErrorType", "Ts3RareErrorType") %} 70 | {% for (n, v) in e %} 71 | {{n}} = {{v}} 72 | {% endfor %} 73 | {% else %} 74 | class {{name}}(object): 75 | {% for (n, v) in e %} 76 | {{n}} = {{v}} 77 | {% endfor %} 78 | {% endif %} 79 | 80 | {%- endfor -%} 81 | -------------------------------------------------------------------------------- /templates/ts3help.py.tpl: -------------------------------------------------------------------------------- 1 | from pydoc import help as pydochelp 2 | 3 | 4 | def help(obj): 5 | """ 6 | This is a wrapper around pydoc.help to display docstrings for the ts3 module. 7 | Note: Adding the docstrings directly in the cpython module blows up the data segment of the pyTSon library. 8 | """ 9 | if hasattr(obj, "__module__") and (obj.__module__ == "ts3lib" or obj.__module__ == "_ts3lib"): 10 | name = getattr(obj, "__name__", None) 11 | 12 | txt = "" 13 | if name: 14 | {% for name, f in functions|dictsort %} 15 | {% if loop.index == 1 %} 16 | if name == "{{name}}": 17 | {% else %} 18 | elif name == "{{name}}": 19 | {% endif %} 20 | {% if f.docString != "" %} 21 | txt = "{{f.docString}}" 22 | {% endif %} 23 | {% endfor %} 24 | 25 | if txt != "": 26 | for l in txt.split("\n"): 27 | print(l) 28 | 29 | return 30 | 31 | return pydochelp(obj) 32 | -------------------------------------------------------------------------------- /templates/ts3lib.cpp.tpl: -------------------------------------------------------------------------------- 1 | #include "ts3lib.h" 2 | 3 | #include 4 | #include 5 | 6 | #include "teamspeak/public_definitions.h" 7 | #include "teamspeak/public_errors.h" 8 | 9 | #include "global_shared.h" 10 | #include "pyconversion.h" 11 | 12 | #include "PythonQtInstanceWrapper.h" 13 | 14 | //this macros makes the code "slightly" ugly, but as long as we use a strict C-Parser, it's necessary 15 | #ifdef PYTSON_PARSER 16 | #define TRANS (void*) 17 | #define PYLIST_TO_ARRAY(type, list, error, ret, appendNull) (void*)(list, error, ret, appendNull) 18 | #define ARRAY_TO_PYLIST(type, array, formatChar, error, ret, len) (void*)(array, formatChar, error, ret, len) 19 | #define VECTOR(x, y, z) (void*)(x, y, z) 20 | #define CPPALLOC(type, size) (void*)(size) 21 | #define delete 22 | #define CPPDELARR(arr) (void*)(arr) 23 | #else 24 | #define TRANS QObject::tr 25 | #define PYLIST_TO_ARRAY(type, list, error, ret, appendNull) pyListToArray(list, error, ret, appendNull) 26 | #define ARRAY_TO_PYLIST(type, array, formatChar, error, ret, len) arrayToPyList(array, formatChar, error, ret, len) 27 | #define VECTOR(x, y, z) {x, y, z} 28 | #define CPPALLOC(type, size) new type[size] 29 | #define CPPDELARR(arr) delete[] arr 30 | #endif 31 | 32 | void freeBookmarkList(struct PluginBookmarkList* list) { 33 | for (int i = 0; i < list->itemcount; ++i) { 34 | ts3_funcs.freeMemory(list->items[i].name); 35 | 36 | if (list->items[i].isFolder) 37 | freeBookmarkList(list->items[i].folder); 38 | else ts3_funcs.freeMemory(list->items[i].uuid); 39 | } 40 | 41 | ts3_funcs.freeMemory(list); 42 | } 43 | 44 | 45 | #ifndef PYTSON_PARSER 46 | static PyMethodDef ts3modfuncs[] = { 47 | {"getPluginID", getPluginID, METH_VARARGS, "Get pyTSon's pluginID"}, 48 | {% for name in functions|sort %} 49 | {"{{name}}", {{name}}, METH_VARARGS, "Call {{name}} of the ts3 client plugin sdk"}, 50 | {% endfor %} 51 | {NULL, NULL, 0, NULL} 52 | }; 53 | 54 | static PyModuleDef mdef = { 55 | PyModuleDef_HEAD_INIT, 56 | "_ts3lib", 57 | NULL, 58 | -1, 59 | ts3modfuncs, 60 | NULL, 61 | NULL, 62 | NULL, 63 | NULL 64 | }; 65 | 66 | PyMODINIT_FUNC PyInit_ts3lib(void) { 67 | return PyModule_Create(&mdef); 68 | } 69 | #endif 70 | 71 | PyObject* getPluginID(PyObject* /*self*/, PyObject* args) { 72 | /* 73 | def getPluginID(): 74 | """ 75 | Returns pyTSon's plugin id 76 | @return: the plugin id 77 | @rtype: string 78 | """ 79 | */ 80 | if (!PyArg_ParseTuple(args, "")) 81 | return NULL; 82 | 83 | return Py_BuildValue("s", ts3_pluginid); 84 | } 85 | 86 | {% for name, f in functions|dictsort %} 87 | PyObject* {{f.name}}(PyObject* /*self*/, PyObject* args) { 88 | {% if f.body == "" %} 89 | //{{f.signature}} 90 | /* 91 | def {{f.name}}({{f.parameterNames | join(", ")}}): 92 | """ 93 | 94 | {% for p in f.parameterNames %} 95 | @param {{p}}: 96 | @type {{p}}: 97 | {% endfor %} 98 | """ 99 | 100 | */ 101 | 102 | {% else %} 103 | {{f.body}} 104 | {% endif %} 105 | } 106 | 107 | {% endfor %} 108 | -------------------------------------------------------------------------------- /templates/ts3lib.h.tpl: -------------------------------------------------------------------------------- 1 | #ifndef TS3LIB_H__ 2 | #define TS3LIB_H__ 3 | 4 | #include 5 | 6 | #ifndef PYTSON_PARSER 7 | PyMODINIT_FUNC PyInit_ts3lib(void); 8 | #endif 9 | 10 | PyObject* getPluginID(PyObject* self, PyObject* args); 11 | {% for name, f in functions|dictsort %} 12 | PyObject* {{f.name}}(PyObject* self, PyObject* args); 13 | {% endfor %} 14 | 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /templates/ts3plugin.h.tpl: -------------------------------------------------------------------------------- 1 | #ifndef TS3PLUGIN_H__ 2 | #define TS3PLUGIN_H__ 3 | 4 | #ifdef WIN32 5 | #define EXPORT_SYMBOL __declspec(dllexport) 6 | #else 7 | #define EXPORT_SYMBOL __attribute__ ((visibility("default"))) 8 | #endif 9 | 10 | 11 | #include "teamspeak/public_definitions.h" 12 | #include "plugin_definitions.h" 13 | 14 | #ifndef PYTSON_PARSER 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | #endif 19 | 20 | {% for name, c in callbacks|dictsort %} 21 | EXPORT_SYMBOL {{c.signature}}; 22 | {% endfor %} 23 | 24 | #ifndef PYTSON_PARSER 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /tools/generator/epydoc.conf: -------------------------------------------------------------------------------- 1 | [epydoc] 2 | name: pyTSon 3 | url: https://pytson.4qt.de 4 | 5 | -------------------------------------------------------------------------------- /tools/generator/generate_docs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import sys 4 | import os 5 | import glob 6 | 7 | from argparse import ArgumentParser 8 | 9 | DOC_FILES = ["ts3lib.cpp", "ts3plugin.cpp"] 10 | EXTRA_FILES = [("..", "..", "ressources", "python", "pytsonui"), 11 | ("..", "..", "ressources", "python", "pytson.py"), 12 | ("..", "..", "ressources", "python", "devtools.py"), 13 | ("..", "..", "ressources", "python", "ts3client.py"), 14 | ("..", "..", "ressources", "python", "pluginhost.py"), 15 | ("..", "..", "ressources", "python", "ts3widgets"), 16 | ("..", "..", "ressources", "python", "pythonqtpytson.py"), 17 | ("..", "..", "ressources", "python", "signalslot.py"), 18 | ("..", "..", "tools", "pylupdate.py"), 19 | ("..", "..", "generated", "pregen", "ts3defines.py")] 20 | 21 | 22 | def main(inpdir, outdir): 23 | outfiles = [os.path.join(inpdir, os.path.join(*t)) for t in EXTRA_FILES] 24 | for fname in [os.path.join(inpdir, f) for f in DOC_FILES]: 25 | if not os.path.exists(fname): 26 | print("File %s does not exist" % fname) 27 | sys.exit(1) 28 | 29 | incomment = False 30 | 31 | with open(fname, "r") as inf: 32 | outfiles.append(os.path.join(outdir, os.path.splitext( 33 | os.path.basename(fname))[0] + ".py")) 34 | with open(outfiles[-1], "w") as outf: 35 | for l in inf: 36 | if not incomment and l.strip() == "/*": 37 | incomment = True 38 | elif incomment and l.strip() == "*/": 39 | incomment = False 40 | outf.write("\n") 41 | elif incomment: 42 | outf.write(l) 43 | 44 | thisdir = os.path.dirname(__file__) 45 | patches = glob.glob(os.path.join(thisdir, "*.patch")) 46 | 47 | for patch in patches: 48 | os.system("patch -p1 < %s" % patch) 49 | 50 | confpath = os.path.join(thisdir, "epydoc.conf") 51 | os.system("epydoc %s --parse-only -o %s/html --html --config %s" % 52 | (" ".join(outfiles), outdir, confpath)) 53 | os.system("epydoc %s --parse-only -o %s/pdf --pdf --config %s" % 54 | (" ".join(outfiles), outdir, confpath)) 55 | 56 | for patch in patches: 57 | os.system("patch -p1 -R < %s" % patch) 58 | 59 | 60 | if __name__ == "__main__": 61 | parser = ArgumentParser() 62 | parser.add_argument('inputdir', help='The directory, where input files \ 63 | live in') 64 | parser.add_argument('outputdir', help='The directory, processed files \ 65 | should be placed in') 66 | 67 | args = parser.parse_args() 68 | 69 | if not os.path.exists(args.inputdir): 70 | print("input directory does not exist") 71 | sys.exit(1) 72 | 73 | if not os.path.exists(args.outputdir): 74 | print("output directory does not exist") 75 | sys.exit(1) 76 | 77 | main(args.inputdir, args.outputdir) 78 | -------------------------------------------------------------------------------- /tools/generator/keywordonly.patch: -------------------------------------------------------------------------------- 1 | diff --git a/ressources/python/pytson.py b/ressources/python/pytson.py 2 | index 3eed890..06e0940 100644 3 | --- a/ressources/python/pytson.py 4 | +++ b/ressources/python/pytson.py 5 | @@ -12,7 +12,7 @@ from PythonQt.QtGui import QApplication 6 | _PYTSON_VERSION = "1.2.3" 7 | 8 | 9 | -def tr(context, sourcetext, *, disambiguation="", n=-1): 10 | +def tr(context, sourcetext, disambiguation="", n=-1): 11 | """ 12 | Returns the current translation for a string. This function calls can be 13 | extracted by pyTSon's pylupdate.py. 14 | @@ -38,7 +38,7 @@ class Translatable(object): 15 | Baseclass for a class using translatable string literals. 16 | """ 17 | @classmethod 18 | - def _tr(cls, sourcetext, *, disambiguation="", n=-1, context=None): 19 | + def _tr(cls, sourcetext, disambiguation="", n=-1, context=None): 20 | """ 21 | Returns the current translation for a string. This method calls can be 22 | extracted by pyTSon's pylupdate.py. 23 | diff --git a/ressources/python/pytsonui/__init__.py b/ressources/python/pytsonui/__init__.py 24 | index 28be23d..f1a4c04 100644 25 | --- a/ressources/python/pytsonui/__init__.py 26 | +++ b/ressources/python/pytsonui/__init__.py 27 | @@ -220,7 +220,7 @@ class UiLoader(QUiLoader): 28 | QUILoader subclass to omit the parent widget from being recreated. 29 | """ 30 | 31 | - def __init__(self, main, parent=None, *, extraWidgets=None): 32 | + def __init__(self, main, parent=None, extraWidgets=None): 33 | """ 34 | Instantiate a new object 35 | @param main: parent class which will be omitted 36 | @@ -249,7 +249,7 @@ class UiLoader(QUiLoader): 37 | return QUiLoader.createWidget(self, clsname, parent, name) 38 | 39 | 40 | -def setupUi(obj, uipath, *, widgets=None, seticons=True, iconpack=None, 41 | +def setupUi(obj, uipath, widgets=None, seticons=True, iconpack=None, 42 | pluginicons=None, extraWidgets=None): 43 | """ 44 | Loads a Qt designer file (.ui), creates the widgets defined in and adds 45 | diff --git a/ressources/python/pytsonui/console.py b/ressources/python/pytsonui/console.py 46 | index 580af9f..7402efa 100644 47 | --- a/ressources/python/pytsonui/console.py 48 | +++ b/ressources/python/pytsonui/console.py 49 | @@ -37,7 +37,7 @@ class PythonConsoleDialog(QDialog): 50 | def __init__(self, tabcomplete=True, spaces=True, tabwidth=2, 51 | font=defaultFont(), bgcolor=Qt.black, textcolor=Qt.white, 52 | width=800, height=600, startup="", silentStartup=False, 53 | - parent=None, *, catchstd=False): 54 | + parent=None, catchstd=False): 55 | super(QDialog, self).__init__(parent) 56 | self.setAttribute(Qt.WA_DeleteOnClose) 57 | 58 | @@ -55,7 +55,7 @@ class PythonConsole(QPlainTextEdit, pytson.Translatable): 59 | def __init__(self, tabcomplete=True, spaces=True, tabwidth=2, 60 | font=defaultFont(), bgcolor=Qt.black, textcolor=Qt.white, 61 | startup="", silentStartup=False, 62 | - parent=None, *, catchstd=False, closeAction): 63 | + parent=None, catchstd=False, closeAction): 64 | super(QPlainTextEdit, self).__init__(parent) 65 | 66 | self.setLineWrapMode(QPlainTextEdit.NoWrap) 67 | diff --git a/ressources/python/ts3client.py b/ressources/python/ts3client.py 68 | index 7584e07..c47619e 100644 69 | --- a/ressources/python/ts3client.py 70 | +++ b/ressources/python/ts3client.py 71 | @@ -155,7 +155,7 @@ class IconPack(object): 72 | del cfg 73 | return IconPack(info=q.value(0)) 74 | 75 | - def __init__(self, *, info=None, name=None): 76 | + def __init__(self, info=None, name=None): 77 | """ 78 | Instantiates a new IconPack object referenced by its name or the 79 | internal info string (an Exception is raised if the iconpack could 80 | diff --git a/ressources/python/ts3widgets/filetransfer.py b/ressources/python/ts3widgets/filetransfer.py 81 | index 9addaaa..bc9ec3c 100644 82 | --- a/ressources/python/ts3widgets/filetransfer.py 83 | +++ b/ressources/python/ts3widgets/filetransfer.py 84 | @@ -123,7 +123,7 @@ class FileListModel(QAbstractItemModel, pytson.Translatable): 85 | Itemmodel to abstract the files contained on a TS3 filepath. 86 | """ 87 | 88 | - def __init__(self, schid, cid, password, parent=None, *, readonly=False): 89 | + def __init__(self, schid, cid, password, parent=None, readonly=False): 90 | super(QAbstractItemModel, self).__init__(parent) 91 | 92 | self.schid = schid 93 | @@ -467,7 +467,7 @@ class FileBrowser(QDialog, pytson.Translatable): 94 | Dialog to display files contained on a TS3 filepath. 95 | """ 96 | 97 | - def __init__(self, schid, cid, password='', path='/', parent=None, *, 98 | + def __init__(self, schid, cid, password='', path='/', parent=None, 99 | staticpath=False, readonly=False, downloaddir=None, 100 | iconpack=None): 101 | """ 102 | diff --git a/ressources/python/ts3widgets/serverview.py b/ressources/python/ts3widgets/serverview.py 103 | index 829d6e5..6e5bc50 100644 104 | --- a/ressources/python/ts3widgets/serverview.py 105 | +++ b/ressources/python/ts3widgets/serverview.py 106 | @@ -1391,7 +1391,7 @@ class Serverview(QTreeView): 107 | A QTreeView widget to display the complete view on a TS3 Server. 108 | """ 109 | 110 | - def __init__(self, parent=None, *, schid=None): 111 | + def __init__(self, parent=None, schid=None): 112 | """ 113 | Instantiates a new Serverview widget (including model and delegate). 114 | @param schid: the ID of the serverconnection 115 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008-2016, Eli Bendersky 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of Eli Bendersky nor the names of its contributors may 13 | be used to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 22 | GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 25 | OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/_ansi.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/_fake_defines.h: -------------------------------------------------------------------------------- 1 | #ifndef _FAKE_DEFINES_H 2 | #define _FAKE_DEFINES_H 3 | 4 | #define NULL 0 5 | #define BUFSIZ 1024 6 | #define FOPEN_MAX 20 7 | #define FILENAME_MAX 1024 8 | 9 | #ifndef SEEK_SET 10 | #define SEEK_SET 0 /* set file offset to offset */ 11 | #endif 12 | #ifndef SEEK_CUR 13 | #define SEEK_CUR 1 /* set file offset to current plus offset */ 14 | #endif 15 | #ifndef SEEK_END 16 | #define SEEK_END 2 /* set file offset to EOF plus offset */ 17 | #endif 18 | 19 | #define __LITTLE_ENDIAN 1234 20 | #define LITTLE_ENDIAN __LITTLE_ENDIAN 21 | #define __BIG_ENDIAN 4321 22 | #define BIG_ENDIAN __BIG_ENDIAN 23 | #define __BYTE_ORDER __LITTLE_ENDIAN 24 | #define BYTE_ORDER __BYTE_ORDER 25 | 26 | #define EXIT_FAILURE 1 27 | #define EXIT_SUCCESS 0 28 | 29 | #define UCHAR_MAX 255 30 | #define USHRT_MAX 65535 31 | #define UINT_MAX 4294967295U 32 | #define RAND_MAX 32767 33 | #define INT_MAX 32767 34 | 35 | /* C99 stdbool.h defines */ 36 | #define __bool_true_false_are_defined 1 37 | #define false 0 38 | #define true 1 39 | 40 | /* va_arg macros and type*/ 41 | typedef int va_list; 42 | #define va_start(_ap, _type) __builtin_va_start((_ap)) 43 | #define va_arg(_ap, _type) __builtin_va_arg((_ap)) 44 | #define va_end(_list) 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/_fake_typedefs.h: -------------------------------------------------------------------------------- 1 | #ifndef _FAKE_TYPEDEFS_H 2 | #define _FAKE_TYPEDEFS_H 3 | 4 | typedef int size_t; 5 | typedef int __builtin_va_list; 6 | typedef int __gnuc_va_list; 7 | typedef int __int8_t; 8 | typedef int __uint8_t; 9 | typedef int __int16_t; 10 | typedef int __uint16_t; 11 | typedef int __int_least16_t; 12 | typedef int __uint_least16_t; 13 | typedef int __int32_t; 14 | typedef int __uint32_t; 15 | typedef int __int64_t; 16 | typedef int __uint64_t; 17 | typedef int __int_least32_t; 18 | typedef int __uint_least32_t; 19 | typedef int __s8; 20 | typedef int __u8; 21 | typedef int __s16; 22 | typedef int __u16; 23 | typedef int __s32; 24 | typedef int __u32; 25 | typedef int __s64; 26 | typedef int __u64; 27 | typedef int _LOCK_T; 28 | typedef int _LOCK_RECURSIVE_T; 29 | typedef int _off_t; 30 | typedef int __dev_t; 31 | typedef int __uid_t; 32 | typedef int __gid_t; 33 | typedef int _off64_t; 34 | typedef int _fpos_t; 35 | typedef int _ssize_t; 36 | typedef int wint_t; 37 | typedef int _mbstate_t; 38 | typedef int _flock_t; 39 | typedef int _iconv_t; 40 | typedef int __ULong; 41 | typedef int __FILE; 42 | typedef int ptrdiff_t; 43 | typedef int wchar_t; 44 | typedef int __off_t; 45 | typedef int __pid_t; 46 | typedef int __loff_t; 47 | typedef int u_char; 48 | typedef int u_short; 49 | typedef int u_int; 50 | typedef int u_long; 51 | typedef int ushort; 52 | typedef int uint; 53 | typedef int clock_t; 54 | typedef int time_t; 55 | typedef int daddr_t; 56 | typedef int caddr_t; 57 | typedef int ino_t; 58 | typedef int off_t; 59 | typedef int dev_t; 60 | typedef int uid_t; 61 | typedef int gid_t; 62 | typedef int pid_t; 63 | typedef int key_t; 64 | typedef int ssize_t; 65 | typedef int mode_t; 66 | typedef int nlink_t; 67 | typedef int fd_mask; 68 | typedef int _types_fd_set; 69 | typedef int clockid_t; 70 | typedef int timer_t; 71 | typedef int useconds_t; 72 | typedef int suseconds_t; 73 | typedef int FILE; 74 | typedef int fpos_t; 75 | typedef int cookie_read_function_t; 76 | typedef int cookie_write_function_t; 77 | typedef int cookie_seek_function_t; 78 | typedef int cookie_close_function_t; 79 | typedef int cookie_io_functions_t; 80 | typedef int div_t; 81 | typedef int ldiv_t; 82 | typedef int lldiv_t; 83 | typedef int sigset_t; 84 | typedef int __sigset_t; 85 | typedef int _sig_func_ptr; 86 | typedef int sig_atomic_t; 87 | typedef int __tzrule_type; 88 | typedef int __tzinfo_type; 89 | typedef int mbstate_t; 90 | typedef int sem_t; 91 | typedef int pthread_t; 92 | typedef int pthread_attr_t; 93 | typedef int pthread_mutex_t; 94 | typedef int pthread_mutexattr_t; 95 | typedef int pthread_cond_t; 96 | typedef int pthread_condattr_t; 97 | typedef int pthread_key_t; 98 | typedef int pthread_once_t; 99 | typedef int pthread_rwlock_t; 100 | typedef int pthread_rwlockattr_t; 101 | typedef int pthread_spinlock_t; 102 | typedef int pthread_barrier_t; 103 | typedef int pthread_barrierattr_t; 104 | typedef int jmp_buf; 105 | typedef int rlim_t; 106 | typedef int sa_family_t; 107 | typedef int sigjmp_buf; 108 | typedef int stack_t; 109 | typedef int siginfo_t; 110 | typedef int z_stream; 111 | 112 | /* C99 exact-width integer types */ 113 | typedef int int8_t; 114 | typedef int uint8_t; 115 | typedef int int16_t; 116 | typedef int uint16_t; 117 | typedef int int32_t; 118 | typedef int uint32_t; 119 | typedef int int64_t; 120 | typedef int uint64_t; 121 | 122 | /* C99 minimum-width integer types */ 123 | typedef int int_least8_t; 124 | typedef int uint_least8_t; 125 | typedef int int_least16_t; 126 | typedef int uint_least16_t; 127 | typedef int int_least32_t; 128 | typedef int uint_least32_t; 129 | typedef int int_least64_t; 130 | typedef int uint_least64_t; 131 | 132 | /* C99 fastest minimum-width integer types */ 133 | typedef int int_fast8_t; 134 | typedef int uint_fast8_t; 135 | typedef int int_fast16_t; 136 | typedef int uint_fast16_t; 137 | typedef int int_fast32_t; 138 | typedef int uint_fast32_t; 139 | typedef int int_fast64_t; 140 | typedef int uint_fast64_t; 141 | 142 | /* C99 integer types capable of holding object pointers */ 143 | typedef int intptr_t; 144 | typedef int uintptr_t; 145 | 146 | /* C99 greatest-width integer types */ 147 | typedef int intmax_t; 148 | typedef int uintmax_t; 149 | 150 | /* C99 stdbool.h bool type. _Bool is built-in in C99 */ 151 | typedef _Bool bool; 152 | 153 | typedef int va_list; 154 | 155 | #endif 156 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/_syslist.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/alloca.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/ar.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/argz.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/arpa/inet.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/asm-generic/int-ll64.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/assert.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/complex.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/ctype.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/dirent.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/dlfcn.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/endian.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/envz.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/errno.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/fastmath.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/fcntl.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/features.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/fenv.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/float.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/getopt.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/grp.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/iconv.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/ieeefp.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/inttypes.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/iso646.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/langinfo.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/libgen.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/libintl.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/limits.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/linux/socket.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/linux/version.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/locale.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/malloc.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/math.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/netdb.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/netinet/in.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/netinet/tcp.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/newlib.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/openssl/err.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/openssl/evp.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/openssl/hmac.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/openssl/ssl.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/openssl/x509v3.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/paths.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/process.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/pthread.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/pwd.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/reent.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/regdef.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/regex.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/sched.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/search.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/semaphore.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/setjmp.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/signal.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/stdarg.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/stdbool.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/stddef.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/stdint.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/stdio.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/stdlib.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/string.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/sys/ioctl.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/sys/mman.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/sys/poll.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/sys/resource.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/sys/select.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/sys/socket.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/sys/stat.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/sys/sysctl.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/sys/time.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/sys/types.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/sys/uio.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/sys/un.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/sys/utsname.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/sys/wait.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/syslog.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/tar.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/termios.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/tgmath.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/time.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/unctrl.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/unistd.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/utime.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/utmp.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/wchar.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/wctype.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_libc_include/zlib.h: -------------------------------------------------------------------------------- 1 | #include "_fake_defines.h" 2 | #include "_fake_typedefs.h" 3 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_pyTSon/Python.h: -------------------------------------------------------------------------------- 1 | typedef int PyObject; 2 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_pyTSon/PythonQtInstanceWrapper.h: -------------------------------------------------------------------------------- 1 | #ifndef PYTHONQTINSTANCEWRAPPER__H_ 2 | #define PYTHONQTINSTANCEWRAPPER__H_ 3 | 4 | typedef int PythonQtInstanceWrapper; 5 | 6 | #endif 7 | 8 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_pyTSon/QObject: -------------------------------------------------------------------------------- 1 | #ifndef QOBJECT__H_ 2 | #define QOBJECT__H_ 3 | 4 | #endif 5 | 6 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_pyTSon/QString: -------------------------------------------------------------------------------- 1 | #ifndef QSTRING__H_ 2 | #define QSTRING__H_ 3 | 4 | typedef int QString; 5 | 6 | #endif 7 | 8 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_pyTSon/global_shared.h: -------------------------------------------------------------------------------- 1 | #ifndef GLOBAL_SHARED__H_ 2 | #define GLOBAL_SHARED__H_ 3 | 4 | #endif 5 | 6 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_pyTSon/pyconversion.h: -------------------------------------------------------------------------------- 1 | #ifndef PYCONVERSION_H__ 2 | #define PYCONVERSION_H__ 3 | 4 | #endif 5 | 6 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_pyTSon/pythonhost.h: -------------------------------------------------------------------------------- 1 | #ifndef PYTHONHOST__H_ 2 | #define PYTHONHOST__H_ 3 | 4 | 5 | #endif 6 | 7 | -------------------------------------------------------------------------------- /tools/generator/pytson/fake_pyTSon/ts3logdispatcher.h: -------------------------------------------------------------------------------- 1 | #ifndef TS3LOGDISPATCHER__H_ 2 | #define TS3LOGDISPATCHER__H_ 3 | 4 | 5 | #endif 6 | 7 | -------------------------------------------------------------------------------- /tools/generator/pytson/parsing.py: -------------------------------------------------------------------------------- 1 | import os 2 | import logging 3 | 4 | from pycparser import parse_file, c_ast, c_generator 5 | from .wrappers import FunctionWrapper, CallbackWrapper 6 | 7 | 8 | def maximumPrefix(str1, str2): 9 | if len(str1) < len(str2): 10 | return maximumPrefix(str2, str1) 11 | 12 | for i, c in enumerate(str1): 13 | if c != str2[i]: 14 | return str1[:i] 15 | 16 | return str1 17 | 18 | 19 | class ts3Visitor(c_ast.NodeVisitor): 20 | """ 21 | 22 | """ 23 | def __init__(self): 24 | self.enums = {} 25 | self.constants = {} 26 | self.callbacks = {} 27 | self.functions = {} 28 | self.curpar = None 29 | 30 | def findEnumValue(self, name): 31 | """ 32 | 33 | :param name: 34 | :return: 35 | """ 36 | for enumname in self.enums: 37 | for (ename, val) in self.enums[enumname]: 38 | if ename == name: 39 | return val 40 | 41 | return None 42 | 43 | def getEnumValue(self, cvalue, siblings): 44 | """ 45 | 46 | :param cvalue: 47 | :param siblings: 48 | :return: 49 | """ 50 | if cvalue: 51 | if type(cvalue) is c_ast.Constant: 52 | return cvalue.value 53 | elif type(cvalue) is c_ast.ID: 54 | val = self.findEnumValue(cvalue.name) 55 | if val is not None: 56 | return val 57 | else: 58 | logging.warning("Could not evaluate ENUM %s" % cvalue.name) 59 | return cvalue.name 60 | else: 61 | return c_generator.CGenerator().visit(cvalue) 62 | else: 63 | if len(siblings) == 0: 64 | return 0 65 | else: 66 | try: 67 | return eval("%s +1" % siblings[-1][1]) 68 | except NameError: 69 | return "%s +1" % siblings[-1][1] 70 | 71 | def visit_Enum(self, node): 72 | """ 73 | 74 | :param node: 75 | :return: 76 | """ 77 | if type(self.curpar) is c_ast.Decl: 78 | name = node.name 79 | 80 | if name in self.enums: 81 | return 82 | 83 | if node.values: 84 | vals = [] 85 | for i, enumerator in enumerate(node.values.enumerators): 86 | vals.append((enumerator.name, self.getEnumValue(enumerator.value, vals))) 87 | 88 | if name is None: 89 | if len(vals) >= 2: 90 | name = maximumPrefix(vals[0][0], vals[1][0]) 91 | 92 | if name == '' or len(vals) == 1: 93 | name = vals[0][0] + "_ENUM" 94 | else: 95 | if name.endswith("_"): 96 | name = name[:-1] 97 | 98 | self.enums[name] = vals 99 | 100 | def visit_Constant(self, node): 101 | """ 102 | 103 | :param node: 104 | :return: 105 | """ 106 | if type(self.curpar) is c_ast.Decl: 107 | self.constants[self.curpar.name] = node.value 108 | 109 | def visit_FuncDecl(self, node): 110 | """ 111 | 112 | :param node: 113 | :return: 114 | """ 115 | t = node.type 116 | while (type(t) == c_ast.PtrDecl): 117 | t = t.type 118 | 119 | #we don't want the declarations of callbacks from plugin.h here 120 | if not t.declname.startswith('ts3plugin_'): 121 | self.functions[t.declname] = FunctionWrapper(ts3decl=node) 122 | 123 | def visit_FuncDef(self, node): 124 | name = node.decl.name 125 | if name.startswith('ts3plugin_'): 126 | self.callbacks[name[10:]] = CallbackWrapper(decl=node, original=True) 127 | 128 | def generic_visit(self, node): 129 | """ 130 | 131 | :param node: 132 | :return: 133 | """ 134 | oldpar = self.curpar 135 | self.curpar = node 136 | super(ts3Visitor, self).generic_visit(node) 137 | self.curpar = oldpar 138 | 139 | 140 | class pyTSonVisitor(c_ast.NodeVisitor): 141 | """ 142 | 143 | """ 144 | def __init__(self, targets=[]): 145 | self.constants = {} 146 | self.enums = {} 147 | self.functions = {} 148 | self.callbacks = {} 149 | 150 | def visit_FuncDef(self, node): 151 | """ 152 | 153 | :param node: 154 | :return: 155 | """ 156 | name = node.decl.name 157 | if name.startswith('ts3plugin_'): 158 | #load callback 159 | self.callbacks[name[10:]] = CallbackWrapper(decl=node, original=False) 160 | else: 161 | #load function 162 | if name not in self.callbacks: 163 | self.functions[name] = FunctionWrapper(pytsondecl=node.decl) 164 | 165 | 166 | def loadSymbols(filename, cppargs = []): 167 | """ 168 | 169 | :param filename: 170 | :param cppargs: 171 | :return: 172 | """ 173 | return parse_file(filename, use_cpp=True, cpp_args=cppargs) 174 | 175 | 176 | def getSymbols(fpath, incldirs, original=True): 177 | """ 178 | 179 | :param fpath: 180 | :param incldir: 181 | :param original 182 | :return: 183 | """ 184 | visitor = ts3Visitor() if original else pyTSonVisitor() 185 | 186 | cppargs = [r'-DPYTSON_PARSER', r'-D__attribute__(a)=', r'-I%s' % os.path.join(os.path.abspath(os.path.dirname(__file__)), "fake_libc_include"), r'-I%s' % os.path.join(os.path.abspath(os.path.dirname(__file__)), "fake_pyTSon")] + [r'-I%s' % p for p in incldirs] 187 | symbs = loadSymbols(fpath, cppargs) 188 | 189 | visitor.visit(symbs) 190 | 191 | return visitor.constants, visitor.enums, visitor.callbacks, visitor.functions -------------------------------------------------------------------------------- /tools/generator/pytson/wrappers.py: -------------------------------------------------------------------------------- 1 | from pycparser import c_generator, c_ast 2 | 3 | cgen = c_generator.CGenerator() 4 | 5 | FILESTORAGE = {} 6 | 7 | 8 | def closeFiles(): 9 | global FILESTORAGE 10 | FILESTORAGE = {} 11 | 12 | 13 | class FunctionWrapper(object): 14 | """ 15 | 16 | """ 17 | def __init__(self, ts3decl=None, pytsondecl=None): 18 | """ 19 | 20 | :param ts3decl: 21 | :param pytsondecl: 22 | """ 23 | if not ts3decl and not pytsondecl: 24 | raise Exception("No declaration given") 25 | 26 | self.ts3decl = ts3decl 27 | self.pytsondecl = pytsondecl 28 | self.bodylines = [] 29 | 30 | #if we generate from previous code, extract the body 31 | #to work, developers have to use correct indentation! (function-closing line must be "}" without any leading spaces) 32 | if self.pytsondecl: 33 | fname = self.pytsondecl.coord.file 34 | if not fname in FILESTORAGE: 35 | with open(fname, "r") as f: 36 | FILESTORAGE[fname] = f.read().split('\n') 37 | 38 | cur = self.pytsondecl.coord.line 39 | abort = False 40 | while not abort: 41 | if FILESTORAGE[fname][cur].rstrip() == "}": 42 | abort = True 43 | else: 44 | self.bodylines.append(FILESTORAGE[fname][cur]) 45 | cur += 1 46 | 47 | @property 48 | def name(self): 49 | if self.ts3decl: 50 | return self.ts3decl.type.declname 51 | else: 52 | return self.pytsondecl.name 53 | 54 | @property 55 | def signature(self): 56 | if self.ts3decl: 57 | return cgen.visit(self.ts3decl) 58 | else: 59 | if len(self.bodylines) == 0: 60 | return "" 61 | 62 | sig = self.bodylines[0].strip() 63 | if not sig.startswith("//"): 64 | return "" 65 | else: 66 | return sig[2:] 67 | 68 | @property 69 | def parameterNames(self): 70 | if self.ts3decl: 71 | if not self.ts3decl.args: 72 | return [] 73 | 74 | return [p.name for p in self.ts3decl.args.params] 75 | else: 76 | return [p.arg for p in self.pydecl.args.args] 77 | 78 | @property 79 | def body(self): 80 | if self.ts3decl: 81 | return "" 82 | else: 83 | return '\n'.join(self.bodylines) 84 | 85 | @property 86 | def docString(self): 87 | if self.ts3decl: 88 | return "" 89 | else: 90 | ret = "" 91 | indocs = False 92 | for l in self.bodylines: 93 | if l.strip() == "\"\"\"": 94 | indocs = not indocs 95 | elif indocs: 96 | ret += "%s\\n" % l.strip() 97 | 98 | return ret 99 | 100 | 101 | class CallbackWrapper(object): 102 | """ 103 | 104 | """ 105 | def __init__(self, decl, original=True): 106 | """ 107 | 108 | :param decl: 109 | :param original: 110 | """ 111 | self.decl = decl 112 | self.original = original 113 | self.bodylines = [] 114 | 115 | # if we generate from previous code, extract the body 116 | # to work, developers have to use correct indentation! (function-closing line must be "}" without any leading spaces) 117 | if not self.original: 118 | fname = self.decl.coord.file 119 | if not fname in FILESTORAGE: 120 | with open(fname, "r") as f: 121 | FILESTORAGE[fname] = f.read().split('\n') 122 | 123 | cur = self.decl.coord.line 124 | abort = False 125 | while not abort: 126 | if FILESTORAGE[fname][cur].rstrip() == "}": 127 | abort = True 128 | else: 129 | self.bodylines.append(FILESTORAGE[fname][cur]) 130 | cur += 1 131 | 132 | @staticmethod 133 | def parameterType(param): 134 | if type(param.type) is c_ast.PtrDecl: 135 | return "*" + CallbackWrapper.parameterType(param.type) 136 | elif type(param.type.type) is c_ast.Enum: 137 | return "enum" 138 | else: 139 | return " ".join(param.type.type.names) 140 | 141 | @staticmethod 142 | def convertParameter(t): 143 | if t == "uint64": 144 | return "(unsigned long long)" 145 | elif t == "anyID": 146 | return "(unsigned int)" 147 | elif t == "enum": 148 | return "(unsigned int)" 149 | else: 150 | return "" 151 | 152 | @staticmethod 153 | def formatChar(param): 154 | t = CallbackWrapper.parameterType(param) 155 | 156 | if t == "uint64": 157 | return "K" 158 | elif t == "anyID" or t == "unsigned int": 159 | return "I" 160 | elif t == "*char": 161 | return "s" 162 | elif t == "int": 163 | return "i" 164 | elif t == "float": 165 | return "f" 166 | elif t == "char": 167 | return "c" 168 | elif t == "short": 169 | return "h" 170 | elif t == "enum": 171 | return "I" 172 | else: 173 | raise Exception("Unrecognized parametertype in formatChar: %s" % t) 174 | 175 | return "" 176 | 177 | @property 178 | def name(self): 179 | return self.decl.decl.name 180 | 181 | @property 182 | def signature(self): 183 | return cgen.visit(self.decl.decl) 184 | 185 | @property 186 | def convertedParameters(self): 187 | if not self.decl.decl.type.args: 188 | return [] 189 | 190 | return ["%s %s" % (self.convertParameter(self.parameterType(p)), p.name) for p in self.decl.decl.type.args.params] 191 | 192 | 193 | @property 194 | def parameterNames(self): 195 | if not self.decl.decl.type.args: 196 | return [] 197 | 198 | return [p.name if p.name != "type" else "atype" for p in self.decl.decl.type.args.params] 199 | 200 | @property 201 | def formatString(self): 202 | if not self.decl.decl.type.args: 203 | return "" 204 | 205 | ret = "" 206 | for p in self.decl.decl.type.args.params: 207 | ret += self.formatChar(p) 208 | 209 | return ret 210 | 211 | @property 212 | def body(self): 213 | if self.original: 214 | return "" 215 | else: 216 | return '\n'.join(self.bodylines) 217 | 218 | @property 219 | def docString(self): 220 | if self.original: 221 | return "" 222 | else: 223 | ret = "" 224 | indocs = False 225 | for l in self.bodylines: 226 | if l.strip() == "\"\"\"": 227 | indocs = not indocs 228 | indocs = True 229 | elif indocs: 230 | ret += "%s\\n" % l.strip() 231 | 232 | return ret 233 | --------------------------------------------------------------------------------