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

X2Go dev team git-admin at x2go.org
Sun Mar 4 20:06:20 CET 2012


The branch, master has been updated
       via  ca2f9e2dc54d5d41c1c569b812cd724e8511139f (commit)
      from  7eee17c377885c1f9551819ad7f113fdb6fa0dbe (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 ca2f9e2dc54d5d41c1c569b812cd724e8511139f
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Sun Mar 4 20:06:12 2012 +0100

    Make x2go module importable on Win32 platforms again.

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

Summary of changes:
 debian/changelog                  |    1 +
 x2go/backends/terminal/_stdout.py |    6 +---
 x2go/defaults.py                  |   14 +++++++-----
 x2go/utils.py                     |   40 ++++++++++++++++++++++++-------------
 4 files changed, 37 insertions(+), 24 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 837bcdd..ef8021a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -31,6 +31,7 @@ python-x2go (0.1.2.0-0~x2go1) UNRELEASED; urgency=low
       get never used.
     - Rename control session method is_folder_sharing_available to
       is_sshfs_available.
+    - Make x2go module importable on Win32 platforms again.
   * 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/terminal/_stdout.py b/x2go/backends/terminal/_stdout.py
index 08b8de5..a8c27ce 100644
--- a/x2go/backends/terminal/_stdout.py
+++ b/x2go/backends/terminal/_stdout.py
@@ -33,7 +33,6 @@ import gevent
 import cStringIO
 import copy
 import shutil
-import Xlib
 
 # Python X2Go modules
 import x2go.rforward as rforward
@@ -853,9 +852,8 @@ class X2goTerminalSessionSTDOUT(object):
             timeout -= 1
 
             if self.session_window is not None:
-                self.session_window.set_input_focus(Xlib.X.RevertToParent, Xlib.X.CurrentTime)
-                self.session_window.configure(stack_mode=Xlib.X.Above)
-                self.session_window.circulate(Xlib.X.RaiseLowest)
+
+                utils.raise_session_window(self.session_window)
                 break
 
             gevent.sleep(1)
diff --git a/x2go/defaults.py b/x2go/defaults.py
index 65868f2..7edb59e 100644
--- a/x2go/defaults.py
+++ b/x2go/defaults.py
@@ -33,13 +33,15 @@ import platform
 
 X2GOCLIENT_OS = platform.system()
 
-import Xlib.display
-
-# handle missing X displays on package build
-try:
-    X_DISPLAY = Xlib.display.Display()
-except Xlib.error.DisplayNameError:
-    X_DISPLAY = None
+if X2GOCLIENT_OS != 'Windows':
+    import Xlib.display
+    import Xlib.error
+
+    # handle missing X displays on package build
+    try:
+        X_DISPLAY = Xlib.display.Display()
+    except Xlib.error.DisplayNameError:
+        X_DISPLAY = None
 
 LOCAL_HOME = os.path.expanduser('~')
 X2GO_SESSIONS_ROOTDIR = '.x2go'
diff --git a/x2go/utils.py b/x2go/utils.py
index 87c4a4f..1ad5fd0 100644
--- a/x2go/utils.py
+++ b/x2go/utils.py
@@ -33,15 +33,17 @@ import socket
 import gevent
 import string
 import subprocess
-import Xlib
 
 # Python X2Go modules
 from defaults import X2GOCLIENT_OS as _X2GOCLIENT_OS
-from defaults import X_DISPLAY as _X_DISPLAY
 from defaults import X2GO_SESSIONPROFILE_DEFAULTS as _X2GO_SESSIONPROFILE_DEFAULTS
 from defaults import X2GO_MIMEBOX_ACTIONS as _X2GO_MIMEBOX_ACTIONS
 from defaults import pack_methods_nx3
 
+if _X2GOCLIENT_OS != 'Windows':
+    import Xlib
+    from defaults import X_DISPLAY as _X_DISPLAY
+
 if _X2GOCLIENT_OS == 'Windows':
     import win32api
 
@@ -471,20 +473,30 @@ def find_session_window(session_name):
     @type session_name: C{str}
 
     """
-    # establish connection to the win API in use...
-    display = _X_DISPLAY
-    root = display.screen().root
+    if _X2GOCLIENT_OS != 'Windows':
+        # establish connection to the win API in use...
+        display = _X_DISPLAY
+        root = display.screen().root
 
-    success = False
-    windowIDs = root.get_full_property(display.intern_atom('_NET_CLIENT_LIST'), Xlib.X.AnyPropertyType).value
-    for windowID in windowIDs:
-        window = display.create_resource_object('window', windowID)
-        if session_name in window.get_wm_name():
-            success = True
-            break
+        success = False
+        windowIDs = root.get_full_property(display.intern_atom('_NET_CLIENT_LIST'), Xlib.X.AnyPropertyType).value
+        for windowID in windowIDs:
+            window = display.create_resource_object('window', windowID)
+            if session_name in window.get_wm_name():
+                success = True
+                break
 
-    if success:
-        return window
+        if success:
+            return window
 
     return None
 
+def raise_session_window(session_window):
+    """\
+    Raise session window.
+
+    @param session_window: session window instance
+    @type session_name: C{obj}
+
+    """
+    pass
\ No newline at end of file


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