[X2Go-Commits] python-x2go.git - brokerclient (branch) updated: 0.1.1.4-163-g41e9e07

X2Go dev team git-admin at x2go.org
Tue Jan 7 16:21:05 CET 2014


The branch, brokerclient has been updated
       via  41e9e07ffcd534af310b1a7dd48c04d9fbd72356 (commit)
      from  5337f67d11bd2b5c7d2d394495a55d533d0c4c53 (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 -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 debian/changelog |    3 +++
 x2go/client.py   |   23 ++++++++++++++++++++++-
 2 files changed, 25 insertions(+), 1 deletion(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index ddca0e5..a9594b0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -69,6 +69,9 @@ python-x2go (0.1.2.0-0~x2go1) UNRELEASED; urgency=low
       default known_xservers with configured known_xservers.
     - Make sure xconfig configuration changes provided by defaults.py get
       written to the config file.
+    - Docstring fix, add X2goClient method is_session_profile(), return registered
+      session for a specific session name if it has already been registered instead
+      of registering a new session.
   * Depend on python-xlib.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Sat, 28 Sep 2012 01:44:21 +0100
diff --git a/x2go/client.py b/x2go/client.py
index de17a43..68da3fb 100644
--- a/x2go/client.py
+++ b/x2go/client.py
@@ -879,6 +879,13 @@ class X2goClient(object):
         @rtype: C{str}
 
         """
+
+        # test if session_name has already been registered. If yes, return it immediately.
+        if type(session_name) is types.StringType:
+            _retval = self.get_session_of_session_name(session_name, return_object=return_object)
+            if _retval is not None:
+                return _retval
+
         if known_hosts is None:
             known_hosts = os.path.join(_LOCAL_HOME, self.ssh_rootdir, 'known_hosts')
 
@@ -1561,7 +1568,7 @@ class X2goClient(object):
         Test if the X2Go given session profile has open connections
         to the X2Go server.
 
-        @param profile_name: the X2Go session's UUID registry hash
+        @param profile_name: a valid session profile name
         @type profile_name: C{str}
 
         @return: C{True} if profile has a connected session, C{False} otherwise
@@ -1571,6 +1578,20 @@ class X2goClient(object):
         return bool(self.client_connected_sessions_of_profile_name(profile_name=profile_name))
     __is_profile_connected = is_profile_connected
 
+    def is_session_profile(self, profile_id_or_name):
+        """\
+        Test if the X2Go given session profile is configured in the client's C{sessions} file.
+
+        @param profile_id_or_name: test existence of this session profile name (or id)
+        @type profile_id_or_name: C{str}
+
+        @return: C{True} if session profile exists, C{False} otherwise
+        @rtype: C{bool}
+
+        """
+        return self.session_profiles.has_profile(profile_id_or_name)
+    __is_session_profile = is_session_profile
+
     def is_session_running(self, session_uuid, session_name=None):
         """\
         Test if the X2Go session registered as C{session_uuid} is up 


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