Module pytson
[hide private]
[frames] | no frames]

Module pytson

source code

Classes [hide private]
  Translatable
Baseclass for a class using translatable string literals.
Functions [hide private]
 
tr(context, sourcetext, disambiguation="", n=-1)
Returns the current translation for a string.
source code
Generator[str]
locales()
Generator function to return all locale codes available for translation in format language_country (see ISO 639 and ISO 3166)
source code
str
getConfigPath(*args)
Returns pyTSon's configpath, that is, the subdirectory 'pyTSon' in the TeamSpeak 3 config directory.
source code
str
getPluginPath(*args)
Returns pyTSon's pluginpath, that is, the subdirectory 'pyTSon' in the TeamSpeak 3 plugins directory.
source code
 
_setup()
Sets up pyTSon's infrastructure.
source code
str
platformstr()
Returns the platform pyTSon is currently running on.
source code
str
getVersion()
Returns the current version of pyTSon.
source code
str
getCurrentApiVersion()
Returns the current apiversion of the ts3 plugin sdk.
source code
Variables [hide private]
  _PYTSON_VERSION = "1.2.2"
Function Details [hide private]

tr(context, sourcetext, disambiguation="", n=-1)

source code 

Returns the current translation for a string. This function calls can be extracted by pyTSon's pylupdate.py.

Parameters:
  • context (str) - context of the string literal, must be a raw string, not the return value of another function, an attribute or such
  • sourcetext (str) - translatable string, must be a raw string, not the return value of another function, an attribute or such
  • disambiguation (str) - used to distinguish between two equal sourcetexts int the same context, or as comment, optional, defaults to an empty string, must be a raw string, not the return value of another function, an attribute or such
  • n (int) - used for strings containing plurals, optional, defaults to -1

locales()

source code 

Generator function to return all locale codes available for translation in format language_country (see ISO 639 and ISO 3166)

Returns: Generator[str]
Generator function to return the language codes

getConfigPath(*args)

source code 

Returns pyTSon's configpath, that is, the subdirectory 'pyTSon' in the TeamSpeak 3 config directory.

Parameters:
  • args (list[str]) - path fields joined to the result as list of strings
Returns: str
The accumulated path

getPluginPath(*args)

source code 

Returns pyTSon's pluginpath, that is, the subdirectory 'pyTSon' in the TeamSpeak 3 plugins directory.

Parameters:
  • args (list[str]) - path fields joined to the result as list of strings
Returns: str
The accumulated path

platformstr()

source code 

Returns the platform pyTSon is currently running on.

Returns: str
the platform (and architecture) string

getVersion()

source code 

Returns the current version of pyTSon.

Returns: str
the version as string

getCurrentApiVersion()

source code 

Returns the current apiversion of the ts3 plugin sdk. This should not be used in ts3plugin.apiVersion. Be fair and update your plugin manually!

Returns: str
the apiVersion