This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch cvix/2.x in repository pyhoca-gui. commit b557526bbcf23558a391e5b440bade349ed56870 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Feb 10 16:33:38 2014 +0100 CVix: do remember exports and user names --- CVix.py | 20 ++++++++++++++++++-- CVix_session_profile_template.py | 1 - 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CVix.py b/CVix.py index 9f3e3e9..eeea464 100755 --- a/CVix.py +++ b/CVix.py @@ -41,6 +41,12 @@ __VERSION__ = "1.99.1" # change this to .CVix??? SESSION_DIR = '.x2goclient' +preserve_profile_options=[ + 'user', + 'export', + 'restoreexports', +] + def CVixConfigFile(): """\ Create CVix's customer based session profile file. @@ -58,21 +64,31 @@ def CVixConfigFile(): session_profiles = x2go.X2GoSessionProfiles(config_files=[session_file]) found = False + preserve_profile_config = {} if 'CVix' in session_profiles.profile_names: + last_profile_config = session_profiles.get_profile_config('CVix') + for option in preserve_profile_options: + try: + preserve_profile_config[option] = last_profile_config[option] + except KeyError: + pass session_profiles.delete_profile('CVix') profile_config = CVix_session_profile_template.SESSION_PROFILE_TEMPLATE + customized_config = { 'sshproxyhost': '{hostname}'.format(hostname=CUSTOMER_HOST), 'sshproxyport': 3389, 'sshproxyuser': CUSTOMER_USER, 'sshproxykeyfile': os.path.join(CUSTOMER_KEY), 'icon': os.path.join('icons', 'CVix', '128x128', 'CVix_sessionicon.png'), - 'user': x2go.CURRENT_LOCAL_USER, } + if not preserve_profile_config: + customized_config['user'] = x2go.CURRENT_LOCAL_USER + customized_config['export'] = '~:1' - profile_config['export'] = profile_config['export'].format(local_home=os.path.normpath(os.path.expanduser('~'))) profile_config.update(customized_config) + profile_config.update(preserve_profile_config) session_profiles.add_profile(profile_id=None, **profile_config) session_profiles.write_user_config = True diff --git a/CVix_session_profile_template.py b/CVix_session_profile_template.py index b199aab..0eca2d8 100644 --- a/CVix_session_profile_template.py +++ b/CVix_session_profile_template.py @@ -29,7 +29,6 @@ SESSION_PROFILE_TEMPLATE = { 'useiconv': False, 'multidisp': False, # gets substituted during application start - 'export': "{local_home}:1;", 'fullscreen': True, 'useexports': True, 'quality': 9, -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/pyhoca-gui.git