1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 """\
21 X2GoClientSettings class - managing x2goclient settings file.
22
23 The L{X2GoClientSettings} class one of Python X2Go's a public API classes.
24 Use this class (indirectly by retrieving it from an L{X2GoClient} instance)
25 in your Python X2Go based applications to access the
26 »settings« configuration file of your X2Go client application.
27
28 """
29 __NAME__ = 'x2gosettings-pylib'
30
31
32 import x2go.log as log
33 from x2go.defaults import X2GO_SETTINGS_CONFIGFILES as _X2GO_SETTINGS_CONFIGFILES
34 from x2go.defaults import X2GO_CLIENTSETTINGS_DEFAULTS as _X2GO_CLIENTSETTINGS_DEFAULTS
35 import x2go.inifiles as inifiles
36
37
39 """\
40 Configuration file based settings for L{X2GoClient} instances.
41
42 """
43 - def __init__(self, config_files=_X2GO_SETTINGS_CONFIGFILES, defaults=_X2GO_CLIENTSETTINGS_DEFAULTS, logger=None, loglevel=log.loglevel_DEFAULT):
44 """\
45 Constructs an L{X2GoClientSettings} instance. This is normally done from within an L{X2GoClient} instance.
46 You can retrieve this L{X2GoClientSettings} instance with the L{X2GoClient.get_client_settings()}
47 method.
48
49 On construction the L{X2GoClientSettings} object is filled with values from the configuration files::
50
51 /etc/x2goclient/settings
52 ~/.x2goclient/settings
53
54 The files are read in the specified order and config options of both files are merged. Options
55 set in the user configuration file (C{~/.x2goclient/settings}) override global options set in
56 C{/etc/x2goclient/settings}.
57
58 """
59 inifiles.X2GoIniFile.__init__(self, config_files, defaults=defaults, logger=logger, loglevel=loglevel)
60