Package x2go :: Module xserver :: Class X2GoClientXConfig
[frames] | no frames]

Class X2GoClientXConfig

source code

          object --+    
                   |    
inifiles.X2GoIniFile --+
                       |
                      X2GoClientXConfig

Configuration file based XServer startup settings for X2GoClient instances.

This class is needed for Windows systems and (maybe soon) for Unix desktops using Wayland.

Instance Methods
 
__init__(self, config_files=_X2GO_XCONFIG_CONFIGFILES, defaults=None, logger=None, loglevel=log.loglevel_DEFAULT)
Constructs an X2GoClientXConfig instance.
source code
list
get_xserver_config(self, xserver_name)
Retrieve the XServer configuration (from the xconfig file) for the given XServer application.
source code
 
known_xservers(self)
Renders a list of XServers that are known to Python X2Go.
source code
 
installed_xservers(self)
Among the known XServers renders a list of XServers that are actually installed on the system.
source code
 
running_xservers(self)
Tries to render a list of running XServer processes from the system's process list.
source code
 
xserver_launch_possible(self)
Detect if there is an XServer (that is known to Python X2Go) installed on the system.
source code
 
xserver_launch_needed(self)
Detect if an XServer launch is really needed (or if we use an already running XServer instance).
source code
 
preferred_xserver(self)
Returns a tuple of (<xserver_name>, <xserver_config>).
source code
 
preferred_xserver_names(self)
Returns the list of preferred XServer names (most preferred first).
source code
 
detect_unused_xdisplay_port(self, xserver_name)
Get an unused TCP/IP port for the to-be-launched X server and write it to the user's X configuration file.
source code

Inherited from inifiles.X2GoIniFile: __call__, __repr__, get, get_type, get_value, load, printable_config_file, update_value, write

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

Class Variables
  defaultValues = _X2GO_CLIENTXCONFIG_DEFAULTS

Inherited from inifiles.X2GoIniFile: user_config_file, write_user_config

Properties

Inherited from object: __class__

Method Details

__init__(self, config_files=_X2GO_XCONFIG_CONFIGFILES, defaults=None, logger=None, loglevel=log.loglevel_DEFAULT)
(Constructor)

source code 

Constructs an X2GoClientXConfig instance. This is normally done by an X2GoClient instance. You can retrieve this X2GoClientXConfig instance with the X2GoClient.get_client_xconfig() method.

On construction the X2GoClientXConfig instance is filled with values from the configuration files:

   /etc/x2goclient/xconfig
   ~/.x2goclient/xconfig

The files are read in the specified order and config options of both files are merged. Options set in the user configuration file (~/.x2goclient/xconfig) override global options set in /etc/x2goclient/xconfig.

Parameters:
  • config_files (list) - a list of configuration file names
  • defaults (dict) - a Python dictionary with configuration file defaults (use on your own risk)
  • logger (obj) - you can pass an X2GoLogger object to the X2GoClientXConfig constructor
  • loglevel (int) - if no X2GoLogger object has been supplied a new one will be constructed with the given loglevel
Overrides: object.__init__

get_xserver_config(self, xserver_name)

source code 

Retrieve the XServer configuration (from the xconfig file) for the given XServer application.

Parameters:
  • xserver_name (str) - name of the XServer application
Returns: list
A Python dictionary containing the XServer's configuration settings

known_xservers(self)

source code 

Renders a list of XServers that are known to Python X2Go.

Decorators:
  • @property

installed_xservers(self)

source code 

Among the known XServers renders a list of XServers that are actually installed on the system.

Decorators:
  • @property

running_xservers(self)

source code 

Tries to render a list of running XServer processes from the system's process list.

Decorators:
  • @property

xserver_launch_possible(self)

source code 

Detect if there is an XServer (that is known to Python X2Go) installed on the system. Equals True if we have found an installed XServer that we can launch.

Decorators:
  • @property

xserver_launch_needed(self)

source code 

Detect if an XServer launch is really needed (or if we use an already running XServer instance). Equals True if we have to launch an XServer before we can start/resume X2Go sessions.

Decorators:
  • @property

preferred_xserver(self)

source code 

Returns a tuple of (<xserver_name>, <xserver_config>).

return: (<xserver_name>, <xserver_config>) rtype: tuple

Decorators:
  • @property

preferred_xserver_names(self)

source code 

Returns the list of preferred XServer names (most preferred first).

Decorators:
  • @property

detect_unused_xdisplay_port(self, xserver_name)

source code 

Get an unused TCP/IP port for the to-be-launched X server and write it to the user's X configuration file.

Parameters:
  • xserver_name (str) - name of the XServer application