[d-feet] import gtk early in a try except block so we catch if display is not set



commit 9fdaf44ab62a86f856db10b1b46ccd76d86abd3b
Author: John (J5) Palmieri <johnp redhat com>
Date:   Tue Nov 15 08:53:22 2011 -0500

    import gtk early in a try except block so we catch if display is not set

 d-feet |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/d-feet b/d-feet
index 8f6383f..4085bef 100755
--- a/d-feet
+++ b/d-feet
@@ -12,6 +12,13 @@
 #
 #-------------------------------------------------------------------------------
 
+try:
+    # import gtk to make sure DISPLAY is set
+    import gtk
+except Exception as e:
+    print(e)
+    exit(-1)
+
 import os, sys
 import optparse
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]