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=['/home/buildd/.x2goclient/xconfig', '/etc/x2goclient/xconfig'], defaults={}, logger=None, loglevel=56)
Constructs an X2GoClientXConfig instance.
source code
bool
write(self)
Store the Xserver configuration to the storage backend (i.e.
source code
list
get_xserver_config(self, xserver_name)
Retrieve the XServer configuration (from the xconfig file) for the given XServer application.
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, update_value

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

Properties
  known_xservers
Renders a list of XServers that are known to Python X2Go.
  installed_xservers
Among the known XServers renders a list of XServers that are actually installed on the system.
  running_xservers
Tries to render a list of running XServer processes from the system's process list.
  xserver_launch_possible
Detect if there is an XServer (that is known to Python X2Go) installed on the system.
  xserver_launch_needed
Detect if an XServer launch is really needed (or if we use an already running XServer instance).
  preferred_xserver
Returns a tuple of (<xserver_name>, <xserver_config>).
  preferred_xserver_names
Returns the list of preferred XServer names (most preferred first).

Inherited from inifiles.X2GoIniFile: printable_config_file

Inherited from object: __class__

Method Details

__init__(self, config_files=['/home/buildd/.x2goclient/xconfig', '/etc/x2goclient/xconfig'], defaults={}, logger=None, loglevel=56)
(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__

write(self)

source code 

Store the Xserver configuration to the storage backend (i.e. on disk).

For writing the first of the config_files specified on instance construction that is writable will be used.

Returns: bool
True if the user config file has been successfully written, False otherwise.
Overrides: inifiles.X2GoIniFile.write

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

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

Property Details

known_xservers

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

Get Method:
unreachable.known_xservers(self) - Renders a list of XServers that are known to Python X2Go.

installed_xservers

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

Get Method:
unreachable.installed_xservers(self) - Among the known XServers renders a list of XServers that are actually installed on the system.

running_xservers

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

Get Method:
unreachable.running_xservers(self) - Tries to render a list of running XServer processes from the system's process list.

xserver_launch_possible

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.

Get Method:
unreachable.xserver_launch_possible(self) - Detect if there is an XServer (that is known to Python X2Go) installed on the system.

xserver_launch_needed

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.

Get Method:
unreachable.xserver_launch_needed(self) - Detect if an XServer launch is really needed (or if we use an already running XServer instance).

preferred_xserver

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

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

Get Method:
unreachable.preferred_xserver(self) - Returns a tuple of (<xserver_name>, <xserver_config>).

preferred_xserver_names

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

Get Method:
unreachable.preferred_xserver_names(self) - Returns the list of preferred XServer names (most preferred first).