Package x2go :: Package backends :: Package terminal :: Module _stdout :: Class X2goTerminalSessionSTDOUT
[frames] | no frames]

Class X2goTerminalSessionSTDOUT

source code

object --+
         |
        X2goTerminalSessionSTDOUT

Class for managing X2go sessions on a remote X2go server via Paramiko/SSH. With the X2goTerminalSessionSTDOUT class you can start new X2go sessions, resume suspended sessions or suspend resp. terminate currently running sessions on a connected X2go server.

When suspending or terminating sessions there are two possible ways:

  1. Initialize an X2go session object, start a new session (or resume) and use the X2goTerminalSessionSTDOUT.suspend() or X2goTerminalSessionSTDOUT.terminate() method to suspend/terminate the current session object.
  2. Alternatively, you can pass a session name to X2goTerminalSessionSTDOUT.suspend() or X2goTerminalSessionSTDOUT.terminate(). If a session of this name exists on the X2go server the respective action will be performed on the session.

An X2goTerminalSessionSTDOUT object uses two main data structure classes:

Instance Methods
 
__init__(self, control_session, session_info=None, geometry='800x600', depth=24, link='adsl', pack='16m-jpeg-9', cache_type='unix-kde', keyboard='', kblayout='null', kbtype='null/null', session_type='application', snd_system='pulse', snd_port=4713, cmd=None, rdp_server=None, rdp_options=None, xdmcp_server=None, convert_encoding=False, server_encoding='UTF-8', client_encoding='UTF-8', rootdir=None, profile_name='UNKNOWN', profile_id='20110709210707029168', print_action=None, print_action_args={}, info_backend=<class 'x2go.backends.info._stdout.X2goServerSessionInfoSTDOUT'>, list_backend=<class 'x2go.backends.info._stdout.X2goServerSessionListSTDOUT'>, proxy_backend=<class 'x2go.backends.proxy._nx3.X2goProxyNX3'>, proxy_options={}, printing_backend=<class 'x2go.backends.printing._file.X2goClientPrintingFILE'>, client_rootdir='/home/buildd/.x2goclient', sessions_rootdir='/home/buildd/.x2go', session_instance=None, logger=None, loglevel=56)
Initialize an X2go session.
source code
 
__del__(self) source code
 
get_session_name(self)
STILL UNDOCUMENTED
source code
 
start_sound(self)
Initialize Paramiko/SSH reverse forwarding tunnel for X2go sound.
source code
 
start_sshfs(self)
Initialize Paramiko/SSH reverse forwarding tunnel for X2go folder sharing.
source code
 
stop_sound(self)
Shutdown (pause) Paramiko/SSH reverse forwarding tunnel for X2go sound.
source code
 
stop_sshfs(self)
Shutdown (pause) Paramiko/SSH reverse forwarding tunnel for X2go folder sharing.
source code
 
start_printing(self)
Initialize X2go print spooling.
source code
 
set_print_action(self, print_action, **kwargs)
STILL UNDOCUMENTED
source code
 
stop_printing(self)
Shutdown (pause) the X2go Print Queue thread.
source code
 
get_printing_spooldir(self)
Return the server-side printing spooldir path.
source code
 
start_mimebox(self, mimebox_extensions=[], mimebox_action=None)
Initialize X2go mimebox handling.
source code
 
set_mimebox_action(self, mimebox_action, **kwargs)
STILL UNDOCUMENTED
source code
 
stop_mimebox(self)
Shutdown (pause) the X2go MIME box Queue thread.
source code
 
get_mimebox_spooldir(self)
Return the server-side mimebox spooldir path.
source code
bool
share_local_folder(self, folder_name=None, folder_type='disk')
Share a local folder with the X2go session.
source code
int
color_depth(self)
Retrieve the session's color depth.
source code
 
has_command(self, cmd)
Verify if the command <cmd> exists on the X2go server.
source code
tuple of str
run_command(self, cmd=None, env={})
Run a command in this session.
source code
bool
ok(self)
Returns True if this X2go session is up and running, False else
source code
bool
is_running(self)
Returns True if this X2go session is in running state, False else.
source code
bool
is_suspended(self)
Returns True if this X2go session is in suspended state, False else.
source code
bool
is_connected(self)
Returns True if this X2go session's Paramiko/SSH transport is connected/authenticated, False else.
source code
 
start(self)
Start a new X2go session.
source code
bool
resume(self)
Resume a running/suspended X2go session.
source code
bool
suspend(self)
Suspend this X2go session terminal.
source code
bool
terminate(self)
Terminate this X2go session.
source code
 
release_proxy(self)
STILL UNDOCUMENTED
source code

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

Properties

Inherited from object: __class__

Method Details

__init__(self, control_session, session_info=None, geometry='800x600', depth=24, link='adsl', pack='16m-jpeg-9', cache_type='unix-kde', keyboard='', kblayout='null', kbtype='null/null', session_type='application', snd_system='pulse', snd_port=4713, cmd=None, rdp_server=None, rdp_options=None, xdmcp_server=None, convert_encoding=False, server_encoding='UTF-8', client_encoding='UTF-8', rootdir=None, profile_name='UNKNOWN', profile_id='20110709210707029168', print_action=None, print_action_args={}, info_backend=<class 'x2go.backends.info._stdout.X2goServerSessionInfoSTDOUT'>, list_backend=<class 'x2go.backends.info._stdout.X2goServerSessionListSTDOUT'>, proxy_backend=<class 'x2go.backends.proxy._nx3.X2goProxyNX3'>, proxy_options={}, printing_backend=<class 'x2go.backends.printing._file.X2goClientPrintingFILE'>, client_rootdir='/home/buildd/.x2goclient', sessions_rootdir='/home/buildd/.x2go', session_instance=None, logger=None, loglevel=56)
(Constructor)

source code 

Initialize an X2go session. With the X2goTerminalSessionSTDOUT class you can start new X2go sessions, resume suspended sessions or suspend resp. terminate currently running sessions on a connected X2go server.

Parameters:
  • geometry (str) - screen geometry of the X2go session. Can be either <width>x<height> or fullscreen
  • depth (int) - color depth in bits (common values: 16, 24)
  • link (str) - network link quality (either one of modem, isdn, adsl, wan or lan)
  • pack (str) - compression method for NX based session proxying
  • cache_type (str) - a dummy parameter that is passed to the X2goProxyBASE. In NX Proxy (class X2goProxyNX3) this originally is the session name. With X2go it defines the name of the NX cache directory. Best is to leave it untouched.
  • kblayout (str) - keyboard layout, e.g. us (default), de, fr, ...
  • kbtype (str) - keyboard type, e.g. pc105/us (default), pc105/de, ...
  • session_type (str) - either desktop, application (rootless session) or shared
  • snd_system (str) - sound system to be used on server (none, pulse (default), arts (obsolete) or esd)
  • cmd (str) - command to be run on X2go server after session start (only used when X2goTerminalSessionSTDOUT.start() is called, ignored on resume, suspend etc.
  • rootdir (str) - X2go session directory, normally ~/.x2go
  • info_backend (X2goServerSessionInfo* instance) - backend for handling storage of server session information
  • list_backend (X2goServerSessionList* instance) - backend for handling storage of session list information
  • proxy_backend (X2goProxy* instance) - backend for handling the X-proxy connections
  • print_action (str or class) - either a print action short name (PDFVIEW, PDFSAVE, PRINT, PRINTCMD) or the resp. X2goPrintActionXXX class (where XXX equals one of the given short names)
  • print_action_args (dict) - optional arguments for a given print_action (for further info refer to X2goPrintActionPDFVIEW, X2goPrintActionPDFSAVE, X2goPrintActionPRINT and X2goPrintActionPRINTCMD)
  • proxy_options (dict) - a set of very X2goProxy* backend specific options; any option that is not known to the X2goProxy* backend will simply be ignored
  • logger (X2goLogger instance) - you can pass an X2goLogger object to the X2goTerminalSessionSTDOUT constructor
  • loglevel (int) - if no X2goLogger object has been supplied a new one will be constructed with the given loglevel
Overrides: object.__init__

start_sound(self)

source code 

Initialize Paramiko/SSH reverse forwarding tunnel for X2go sound.

Currently supported audio protocols:

  • PulseAudio
  • Esound

share_local_folder(self, folder_name=None, folder_type='disk')

source code 

Share a local folder with the X2go session.

Parameters:
  • folder_name (str) - the full path to an existing folder on the local file system
  • folder_type (str) - one of 'disk' (a folder on your local hard drive), 'rm' (removeable device), 'cdrom' (CD/DVD Rom) or 'spool' (for X2go print spooling)
Returns: bool
returns True if the local folder has been successfully mounted within the X2go server session

color_depth(self)

source code 

Retrieve the session's color depth.

Returns: int
the session's color depth

run_command(self, cmd=None, env={})

source code 

Run a command in this session.

After X2goTerminalSessionSTDOUT.start() has been called one or more commands can be executed with X2goTerminalSessionSTDOUT.run_command() within the current X2go session.

Parameters:
  • cmd (str) - Command to be run
Returns: tuple of str
stdout.read() and stderr.read() as returned by the run command on the X2go server

ok(self)

source code 

Returns True if this X2go session is up and running, False else

Returns: bool
X2go session OK?

is_running(self)

source code 

Returns True if this X2go session is in running state, False else.

Returns: bool
X2go session running?

is_suspended(self)

source code 

Returns True if this X2go session is in suspended state, False else.

Returns: bool
X2go session suspended?

is_connected(self)

source code 

Returns True if this X2go session's Paramiko/SSH transport is connected/authenticated, False else.

Returns: bool
X2go session connected?

start(self)

source code 

Start a new X2go session.

The X2goTerminalSession.start() method accepts any parameter that can be passed to the class constructor.

resume(self)

source code 

Resume a running/suspended X2go session.

The X2goTerminalSessionSTDOUT.resume() method accepts any parameter that can be passed to the class constructor.

Returns: bool
True if the session could be successfully resumed

suspend(self)

source code 

Suspend this X2go session terminal.

Returns: bool
True if the session terminal could be successfully suspended

terminate(self)

source code 

Terminate this X2go session.

Returns: bool
True if the session terminal could be successfully terminate