[Python-apps-commits] r6084 - in packages/gtg/trunk/debian (2 files)

dktrkranz at users.alioth.debian.org dktrkranz at users.alioth.debian.org
Sun Sep 5 09:51:35 UTC 2010


    Date: Sunday, September 5, 2010 @ 09:51:24
  Author: dktrkranz
Revision: 6084

Adjust x_is_running.patch using proper gtk methods 

Modified:
  packages/gtg/trunk/debian/changelog
  packages/gtg/trunk/debian/patches/x_is_running.patch

Modified: packages/gtg/trunk/debian/changelog
===================================================================
--- packages/gtg/trunk/debian/changelog	2010-09-05 08:56:49 UTC (rev 6083)
+++ packages/gtg/trunk/debian/changelog	2010-09-05 09:51:24 UTC (rev 6084)
@@ -1,12 +1,12 @@
 gtg (0.2.4-4) UNRELEASED; urgency=low
 
   * debian/patches/x_is_running.patch:
-    - Check existence of X lock files and associated PIDs to see if X
-      is running (Closes: #595430).
+    - Check if a display is available instead of relying on xset being
+      installed and functional (Closes: #595430).
   * debian/patches/locale.patch:
     - Use bindtextdomain to simplify locale handling (Closes: #595436, #595440).
 
- -- Luca Falavigna <dktrkranz at debian.org>  Sun, 05 Sep 2010 10:54:51 +0200
+ -- Luca Falavigna <dktrkranz at debian.org>  Sun, 05 Sep 2010 11:48:50 +0200
 
 gtg (0.2.4-3) unstable; urgency=low
 

Modified: packages/gtg/trunk/debian/patches/x_is_running.patch
===================================================================
--- packages/gtg/trunk/debian/patches/x_is_running.patch	2010-09-05 08:56:49 UTC (rev 6083)
+++ packages/gtg/trunk/debian/patches/x_is_running.patch	2010-09-05 09:51:24 UTC (rev 6084)
@@ -1,26 +1,23 @@
-Check existence of X lock files and associated PIDs to see if X is running
+Check if a display is available instead of relying on xset
 
 Index: gtg-0.2.4/gtg
 ===================================================================
---- gtg-0.2.4.orig/gtg	2010-09-05 01:48:47.340398151 +0200
-+++ gtg-0.2.4/gtg	2010-09-05 01:49:39.808415847 +0200
-@@ -32,10 +32,17 @@
+--- gtg-0.2.4.orig/gtg	2010-09-05 02:08:29.896400600 +0200
++++ gtg-0.2.4/gtg	2010-09-05 11:44:11.639955308 +0200
+@@ -32,10 +32,13 @@
  from optparse import OptionParser
  
  def X_is_running():
-+    from glob import glob
-     from subprocess import Popen, PIPE
+-    from subprocess import Popen, PIPE
 -    p = Popen(["xset", "-q"], stdout=PIPE, stderr=PIPE)
 -    p.communicate()
 -    return p.returncode == 0
-+    for lock in glob("/tmp/.X*-lock"):
-+        file = open(lock, "r")
-+        pid = file.read().strip()
-+        file.close()
-+        p = Popen(["ps", "-p", pid], stdout=PIPE, stderr=PIPE)
-+        p.communicate()
-+        if p.returncode == 0:
++    from gtk.gdk import Screen
++    try:
++        if Screen().get_display():
 +            return True
++    except RuntimeError:
++        pass
 +    return False
  
  try:




More information about the Python-apps-commits mailing list