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

X2go dev team git-admin at x2go.org
Sat Sep 24 09:31:25 CEST 2011


The branch, release/0.1.1.x has been updated
       via  d1064100febd0837fa8b6d66b8efd13deb5780d0 (commit)
      from  396398819979ac483f7f48c5dbf18055767f2a9e (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 d1064100febd0837fa8b6d66b8efd13deb5780d0
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Sat Sep 24 09:27:22 2011 +0200

    be more precise, when allowing local folder sharing

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

Summary of changes:
 x2go/session.py |   22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)

The diff of changes is:
diff --git a/x2go/session.py b/x2go/session.py
index 4239459..3f39107 100644
--- a/x2go/session.py
+++ b/x2go/session.py
@@ -1060,7 +1060,7 @@ class X2goSession(object):
                     self.terminal_session and not self.faulty and self.terminal_session.start_mimebox(mimebox_extensions=self.mimebox_extensions, mimebox_action=self.mimebox_action)
                     self.terminal_session and self.session_environment.update({'X2GO_MIMEBOX': self.terminal_session.get_mimebox_spooldir(), })
 
-                if self._SUPPORTED_FOLDERSHARING and self.share_local_folders and self.terminal_session and not self.faulty:
+                if self._SUPPORTED_FOLDERSHARING and self.allow_share_local_folders and self.share_local_folders and self.terminal_session and not self.faulty and self.is_folder_sharing_available():
                     if _control.get_transport().reverse_tunnels[self.terminal_session.get_session_name()]['sshfs'][1] is not None:
                         for _folder in self.share_local_folders:
                             self.share_local_folder(_folder)
@@ -1388,6 +1388,20 @@ class X2goSession(object):
         return self.terminated
     __has_terminated = has_terminated
 
+    def is_folder_sharing_available(self):
+        """\
+        Test if the remote session allows sharing of local folders with the session.
+
+        @return: returns C{True} if local folder sharing is available in the remote session
+        @rtype: C{bool}
+
+        """
+        if self._SUPPORTED_FOLDERSHARING and self.allow_share_local_folders:
+            if self.is_connected():
+                return self.control_session.is_folder_sharing_available()
+        else:
+            self.logger('local folder sharing is disabled for this session profile', loglevel=log.loglevel_WARN)
+
     def share_local_folder(self, local_path=None, folder_name=None):
         """\
         Share a local folder with this registered X2go session.
@@ -1407,7 +1421,7 @@ class X2goSession(object):
         if folder_name: local_path=folder_name
 
         if self.has_terminal_session():
-            if self.allow_share_local_folders:
+            if self._SUPPORTED_FOLDERSHARING and self.allow_share_local_folders:
                 if self.terminal_session.share_local_folder(local_path=local_path):
                     self.shared_folders.append(local_path)
                     return True
@@ -1432,7 +1446,7 @@ class X2goSession(object):
 
         """
         if self.has_terminal_session():
-            if self.allow_share_local_folders:
+            if self._SUPPORTED_FOLDERSHARING and self.allow_share_local_folders:
                 if force_all:
                     self.shared_folders = []
                     return self.terminal_session.unshare_all_local_folders()
@@ -1463,7 +1477,7 @@ class X2goSession(object):
 
         """
         if self.has_terminal_session():
-            if self.allow_share_local_folders and local_path in self.shared_folders:
+            if self._SUPPORTED_FOLDERSHARING and self.allow_share_local_folders and local_path in self.shared_folders:
                 self.shared_folders.remove(local_path)
                 return self.terminal_session.unshare_local_folder(local_path=local_path)
             else:


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