[cairo-commit] pycairo/examples/cairo_snippets snippets_gtk.py, 1.4, 1.5

Steve Chaplin commit at pdx.freedesktop.org
Fri Apr 15 11:32:04 PDT 2005


Committed by: stevech1097

Update of /cvs/cairo/pycairo/examples/cairo_snippets
In directory gabe:/tmp/cvs-serv31039/examples/cairo_snippets

Modified Files:
	snippets_gtk.py 
Log Message:
SC 2005/04/15

Index: snippets_gtk.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/cairo_snippets/snippets_gtk.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- snippets_gtk.py	15 Apr 2005 03:25:37 -0000	1.4
+++ snippets_gtk.py	15 Apr 2005 18:32:02 -0000	1.5
@@ -3,6 +3,7 @@
 """
 from __future__ import division
 from math import pi as M_PI  # used by many snippets
+import sys
 
 import gtk
 import pango
@@ -97,13 +98,18 @@
             cr.fill()
             cr.set_source_rgb (0,0,0) # reset black
         
-            exec (self.snippet_str, globals(), locals())
-        
+            try:
+                exec (self.snippet_str, globals(), locals())
+            except:
+                exc_type, exc_value = sys.exc_info()[:2] 
+                print exc_type, exc_value
+
             self.ctx.restore()
 
             da.window.set_back_pixmap (self._pixmap, False)
             da.window.clear()  # draws the pixmap onto the window bg
             self._draw_pixmap = False
+            
         return True
 
 




More information about the cairo-commit mailing list