The branch, master has been updated via 8cdb797a6342d9eda351b4e71d2c9262c746c687 (commit) from c1e20ef02f7c157d20ef997b2bedc12587036128 (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 ----------------------------------------------------------------- commit 8cdb797a6342d9eda351b4e71d2c9262c746c687 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Dec 7 12:51:37 2011 +0100 Allow session parameter change for already registered sessions. ----------------------------------------------------------------------- Summary of changes: debian/changelog | 1 + x2go/backends/terminal/_stdout.py | 50 +++++++++++++++++-------------------- x2go/registry.py | 7 ++++- 3 files changed, 30 insertions(+), 28 deletions(-) The diff of changes is: diff --git a/debian/changelog b/debian/changelog index 2c4b02f..eb74667 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,6 +17,7 @@ python-x2go (0.1.1.9-0-x2go1) UNRELEASED; urgency=low - Introduce additional session profile parameter: setsessiontitle. - Fix for list processing in INI files. - Make terminal backend ,,applications'' aware. + - Allow session parameter change for already registered sessions. -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Wed, 12 Oct 2011 10:54:23 +0200 diff --git a/x2go/backends/terminal/_stdout.py b/x2go/backends/terminal/_stdout.py index 1861431..0e4a361 100644 --- a/x2go/backends/terminal/_stdout.py +++ b/x2go/backends/terminal/_stdout.py @@ -112,32 +112,27 @@ class X2goSessionParams(object): @rtype: str """ - session_type = self.session_type cmd = self.cmd - if session_type in ("D", "desktop"): + print cmd + + if cmd == 'RDP': + self.session_type = 'R' + elif cmd.startswith('rdesktop'): + self.session_type = 'R' + elif cmd == 'XDMCP': + self.session_type = 'D' + elif cmd in defaults.X2GO_DESKTOPSESSIONS.keys(): + self.session_type = 'D' + elif os.path.basename(cmd) in defaults.X2GO_DESKTOPSESSIONS.values(): self.session_type = 'D' - return - elif session_type in ("S", "shared", "shadow"): + else: + self.session_type = 'R' + + if self.session_type in ("D", "desktop"): + self.session_type = 'D' + elif self.session_type in ("S", "shared", "shadow"): self.session_type = 'S' - return - elif cmd: - if cmd == 'RDP': - self.session_type = 'R' - return - elif cmd.startswith('rdesktop'): - self.session_type = 'R' - return - elif cmd == 'XDMCP': - self.session_type = 'D' - return - elif cmd in defaults.X2GO_DESKTOPSESSIONS.keys(): - self.session_type = 'D' - return - elif os.path.basename(cmd) in defaults.X2GO_DESKTOPSESSIONS.values(): - self.session_type = 'D' - return - self.session_type = 'R' def update(self, properties_to_be_updated={}): """\ @@ -186,7 +181,7 @@ class X2goTerminalSessionSTDOUT(object): cache_type="unix-kde", keyboard='', kblayout='null', kbtype='null/null', session_type="application", snd_system='pulse', snd_port=4713, cmd=None, - set_session_title=False, session_title="", + set_session_title=False, session_title="", applications=[], rdp_server=None, rdp_options=None, xdmcp_server=None, convert_encoding=False, server_encoding='UTF-8', client_encoding='UTF-8', @@ -910,9 +905,10 @@ class X2goTerminalSessionSTDOUT(object): if self.params.kblayout or self.params.kbtype: setkbd = "1" - cmd = self.params.cmd - if '/' in cmd: - cmd = os.path.basename(cmd) + if '/' in self.params.cmd: + self.params.cmd = os.path.basename(self.params.cmd) + + self.params.rewrite_session_type() cmd_line = [ "x2gostartagent", str(self.params.geometry), @@ -923,7 +919,7 @@ class X2goTerminalSessionSTDOUT(object): str(self.params.kbtype), str(setkbd), str(self.params.session_type), - cmd, + self.params.cmd, ] if self.params.cmd == 'XDMCP' and self.params.xdmcp_server: diff --git a/x2go/registry.py b/x2go/registry.py index 3e855cd..cfed8ec 100644 --- a/x2go/registry.py +++ b/x2go/registry.py @@ -449,6 +449,9 @@ class X2goSessionRegistry(object): session_uuid = _virgin_sessions[0].get_uuid() _params = self.client_instance.session_profiles.to_session_params(profile_id) + for _k in _params.keys(): + if _k in kwargs.keys(): + _params[_k] = kwargs[_k] self(session_uuid).update_params(_params) self(session_uuid).set_server(server) self(session_uuid).set_profile_name(profile_name) @@ -458,7 +461,9 @@ class X2goSessionRegistry(object): session_uuid = self.get_session_of_session_name(session_name) if session_uuid is not None: _params = self.client_instance.session_profiles.to_session_params(profile_id) - + for _k in _params.keys(): + if _k in kwargs.keys(): + _params[_k] = kwargs[_k] self(session_uuid).update_params(_params) self(session_uuid).set_server(server) self(session_uuid).set_profile_name(profile_name) 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).