The branch, twofactorauth has been updated via 1b39b26c782a431bea3dc99d3dab61edceb253cc (commit) from c4b70151df3b4f2572f1d9dc1699f29b072016b7 (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/cache.py | 4 ++-- x2go/client.py | 12 +++++----- x2go/registry.py | 68 +++++++++++++++++++++++++++++++++++++++++------------- x2go/session.py | 43 ++++++++++++++++++++-------------- 4 files changed, 86 insertions(+), 41 deletions(-) The diff of changes is: diff --git a/x2go/cache.py b/x2go/cache.py index e0b4dfd..7010613 100644 --- a/x2go/cache.py +++ b/x2go/cache.py @@ -63,7 +63,7 @@ class X2goListSessionsCache(object): def check_cache(self): for profile_name in self.x2go_listsessions_cache.keys(): - if profile_name not in self.client_instance.connected_profiles(return_profile_names=True): + if profile_name not in self.client_instance.client_connected_profiles(return_profile_names=True): del self.x2go_listsessions_cache[profile_name] def update_all(self): @@ -71,7 +71,7 @@ class X2goListSessionsCache(object): Update L{X2goListSessionsCache} for all connected profiles. """ - for profile_name in self.client_instance.connected_profiles(return_profile_names=True): + for profile_name in self.client_instance.client_connected_profiles(return_profile_names=True): self.update(profile_name) self.check_cache() diff --git a/x2go/client.py b/x2go/client.py index 56c909f..3e247d4 100644 --- a/x2go/client.py +++ b/x2go/client.py @@ -1390,7 +1390,7 @@ class X2goClient(object): """ return self.session_profiles.get_profile_metatype(profile_name) - def connected_profiles(self, return_profile_names=False): + def client_connected_profiles(self, return_profile_names=False): """\ STILL UNDOCUMENTED @@ -1399,7 +1399,7 @@ class X2goClient(object): return [ self.to_profile_name(p_id) for p_id in self.session_registry.connected_profiles ] else: return self.session_registry.connected_profiles - __connected_profiles = connected_profiles + __client_connected_profiles = client_connected_profiles def disconnect_profile(self, profile_name): """\ @@ -1445,7 +1445,7 @@ class X2goClient(object): STILL UNDOCUMENTED """ - for profile_name in self.connected_profiles(return_profile_names=True): + for profile_name in self.client_connected_profiles(return_profile_names=True): self.__update_sessionregistry_status_by_profile_name(profile_name) __update_sessionregistry_status_all_profiles = update_sessionregistry_status_all_profiles @@ -1479,7 +1479,7 @@ class X2goClient(object): """ if self.listsessions_cache is not None: - for profile_name in self.connected_profiles(return_profile_names=True): + for profile_name in self.client_connected_profiles(return_profile_names=True): self.__update_cache_by_profile_name(profile_name) self.listsessions_cache.check_cache() @@ -1490,7 +1490,7 @@ class X2goClient(object): STILL UNDOCUMENTED """ - for profile_name in self.connected_profiles(return_profile_names=True): + for profile_name in self.client_connected_profiles(return_profile_names=True): session_list = self.list_sessions(profile_name=profile_name, update_sessionregistry=False, register_sessions=False, @@ -1512,6 +1512,6 @@ class X2goClient(object): STILL UNDOCUMENTED """ - for profile_name in self.connected_profiles(return_profile_names=True): + for profile_name in self.client_connected_profiles(return_profile_names=True): self.__register_available_server_sessions_by_profile_name(profile_name) __register_available_server_sessions_all_profiles = register_available_server_sessions_all_profiles diff --git a/x2go/registry.py b/x2go/registry.py index 53f934f..daf2bb8 100644 --- a/x2go/registry.py +++ b/x2go/registry.py @@ -216,24 +216,31 @@ class X2goSessionRegistry(object): # reconstruct all session options of _ctrl_session to auto-register a suspended session # found on the _ctrl_session's connected server - _pre_kwargs = _ctrl_session.__dict__ + _clone_kwargs = _ctrl_session.__dict__ kwargs = {} - kwargs.update(_pre_kwargs['terminal_params']) - kwargs.update(_pre_kwargs['control_params']) - kwargs['control_backend'] = _pre_kwargs['_control_backend'] - kwargs['terminal_backend'] = _pre_kwargs['_terminal_backend'] - kwargs['proxy_backend'] = _pre_kwargs['_proxy_backend'] - kwargs['info_backend'] = _pre_kwargs['_info_backend'] - kwargs['list_backend'] = _pre_kwargs['_list_backend'] - kwargs['settings_backend'] = _pre_kwargs['_settings_backend'] - kwargs['printing_backend'] = _pre_kwargs['_printing_backend'] - kwargs['keep_controlsession_alive'] = _pre_kwargs['keep_controlsession_alive'] - kwargs['client_rootdir'] = _pre_kwargs['client_rootdir'] - kwargs['sessions_rootdir'] = _pre_kwargs['sessions_rootdir'] + kwargs.update(self.client_instance.session_profiles.to_session_params(profile_id)) + kwargs['client_instance'] = self.client_instance + kwargs['control_backend'] = _clone_kwargs['_control_backend'] + kwargs['terminal_backend'] = _clone_kwargs['_terminal_backend'] + kwargs['proxy_backend'] = _clone_kwargs['_proxy_backend'] + kwargs['info_backend'] = _clone_kwargs['_info_backend'] + kwargs['list_backend'] = _clone_kwargs['_list_backend'] + kwargs['settings_backend'] = _clone_kwargs['_settings_backend'] + kwargs['printing_backend'] = _clone_kwargs['_printing_backend'] + kwargs['keep_controlsession_alive'] = _clone_kwargs['keep_controlsession_alive'] + kwargs['client_rootdir'] = _clone_kwargs['client_rootdir'] + kwargs['sessions_rootdir'] = _clone_kwargs['sessions_rootdir'] + + try: del kwargs['server'] + except: pass + try: del kwargs['profile_name'] + except: pass + try: del kwargs['profile_id'] + except: pass # this if clause catches problems when x2golistsessions commands give weird results if not self.has_session_of_session_name(session_name): - self.register(server, profile_id, profile_name, + self.register(server, profile_id, profile_name, session_name=session_name, virgin=False, running=False, suspended=True, terminated=None, **kwargs @@ -268,13 +275,42 @@ class X2goSessionRegistry(object): if _virgin_sessions and not session_name: session_uuid = _virgin_sessions[0].get_uuid() + _params = self.client_instance.session_profiles.to_session_params(profile_id) + + try: del _params['server'] + except: pass + try: del _params['printing'] + except: pass + try: del _params['share_local_folders'] + except: pass + try: del _params['profile_name'] + except: pass + try: del _params['profile_id'] + except: pass + + self(session_uuid).update_params(_params) self.logger('using already initially-registered yet-unused session %s' % session_uuid, log.loglevel_NOTICE) return session_uuid try: - _retval = self.get_session_of_session_name(session_name) + session_uuid = self.get_session_of_session_name(session_name) + _params = self.client_instance.session_profiles.to_session_params(profile_id) + + try: del _params['server'] + except: pass + try: del _params['printing'] + except: pass + try: del _params['share_local_folders'] + except: pass + try: del _params['profile_name'] + except: pass + try: del _params['profile_id'] + except: pass + + self(session_uuid).update_params(_params) self.logger('using already registered-by-session-name session %s' % session_uuid, log.loglevel_NOTICE) - return _retval + return session_uuid + except X2goSessionException: # no registered session for session_name found... FINE, go ahead! pass diff --git a/x2go/session.py b/x2go/session.py index bab60b0..8668fc9 100644 --- a/x2go/session.py +++ b/x2go/session.py @@ -135,25 +135,21 @@ class X2goSession(object): _client_instance = params['client_instance'] del params['client_instance'] - _terminal_params = copy.deepcopy(params) - _control_params = copy.deepcopy(params) - for p in params.keys(): - if p in session._X2GO_SESSION_PARAMS: - del _control_params[p] - else: - del _terminal_params[p] + self.control_params = {} + self.terminal_params = {} + self.update_params(params) + + try: del self.control_params['server'] + except: pass - _terminal_params['client_instance'] = _client_instance + self.terminal_params['client_instance'] = _client_instance self.logger('X2go control session parameters for profile %s:' % profile_name, log.loglevel_DEBUG) - for p in _control_params: - self.logger(' %s: %s' % (p, _control_params[p]), log.loglevel_DEBUG) + for p in self.control_params: + self.logger(' %s: %s' % (p, self.control_params[p]), log.loglevel_DEBUG) self.logger('X2go terminal session parameters for profile %s:' % profile_name, log.loglevel_DEBUG) - for p in _terminal_params: - self.logger(' %s: %s' % (p,_terminal_params[p]), log.loglevel_DEBUG) - - self.control_params = _control_params - self.terminal_params = _terminal_params + for p in self.terminal_params: + self.logger(' %s: %s' % (p,self.terminal_params[p]), log.loglevel_DEBUG) self.logger('starting X2goSession', loglevel=log.loglevel_DEBUG) if control_session is None: @@ -220,6 +216,21 @@ class X2goSession(object): self.get_terminal_session().__del__() self.terminal_session = None + def update_params(self, params): + """\ + STILL UNDOCUMENTED + + """ + _terminal_params = copy.deepcopy(params) + _control_params = copy.deepcopy(params) + for p in params.keys(): + if p in session._X2GO_SESSION_PARAMS: + del _control_params[p] + else: + del _terminal_params[p] + self.control_params.update(_control_params) + self.terminal_params.update(_terminal_params) + def get_uuid(self): """\ STILL UNDOCUMENTED @@ -500,8 +511,6 @@ class X2goSession(object): _new_session = True self.session_name = self.terminal_session.session_info.name - print 'STARTING SESSION: %s' % self.session_name - if _terminal is not None: if SUPPORTED_SOUND and _terminal.params.snd_system is not 'none': 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).