[X2Go-Commits] python-x2go.git - release/0.4.0.x (branch) updated: 124af81ee447392ec635f0392032809f9654bc35

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


The branch, release/0.4.0.x has been updated
       via  124af81ee447392ec635f0392032809f9654bc35 (commit)
      from  120f7ca295cb1002f67fb42cb0645237853bd88c (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/backends/proxy/base.py |   10 +++++-----
 x2go/defaults.py            |    3 +++
 x2go/xserver.py             |   29 +++++++++++++++++------------
 3 files changed, 25 insertions(+), 17 deletions(-)

The diff of changes is:
diff --git a/x2go/backends/proxy/base.py b/x2go/backends/proxy/base.py
index 5ec3672..b894d91 100644
--- a/x2go/backends/proxy/base.py
+++ b/x2go/backends/proxy/base.py
@@ -114,10 +114,10 @@ class X2goProxyBASE(threading.Thread):
 
         """
         if self.proxy is not None and self.proxy.poll() is None:
-            self.logger('Shutting down X2go proxy subprocess', log.loglevel_DEBUG)
+            self.logger('Shutting down X2go proxy subprocess', loglevel=log.loglevel_DEBUG)
             self.proxy.kill()
         if self.fw_tunnel is not None:
-            self.logger('Shutting down Paramiko/SSH forwarding tunnel', log.loglevel_DEBUG)
+            self.logger('Shutting down Paramiko/SSH forwarding tunnel', loglevel=log.loglevel_DEBUG)
             forward.stop_forward_tunnel(self.fw_tunnel)
         if self.session_log_stdout is not None:
             self.session_log_stdout.close()
@@ -156,7 +156,7 @@ class X2goProxyBASE(threading.Thread):
         while self.fw_tunnel is None:
             self.fw_tunnel = forward.start_forward_tunnel(local_graphics_port, "localhost", self.session_info.graphics_port, self.ssh_transport, logger=self.logger, )
             if self.fw_tunnel is None:
-                self.logger('socket [localhost]:%s is in use, trying local TCP/IP socket port: [localhost]:%s' % (local_graphics_port, local_graphics_port+1), log.loglevel_INFO)
+                self.logger('socket [localhost]:%s is in use, trying local TCP/IP socket port: [localhost]:%s' % (local_graphics_port, local_graphics_port+1), loglevel=log.loglevel_INFO)
                 local_graphics_port += 1
                 gevent.sleep(.1)
 
@@ -168,7 +168,7 @@ class X2goProxyBASE(threading.Thread):
         # TODO: call some code that checks if the tunnel is already up...
         self.session_log_stdout = open('%s/%s' % (self.session_info.local_container, self.session_log, ), 'a')
         self.session_log_stderr = open('%s/%s' % (self.session_info.local_container, self.session_log, ), 'a')
-        self.logger('forking threaded subprocess: %s' % " ".join(cmd_line), log.loglevel_DEBUG)
+        self.logger('forking threaded subprocess: %s' % " ".join(cmd_line), loglevel=log.loglevel_DEBUG)
 
         _stdin = None
         _shell = False
@@ -190,7 +190,7 @@ class X2goProxyBASE(threading.Thread):
 
         if _X2GOCLIENT_OS == 'Windows':
             _stdin.close()
-        print 'TERMINATING PROXY'
+        self.logger('terminating proxy: %s' % p, loglevel=log.loglevel_DEBUG)
         p.terminate()
 
     def _update_local_proxy_socket(self, port):
diff --git a/x2go/defaults.py b/x2go/defaults.py
index 6e475ff..6712d75 100644
--- a/x2go/defaults.py
+++ b/x2go/defaults.py
@@ -178,6 +178,9 @@ if X2GOCLIENT_OS == 'Windows':
             'parameters': [':40', '-clipboard', '-multiwindow', '-notrayicon', '-nowinkill', ],
             },
         }
+else:
+    # make the variable available when building API documentation with epydoc
+    X2GO_CLIENTXCONFIG_DEFAULTS = {}
 
 X2GO_SESSIONPROFILE_DEFAULTS = {
     'speed': 2, 'pack': '16m-jpeg', 'quality': 9, 'link':'ADSL',
diff --git a/x2go/xserver.py b/x2go/xserver.py
index ed80e8b..a497c50 100644
--- a/x2go/xserver.py
+++ b/x2go/xserver.py
@@ -28,15 +28,11 @@
 __NAME__ = 'x2goxserver-pylib'
 
 from defaults import X2GOCLIENT_OS as _X2GOCLIENT_OS
-
-if _X2GOCLIENT_OS not in ("Windows"):
-    import exceptions
-    class OSNotSupportedException(exceptions.StandardError): pass
-    raise OSNotSupportedException('x2go.xserver module is for Windows only')
+if _X2GOCLIENT_OS == 'Windows':
+    import wmi
 
 # modules
 import os
-import wmi
 import subprocess
 import threading
 import gevent
@@ -44,12 +40,11 @@ import copy
 
 # Python X2go modules
 import log
-from defaults import X2GO_XCONFIG_CONFIGFILES
-from defaults import X2GO_CLIENTXCONFIG_DEFAULTS
+from defaults import X2GO_XCONFIG_CONFIGFILES as _X2GO_XCONFIG_CONFIGFILES
+from defaults import X2GO_CLIENTXCONFIG_DEFAULTS as _X2GO_CLIENTXCONFIG_DEFAULTS
 import inifiles
 
 
-
 class X2goClientXConfig(inifiles.X2goIniFile):
     """\
     Configuration file based XServer startup settings for X2goClient instances.
@@ -57,9 +52,9 @@ class X2goClientXConfig(inifiles.X2goIniFile):
     This class is needed for Windows systems and (maybe soon) for Unix desktops using Wayland.
 
     """
-    defaultValues = X2GO_CLIENTXCONFIG_DEFAULTS
+    defaultValues = _X2GO_CLIENTXCONFIG_DEFAULTS
 
-    def __init__(self, config_files=X2GO_XCONFIG_CONFIGFILES, defaults=None, logger=None, loglevel=log.loglevel_DEFAULT):
+    def __init__(self, config_files=_X2GO_XCONFIG_CONFIGFILES, defaults=None, logger=None, loglevel=log.loglevel_DEFAULT):
         """\
         Constructs an L{X2goClientXConfig} instance. This is normally done by an L{X2goClient} instance.
         You can retrieve this L{X2goClientXConfig} instance with the C{X2goClient.get_client_xconfig()} 
@@ -75,6 +70,11 @@ class X2goClientXConfig(inifiles.X2goIniFile):
         C{/etc/x2goclient/xconfig}.
 
         """
+        if _X2GOCLIENT_OS not in ("Windows"):
+            import exceptions
+            class OSNotSupportedException(exceptions.StandardError): pass
+            raise OSNotSupportedException('classes of x2go.xserver module are for Windows only')
+
         inifiles.X2goIniFile.__init__(self, config_files, defaults=defaults, logger=logger, loglevel=loglevel)
 
     def get_xserver_config(self, xserver_name):
@@ -162,12 +162,17 @@ class X2goXServer(threading.Thread):
         STILL UNDOCUMENTED
 
         """
+        if _X2GOCLIENT_OS not in ("Windows"):
+            import exceptions
+            class OSNotSupportedException(exceptions.StandardError): pass
+            raise OSNotSupportedException('classes of x2go.xserver module are for Windows only')
+
         if logger is None:
             self.logger = log.X2goLogger(loglevel=loglevel)
         else:
             self.logger = copy.deepcopy(logger)
         self.logger.tag = __NAME__
-        
+
         self._keepalive = None
 
         self.xserver_name = xserver_name


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