[X2go-Commits] python-x2go.git - master (branch) updated: 0.1.1.4-220-gb772385

X2Go dev team git-admin at x2go.org
Thu Apr 19 22:56:42 CEST 2012


The branch, master has been updated
       via  b772385096b6cd0c7fbd28791e8eed2550a15b1e (commit)
      from  10d5af9a27e7f4819780fa623573e7e38795e7df (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 b772385096b6cd0c7fbd28791e8eed2550a15b1e
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Thu Apr 19 22:56:39 2012 +0200

    Make timeout on command execution customizable.

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

Summary of changes:
 debian/changelog                  |    1 +
 x2go/backends/control/_stdout.py  |   10 +++++-----
 x2go/backends/terminal/_stdout.py |    4 ++--
 3 files changed, 8 insertions(+), 7 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 6c4e4a8..5e5810b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -114,6 +114,7 @@ python-x2go (0.1.2.0-0~x2go1) UNRELEASED; urgency=low
     - Provide X2goSession.get_session_type() method.
     - Do not call HOOK method if self.allow_share_local_folders is False.
     - Try to derive language information from X2goClient instance.
+    - Make timeout on command execution customizable.
   * Depend on python-xlib.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Sat, 28 Sep 2012 01:44:21 +0100
diff --git a/x2go/backends/control/_stdout.py b/x2go/backends/control/_stdout.py
index c999adc..50a699b 100644
--- a/x2go/backends/control/_stdout.py
+++ b/x2go/backends/control/_stdout.py
@@ -193,7 +193,7 @@ class X2goControlSessionSTDOUT(paramiko.SSHClient):
         self.logger('sFTP-write: removing remote file %s on host %s' % (remote_path, self.get_transport().getpeername()), loglevel=log.loglevel_DEBUG)
         self.sftp_client.remove(remote_path)
 
-    def _x2go_exec_command(self, cmd_line, loglevel=log.loglevel_INFO, **kwargs):
+    def _x2go_exec_command(self, cmd_line, loglevel=log.loglevel_INFO, timeout=20, **kwargs):
 
         while self.locked:
             gevent.sleep(.1)
@@ -207,8 +207,8 @@ class X2goControlSessionSTDOUT(paramiko.SSHClient):
             cmd = cmd_line
         if self.get_transport() is not None:
 
-            timeout = gevent.Timeout(20)
-            timeout.start()
+            timer = gevent.Timeout(timeout)
+            timer.start()
             try:
                 self.logger("executing command on X2Go server ,,%s'': %s" % (self.profile_name, _rerewrite_blanks(cmd)), loglevel)
                 _retval = self.exec_command(_rewrite_password(cmd, user=self.get_transport().get_username(), password=self._session_password), **kwargs)
@@ -230,7 +230,7 @@ class X2goControlSessionSTDOUT(paramiko.SSHClient):
                     self.sshproxy_session.stop_thread()
                 self.locked = False
                 raise x2go_exceptions.X2goControlSessionException('the X2Go control session has died unexpectedly')
-            except gevent.timeout.Timeout:
+            except gevent.timer.Timeout:
                 self.session_died = True
                 if self.sshproxy_session:
                     self.sshproxy_session.stop_thread()
@@ -244,7 +244,7 @@ class X2goControlSessionSTDOUT(paramiko.SSHClient):
                 raise x2go_exceptions.X2goControlSessionException('the X2Go control session has died unexpectedly')
             finally:
                 self.locked = False
-                timeout.cancel()
+                timer.cancel()
 
         else:
             self.locked = False
diff --git a/x2go/backends/terminal/_stdout.py b/x2go/backends/terminal/_stdout.py
index e941254..3ef850f 100644
--- a/x2go/backends/terminal/_stdout.py
+++ b/x2go/backends/terminal/_stdout.py
@@ -1036,7 +1036,7 @@ class X2goTerminalSessionSTDOUT(object):
             return self.session_info.is_published_applications_provider()
         return False
 
-    def exec_published_application(self, exec_name):
+    def exec_published_application(self, exec_name, timeout=20):
         """\
         Executed a published application.
 
@@ -1058,7 +1058,7 @@ class X2goTerminalSessionSTDOUT(object):
             ]
         )
         self.logger('executing published application %s for %s with command line: %s' % (exec_name, self.profile_name, cmd_line), loglevel=log.loglevel_DEBUG)
-        (stdin, stdout, stderr) = self.control_session._x2go_exec_command(cmd_line)
+        (stdin, stdout, stderr) = self.control_session._x2go_exec_command(cmd_line, timeout=timeout)
 
     def ok(self):
         """\


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