[X2Go-Commits] pyhoca-gui.git - build-59a18b6e3b5d3f1dd8f07f26433d37fe5984a57d (branch) updated: 0.2.1.1-62-g3f31b3f

X2Go dev team git-admin at x2go.org
Tue Aug 27 13:22:56 CEST 2013


The branch, build-59a18b6e3b5d3f1dd8f07f26433d37fe5984a57d has been updated
       via  3f31b3f34c63acb46f45e1d5c29557d70dd72a54 (commit)
      from  f346d474b4719b1acf6d000999fa7bccbece3b45 (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 +++
 pyhoca-gui       |   19 ++++++++++++++++++-
 2 files changed, 21 insertions(+), 1 deletion(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 4c54b26..7b1758f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -36,6 +36,9 @@ pyhoca-gui (0.4.0.0-0~x2go1) UNRELEASED; urgency=low
     - Add »Apply« to session profile manager window.
     - Add another tab »Media« to session profile configuration window.
       Makes the windows display on netbook screens again (Fixes: #13).
+    - Become aware of multiple PyHoca-GUI processes being allowed.
+      Pre-requisited, that each instance runs on its own $DISPLAY
+      ($DISPLAY detection yet unfinished).
   * /debian/control:
     + Thanks to Orion's patch in bug #91 we can drop many build dependencies.
     + Versioned Depend: on python-x2go (>= 0.4.0.0-0~).
diff --git a/pyhoca-gui b/pyhoca-gui
index 0555dd6..d939249 100755
--- a/pyhoca-gui
+++ b/pyhoca-gui
@@ -23,6 +23,7 @@ modules ={}
 
 import sys
 import os
+import re
 PROG_NAME = os.path.basename(sys.argv[0]).replace('.exe', '')
 PROG_PID  = os.getpid()
 
@@ -139,7 +140,23 @@ def check_running():
     if _X2GOCLIENT_OS  in ('Linux', 'Mac'):
         p = subprocess.Popen(['ps', '-U', _CURRENT_LOCAL_USER, '-u', _CURRENT_LOCAL_USER], stdout=subprocess.PIPE)
         psA_out = p.communicate()
-        return psA_out[0].count(PROG_NAME) > 1
+        if psA_out[0].count(PROG_NAME) <= 1:
+            return False
+        else:
+            processes = psA_out[0].strip().strip('\n').strip().split('\n')
+            sep = re.compile('[\s]+')
+            processes_of_myself = [ sep.split(row) for row in processes if PROG_NAME in row and not str(PROG_PID) in row ]
+            print
+            print 'FIXME: We found at least one other PyHoca-GUI instance for this user,'
+            print 'but cannot (yet) tell if it/they is/are running on the same $DISPLAY'
+            print 'or some other $DISPLAY. PyHoca-GUI only allows one instance per $DISPLAY.'
+            print
+            print 'These are the other instances of PyHoca-GUI found for this user:'
+            for line in processes_of_myself:
+                print "    ".join(line)
+            # FIXME: add $DISPLAY check here, only return False if no PyHoca-GUI instance is running on this $DISPLAY
+            # return False
+        return True
     elif _X2GOCLIENT_OS == 'Windows':
         import wmi
         w = wmi.WMI()


hooks/post-receive
-- 
pyhoca-gui.git (Python X2Go Client (wxPython GUI))

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 "pyhoca-gui.git" (Python X2Go Client (wxPython GUI)).




More information about the x2go-commits mailing list