Module devtools :: Class PluginInstaller
[hide private]
[frames] | no frames]

Class PluginInstaller

source code

object --+
         |
        PluginInstaller

Class used to install new python plugins and its dependencies.

Instance Methods [hide private]
 
__init__(self, stdout=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
_print(self, msg) source code
 
installPlugin(self, addon, data)
Installs a new plugin into the scripts directory.
source code
bool
installPackages(self, deps)
Installs packages from pypi.python.org into the include directory.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
str
_escapeString(name)
Replaces all occurences of non-ascii characters with '_'
source code
str
createPlugin(name, withfile=True, content=None)
Creates the infrastructure for a new plugin.
source code
 
removePlugin(name)
Uninstall a plugin (delete all data in scripts directory).
source code
 
_extractAddon(path, pkgzip, prefix) source code
Class Variables [hide private]
  PLUGIN_SKELETON = ...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, stdout=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • stdout (callable) - A callable used as print function (takes str argument); defaults to None; if None stdout is used instead
Overrides: object.__init__

_escapeString(name)
Static Method

source code 

Replaces all occurences of non-ascii characters with '_'

Parameters:
  • name (str) - the unescaped string
Returns: str
The escaped string

createPlugin(name, withfile=True, content=None)
Static Method

source code 

Creates the infrastructure for a new plugin.

Parameters:
  • name (str) - the name of the plugin
  • withfile (bool) - if True, the file __init__.py is created in the plugin directory, defaults to True
  • content (str) - content of __ini__.py; defaults to None; if None, an empty plugin skeleton is written to the file (if withfile is True)
Returns: str
the path to the __init__.py of the new created plugin

removePlugin(name)
Static Method

source code 

Uninstall a plugin (delete all data in scripts directory).

Parameters:
  • name (str) - the name of the plugin

installPlugin(self, addon, data)

source code 

Installs a new plugin into the scripts directory.

Parameters:
  • addon (dict) - json dict containing the plugin information
  • data (str or file-like) - either the content of a single python file as string or a file-like-object to a zipfile which will be extracted

installPackages(self, deps)

source code 

Installs packages from pypi.python.org into the include directory.

Parameters:
  • deps (list[str]) - A list of package names
Returns: bool
True on success, False otherwise

Class Variable Details [hide private]

PLUGIN_SKELETON

Value:
"""
from ts3plugin import ts3plugin

class %s(ts3plugin):
    name = "%s"
    apiVersion = 21
    version = "1.0.0"
    author = ""
...