[X2Go-Commits] python-x2go.git - build-baikal (branch) updated: 0.0.44.2-27-g49529de

X2Go dev team git-admin at x2go.org
Wed Jan 8 15:26:25 CET 2014


The branch, build-baikal has been updated
       via  49529de671fb76aa6c75407dec5ee4e82c1dc27b (commit)
      from  10931a3efa38e418ce8dd846eab0b785515475ef (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:
 x2go/cache.py |   38 ++++++++++++++++++++++++++++++++------
 1 file changed, 32 insertions(+), 6 deletions(-)

The diff of changes is:
diff --git a/x2go/cache.py b/x2go/cache.py
index e6d0a56..14b2833 100644
--- a/x2go/cache.py
+++ b/x2go/cache.py
@@ -33,7 +33,18 @@ import x2go_exceptions
 
 class X2goListSessionsCache(object):
     """\
-    STILL UNDOCUMENTED
+    For non-blocking operations in client applications using Python X2go, it is
+    recommended to enable the L{X2goListSessionsCache}. This can be done when calling
+    the constructor of the L{X2goClient} class.
+
+    The session list cache gets updated in regularly intervals by a threaded
+    L{X2goSessionGuardian} instance. For the session list update, the X2go server
+    command C{x2golistsessions} is called and the command's stdout is cached
+    in the session list cache.
+
+    Whenever your client application needs access to the server's session list,
+    the list sessions cache is queried instead. This assures that the server's
+    session list is available without delay, even on slow internet connections.
 
     """
     x2go_listsessions_cache = {}
@@ -62,7 +73,10 @@ class X2goListSessionsCache(object):
 
     def delete(self, profile_name):
         """\
-        STILL UNDOCUMENTED
+        Remove session list for a given profile.
+
+        @param profile_name: name of profile to operate on
+        @type profile_name: C{str}
 
         """
         try: del self.x2go_listsessions_cache[profile_name]
@@ -70,7 +84,9 @@ class X2goListSessionsCache(object):
 
     def check_cache(self):
         """\
-        STILL UNDOCUMENTED
+        Check if list sessions cache elements are still valid (i.e. if the corresponding
+        session profile is still connected). If not so, remove invalid cache entries from
+        the list sessions cache.
 
         """
         for profile_name in self.x2go_listsessions_cache.keys():
@@ -79,7 +95,7 @@ class X2goListSessionsCache(object):
 
     def update_all(self):
         """\
-        Update L{X2goListSessionsCache} for all connected profiles.
+        Update L{X2goListSessionsCache} for all connected session profiles.
 
         """
         for profile_name in self.client_instance.client_connected_profiles(return_profile_names=True):
@@ -89,7 +105,7 @@ class X2goListSessionsCache(object):
 
     def update(self, profile_name):
         """\
-        Update the L{X2goListSessionsCache} for profile C{profile_name}.
+        Update the L{X2goListSessionsCache} for session profile C{profile_name}.
 
         @param profile_name: name of profile to update
         @type profile_name: C{str}
@@ -110,6 +126,11 @@ class X2goListSessionsCache(object):
         """\
         Retrieve the current cache content of L{X2goListSessionsCache}.
 
+        @param session_uuid: unique identifier of session to query cache for
+        @type session_uuid: C{str}
+        @return: a data object containing available session informations
+        @rtype: C{X2goServerSessionList*} instance
+
         """
         profile_name = self.client_instance.get_session_profile_name(session_uuid)
         if self.is_cached(session_uuid=session_uuid):
@@ -119,7 +140,12 @@ class X2goListSessionsCache(object):
 
     def is_cached(self, profile_name=None, session_uuid=None):
         """\
-        Retrieve the current cache content of L{X2goListSessionsCache}.
+        Check if session list is cached.
+
+        @param profile_name: name of profile to update
+        @type profile_name: C{str}
+        @param session_uuid: unique identifier of session to query cache for
+        @type session_uuid: C{str}
 
         """
         if profile_name is None and session_uuid:


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