[Skencil-commits] r792 - skencil/branches/skencil-0.6/src/Sketch/Base

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Nov 26 14:57:16 CET 2010


Author: igor_n
Date: 2010-11-26 14:57:15 +0100 (Fri, 26 Nov 2010)
New Revision: 792

Modified:
   skencil/branches/skencil-0.6/src/Sketch/Base/gtkutils.py
Log:
improvement for cases when gtk values import is failed 

Modified: skencil/branches/skencil-0.6/src/Sketch/Base/gtkutils.py
===================================================================
--- skencil/branches/skencil-0.6/src/Sketch/Base/gtkutils.py	2010-11-22 13:54:26 UTC (rev 791)
+++ skencil/branches/skencil-0.6/src/Sketch/Base/gtkutils.py	2010-11-26 13:57:15 UTC (rev 792)
@@ -41,7 +41,8 @@
     try:
         tmpfile = NamedTemporaryFile()
         command = "import gtk;w = gtk.Window();w.realize();style=w.get_style(); print style.font_desc.to_string();"
-        os.system('python -c "%s" >%s 2>/dev/null' % (command, tmpfile.name))
+        if os.system('python -c "%s" >%s 2>/dev/null' % (command, tmpfile.name)):
+            raise Exception
         
         font = tmpfile.readline().strip()
         
@@ -228,7 +229,8 @@
             " style.bg[gtk.STATE_SELECTED].to_string()," + \
             " style.bg[gtk.STATE_INSENSITIVE].to_string();"
     
-        os.system('python -c "%s" >%s 2>/dev/null' % (command, tmpfile.name))    
+        if os.system('python -c "%s" >%s 2>/dev/null' % (command, tmpfile.name)):
+            raise Exception    
 
         for type in ["base", "text", "fg", "bg"]:
             line = tmpfile.readline().strip().split()



More information about the Skencil-commits mailing list