The branch, twofactorauth has been updated via 4590e1de20bab53d815f04aa7c7e03eb69443df0 (commit) from 68ced82549d5b7854251980569e5d181b5ec2aa5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: x2go/defaults.py | 18 ++++++++++++---- x2go/inifiles.py | 6 +++--- x2go/xserver.py | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 74 insertions(+), 11 deletions(-) The diff of changes is: diff --git a/x2go/defaults.py b/x2go/defaults.py index bea94b6..e35887d 100644 --- a/x2go/defaults.py +++ b/x2go/defaults.py @@ -161,10 +161,20 @@ X2GO_CLIENTPRINTING_DEFAULTS = { }, } X2GO_CLIENTXCONFIG_DEFAULTS = { - 'XServer': { - 'binary':'XMing', - 'parameters':'', - 'stopcommand':'' + 'XServers': { + 'known_xservers': ['XMing', 'Cygwin-X', ], + }, + 'Cygwin-X': { + 'process_name': 'XWin.exe', + 'test_available': '%s\cygwin\bin\startxwin.exe' % os.environ['SystemDrive'], + 'run_command':'%s\cygwin\bin\run.exe /usr/bin/bash.exe -l -c /usr/bin/startxwin.exe' % os.environ['SystemDrive'], + 'parameters':[], + } + 'XMing': { + 'process_name': 'XMing.exe', + 'test_available':'%s\Xming\Xming.exe' % os.environ['ProgramFiles'], + 'run_command':'%s\Xming\Xming.exe' % os.environ['ProgramFiles'], + 'parameters': [':0', '-clibboard', '-multiwindow',] } } diff --git a/x2go/inifiles.py b/x2go/inifiles.py index 24282b5..0d6c8c1 100644 --- a/x2go/inifiles.py +++ b/x2go/inifiles.py @@ -239,8 +239,8 @@ class X2goIniFile(object): return "<%s instance: %s>" % (self.__class__, self.name) def __init__(self, name): self.name = name - def set_option(self, option_name, value): - setattr(self, option_name, value) + def set_option(self, option_name.lower(), value): + setattr(self, option_name.lower(), value) for section_name in self.iniConfig.sections(): section = ini_section(section_name) @@ -249,7 +249,7 @@ class X2goIniFile(object): section.set_option(option_name, self.get(section.name, option_name, self.get_type(section.name, option_name))) else: section.set_option(option_name, self.get(section.name, option_name)) - setattr(self, section.name, section) + setattr(self, section.name.lower(), section) @property def printable_config_file(self): diff --git a/x2go/xserver.py b/x2go/xserver.py index 77058fe..4175afe 100644 --- a/x2go/xserver.py +++ b/x2go/xserver.py @@ -73,6 +73,51 @@ class X2goClientXConfig(inifiles.X2goIniFile): """ inifiles.X2goIniFile.__init__(self, config_files, defaults=defaults, logger=logger, loglevel=loglevel) + def get_xserver_config(self, xserver_name): + _xserver_config = {} + for option in self.iniConfig.options(_profile_id): + _profile_config[option] = self.get(_profile_id, option, key_type=self.get_profile_option_type(option)) + return _profile_config + + @property + def known_xservers(self): + """\ + STILL UNDOCUMENTED + + """ + return self.xservers.known_xservers + + @property + def installed_xservers(self): + """\ + STILL UNDOCUMENTED + + """ + _installed = [] + for xserver_name in self.known_xservers: + if os.path.exists(os.path.normpath(self.get_xserver_config(xserver_name)): + _installed.append(xserver_name) + return _installed + + def running_xservers(self): + """\ + STILL UNDOCUMENTED + + """ + _running = [] + for xserver_name in self.known_xservers: + + process_name = self.get_xserver_config(xserver_name)['process_name'] + for line in os.popen("ps xa"): + fields = line.split() + pid = fields[0] + process = fields[4] + + if process.find(process_name) > 0: + # XServer is already running + _running.append(nick_name) + return _running + class X2goXServer(threading.Thread): """ @@ -82,16 +127,24 @@ class X2goXServer(threading.Thread): def __init__(self, XServerParms): - processname = XServerParms.binary + for + + process_name = XServerParms.process_name for line in os.popen("ps xa"): fields = line.split() pid = fields[0] process = fields[4] - if process.find(XServerParms.binary) > 0: + if process.find(process_name) > 0: # XServer is already running return - p = subprocess.Popen([XServerParms.binary,XServerParms.parameters], shell=True) - sts = os.waitpid(p.pid, 0)[1] + self.XServerParms = XServerParms + threading.Thread.__init__(self) + self.daemon = True + self.start() + + def run(self): + p = subprocess.Popen([self.XServerParms.run_command, self.XServerParms.parameters], shell=True) + sts = os.waitpid(p.pid, 0)[1] hooks/post-receive -- python-x2go.git (Python X2Go Client API) This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "python-x2go.git" (Python X2Go Client API).