[X2go-Commits] python-x2go.git - master (branch) updated: 0.2.0.10-46-g75cba9e

X2Go dev team git-admin at x2go.org
Sat Nov 3 21:58:07 CET 2012


The branch, master has been updated
       via  75cba9e266f86bb406c7b86aab45c71767ac90d8 (commit)
       via  f7b6768fd794368b50dd6405b0068b2e2b72d28c (commit)
      from  e96a2aa11681e12b5120f28d6756aafe1400412b (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 75cba9e266f86bb406c7b86aab45c71767ac90d8
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Sat Nov 3 21:57:48 2012 +0100

    Wait for mounting of print and mimebox spooling share.

commit f7b6768fd794368b50dd6405b0068b2e2b72d28c
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Sat Nov 3 21:55:36 2012 +0100

    Introduce locks for session registrations.

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

Summary of changes:
 debian/changelog |    2 ++
 x2go/registry.py |    8 ++++++++
 x2go/session.py  |    4 ++--
 3 files changed, 12 insertions(+), 2 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 3d2e3aa..765cb68 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -28,6 +28,8 @@ python-x2go (0.2.1.0-0~x2go1) UNRELEASED; urgency=low
       need the monkey patching for paramiko >= 1.8.0 anymore).
     - Rename session type XFCE4 to XFCE (using an unversioned name).
     - Avoid false positive notifications about started-by-other sessions.
+    - Introduce locks for session registrations.
+    - Wait for mounting of print and mimebox spooling share.
   * /debian/rules:
     + Allow package build on systems with missing dh_python2.
   * /debian/control:
diff --git a/x2go/registry.py b/x2go/registry.py
index 001ae6d..3d07564 100644
--- a/x2go/registry.py
+++ b/x2go/registry.py
@@ -27,6 +27,7 @@ import os
 import copy
 import types
 import time
+import threading
 
 # Python X2Go modules
 import log
@@ -79,6 +80,7 @@ class X2goSessionRegistry(object):
 
         self._last_available_session_registration = None
         self._skip_auto_registration = False
+        self._profile_locks = {}
 
     def keys(self):
         """\
@@ -507,6 +509,11 @@ class X2goSessionRegistry(object):
         @rtype: C{str}
 
         """
+        if profile_id not in self.profile_locks.keys():
+            self._profile_locks[profile_id] = threading.Lock()
+
+        self._profile_locks[profile_id].acquire()
+
         control_session = None
         if profile_id in self.control_sessions.keys():
             control_session = self.control_sessions[profile_id]
@@ -574,6 +581,7 @@ class X2goSessionRegistry(object):
         if control_session is None:
             self(session_uuid).do_auto_connect()
 
+        self._profile_locks[profile_id].release()
         return session_uuid
 
     def has_session_of_session_name(self, session_name):
diff --git a/x2go/session.py b/x2go/session.py
index 26f1d41..c80ede5 100644
--- a/x2go/session.py
+++ b/x2go/session.py
@@ -1737,7 +1737,7 @@ class X2goSession(object):
 
                 if self._SUPPORTED_PRINTING and self.printing:
                     try:
-                        self.has_terminal_session() and not self.faulty and gevent.spawn(self.terminal_session.start_printing)
+                        self.has_terminal_session() and not self.faulty and self.terminal_session.start_printing()
                         self.has_terminal_session() and not self.faulty and self.session_environment.update({'X2GO_SPOOLDIR': self.terminal_session.get_printing_spooldir(), })
                     except x2go_exceptions.X2goUserException, e:
                         self.logger('%s' % str(e), loglevel=log.loglevel_WARN)
@@ -1746,7 +1746,7 @@ class X2goSession(object):
 
                 if self._SUPPORTED_MIMEBOX and self.allow_mimebox:
                     try:
-                        self.has_terminal_session() and not self.faulty and gevent.spawn(self.terminal_session.start_mimebox, mimebox_extensions=self.mimebox_extensions, mimebox_action=self.mimebox_action)
+                        self.has_terminal_session() and not self.faulty and self.terminal_session.start_mimebox(mimebox_extensions=self.mimebox_extensions, mimebox_action=self.mimebox_action)
                         self.has_terminal_session() and self.session_environment.update({'X2GO_MIMEBOX': self.terminal_session.get_mimebox_spooldir(), })
                     except x2go_exceptions.X2goUserException, e:
                         self.logger('%s' % str(e), loglevel=log.loglevel_WARN)


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