[X2go-Commits] python-x2go.git - release/0.1.1.x (branch) updated: 0.1.1.6-14-g3963988

X2go dev team git-admin at x2go.org
Sat Sep 24 01:10:55 CEST 2011


The branch, release/0.1.1.x has been updated
       via  396398819979ac483f7f48c5dbf18055767f2a9e (commit)
       via  e150e61c74db05607e3f1c3e96440d65023e0b95 (commit)
       via  3a5ffa6774dc7a48eb20d20ca804a2cc702d7b25 (commit)
      from  e61623461dc3e29676ca06c76197b692005a5695 (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 396398819979ac483f7f48c5dbf18055767f2a9e
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Sat Sep 24 01:08:17 2011 +0200

    minor method name extension in X2goClient class, indent fix

commit e150e61c74db05607e3f1c3e96440d65023e0b95
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Sat Sep 24 01:07:45 2011 +0200

    fix for new/compat export field interpretation

commit 3a5ffa6774dc7a48eb20d20ca804a2cc702d7b25
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Fri Sep 23 19:30:42 2011 +0200

    Compatibility fix for X2go folder sharing (session profile attribute: export).

-----------------------------------------------------------------------

Summary of changes:
 debian/changelog |    2 ++
 x2go/client.py   |    8 +++++---
 x2go/utils.py    |   19 ++++++++++++++++---
 3 files changed, 23 insertions(+), 6 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 9667cd3..c0f9023 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,6 +16,8 @@ python-x2go (0.1.1.7-0-x2go1) UNRELEASED; urgency=low
     - Use TCP_NODELAY socket option for graphics forwarding tunnels.
     - Typo fixes in session.py, related to calling _X2goSession__disconnect
       method.
+    - Compatibility fix for X2go folder sharing (session profile attribute:
+      export).
 
   [ Dick Kniep ]
   * Fix for upstream version 0.1.1.7:
diff --git a/x2go/client.py b/x2go/client.py
index 35dcfc6..5914918 100644
--- a/x2go/client.py
+++ b/x2go/client.py
@@ -1470,7 +1470,7 @@ class X2goClient(object):
             return session_name not in [ s for s in self.server_running_sessions(session_uuid)  + self.server_suspended_sessions(session_uuid) ]
     __has_session_terminated = has_session_terminated
 
-    def share_local_folder_with_session(self, session_uuid=None, local_path=None, profile_name=None, folder_name=None):
+    def share_local_folder(self, session_uuid=None, local_path=None, profile_name=None, folder_name=None):
         """\
         Share a local folder with the X2go session registered as C{session_uuid}.
 
@@ -1504,7 +1504,9 @@ class X2goClient(object):
         else:
             self.logger('Cannot find a terminal session for profile ,,%s\'\' to share a local folder with' % profile_name, loglevel=log.loglevel_WARN)
             return False
-    __share_local_folder_with_session = share_local_folder_with_session
+    __share_local_folder = share_local_folder
+    __share_local_folder_with_session = share_local_folder
+    __share_local_folder_with_profile = share_local_folder
 
     def unshare_all_local_folders(self, session_uuid=None, profile_name=None):
         """\
@@ -1590,7 +1592,7 @@ class X2goClient(object):
             if len(_associated) > 0:
                 session_uuid = _associated[0]
         if session_uuid:
-                return self.session_registry(session_uuid).get_shared_folders()
+            return self.session_registry(session_uuid).get_shared_folders()
     session_get_shared_folders = get_shared_folders
     profile_get_shared_folders = get_shared_folders
     __session_get_shared_folders = get_shared_folders
diff --git a/x2go/utils.py b/x2go/utils.py
index 9f92c36..9af2ef1 100644
--- a/x2go/utils.py
+++ b/x2go/utils.py
@@ -144,7 +144,6 @@ def _convert_SessionProfileOptions_2_SessionParams(_options):
             'speed': 'link',
             'sshport': 'port',
             'useexports': 'allow_share_local_folders',
-            'export': 'share_local_folders',
             'usemimebox': 'allow_mimebox',
             'mimeboxextensions': 'mimebox_extensions',
             'mimeboxaction': 'mimebox_action',
@@ -204,8 +203,22 @@ def _convert_SessionProfileOptions_2_SessionParams(_options):
 
     del _params['fstunnel']
 
-    if _params.has_key('share_local_folders'):
-        _params['share_local_folders'] = [ f for f in _params['share_local_folders'].split(',') if f ]
+    if _params.has_key('export'):
+
+        _export = _params['export']
+        del _params['export']
+        # fix for wrong export field usage in PyHoca-GUI/CLI and python-x2go before 20110923
+        _export = _export.replace(",", ";")
+
+        _export = _export.strip().strip('"').strip().strip(';').strip()
+        _export_list = [ f for f in _export.split(';') if f ]
+
+        _params['share_local_folders'] = []
+        for _shared_folder in _export_list:
+            # fix for wrong export field usage in PyHoca-GUI/CLI and python-x2go before 20110923
+            if not ":" in _shared_folder: _shared_folder = "%s:1" % _shared_folder
+            if _shared_folder.split(":")[1] == "1":
+                _params['share_local_folders'].append(_shared_folder.split(":")[0])
 
     if not _options['fullscreen']:
         _params['geometry'] = '%sx%s' % (_options['width'], _options['height'])


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).




More information about the x2go-commits mailing list