Package x2go :: Module telekinesis :: Class X2GoTelekinesisClient

[frames] | no frames]

# Class X2GoTelekinesisClient

source code

            object --+
                     |
    threading._Verbose --+
                         |
          threading.Thread --+
                             |
                            X2GoTelekinesisClient

Telekinesis is a communication framework used by X2Go.

This class implements the startup of the telekinesis client used by Python X2Go.

Instance Methods

__init__(self, session_info=None, ssh_transport=None, sessions_rootdir=`'``/sbuild-nonexistent/.x2go``'`, session_instance=None, logger=None, loglevel=56) This constructor should always be called with keyword arguments. | source code

__del__(self) On instance destruction make sure this telekinesis client thread is stopped properly. | source code

`bool`

has_telekinesis_client(self) Test if the Telekinesis client command is installed on this machine. | source code

stop_thread(self) End the thread runner and tidy up. | source code

run(self) Start the X2Go Telekinesis client command. | source code

`obj`

start_telekinesis(self) Start the thread runner and wait for the Telekinesis client to come up. | source code

ok(self) Check if a proxy instance is up and running. | source code

Inherited from `threading.Thread`: `__repr__`, `getName`, `isAlive`, `isDaemon`, `is_alive`, `join`, `setDaemon`, `setName`, `start` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Variables
| TEKICLIENT_CMD = ``'``telekinesis-client``'`` Telekinesis client command.
| TEKICLIENT_ARGS = ``[``'``-setWORMHOLEPORT={port}``'``,` `'``-setX2GOSID={si``...`` Arguments to be passed to the Telekinesis client.
| TEKICLIENT_ENV = ``{``}`` Provide environment variables to the Telekinesis client command.

Properties
Inherited from `threading.Thread`: `daemon`, `ident`, `name` Inherited from `object`: `__class__`

Method Details

### __init__(self, session_info=None, ssh_transport=None, sessions_rootdir=`'``/sbuild-nonexistent/.x2go``'`, session_instance=None, logger=None, loglevel=56)
(Constructor)

source code

This constructor should always be called with keyword arguments. Arguments are:

*group* should be None; reserved for future extension when a ThreadGroup class is implemented.

*target* is the callable object to be invoked by the run() method. Defaults to None, meaning nothing is called.

*name* is the thread name. By default, a unique name is constructed of the form "Thread-N" where N is a small decimal number.

*args* is the argument tuple for the target invocation. Defaults to ().

*kwargs* is a dictionary of keyword arguments for the target invocation. Defaults to {}.

If a subclass overrides the constructor, it must make sure to invoke the base class constructor (Thread.__init__()) before doing anything else to the thread.

Parameters:
  - `session_info` (`X2GoServerSessionInfo*` instance) - session information provided as an `X2GoServerSessionInfo*` backend instance
  - `ssh_transport` (`paramiko.Transport` instance) - SSH transport object from `paramiko.SSHClient`
  - `sessions_rootdir` (`str`) - base dir where X2Go session files are stored (by default: ~/.x2go)
  - `logger` (X2GoLogger instance) - you can pass an X2GoLogger object to the X2GoTelekinesisClient constructor
  - `session_instance` (X2GoSession instance) - the X2GoSession instance this `X2GoProxy*` instance belongs to
  - `loglevel` (int) - if no X2GoLogger object has been supplied a new one will be constructed with the given loglevel
Overrides: object.__init__

### has_telekinesis_client(self)

source code

Test if the Telekinesis client command is installed on this machine.

Returns: `bool`
  `True` if the Telekinesis client command is available

### run(self)

source code

Start the X2Go Telekinesis client command. The Telekinesis client command utilizes a Paramiko/SSH based forwarding tunnel (openssh -L option). This tunnel gets started here and is forked into background (Greenlet/gevent).

Overrides: threading.Thread.run

### start_telekinesis(self)

source code

Start the thread runner and wait for the Telekinesis client to come up.

Returns: `obj`
  a subprocess instance that knows about the externally started Telekinesis client command.

### ok(self)

source code

Check if a proxy instance is up and running.

Returns:
  Proxy state, `True` for proxy being up-and-running, `False` otherwise @rtype `bool`

Class Variable Details

### TEKICLIENT_CMD

Telekinesis client command. Might be OS specific.

Value:

      'telekinesis-client'

### TEKICLIENT_ARGS

Arguments to be passed to the Telekinesis client.

Value:

      ['-setWORMHOLEPORT={port}', '-setX2GOSID={sid}']