dabo Commit
Revision 4752
Date: 2008-12-02 09:44:36 -0800 (Tue, 02 Dec 2008)
Author: Paul
Trac: http://svn.dabodev.com/trac/dabo/changeset/4752

Changed:
U   trunk/dabo/lib/reportWriter.py

Log:
Fixed the bare exceptions in reportWriter.py, which Ed asked me to do way back 
in [4183].


Diff:
Modified: trunk/dabo/lib/reportWriter.py
===================================================================
--- trunk/dabo/lib/reportWriter.py      2008-12-02 17:06:25 UTC (rev 4751)
+++ trunk/dabo/lib/reportWriter.py      2008-12-02 17:44:36 UTC (rev 4752)
@@ -75,6 +75,8 @@
 
 
 class ReportObjectCollection(list):
+       """Abstract ordered list of things like variables, groups, and band 
objects."""
+
        def __init__(self, parent=None, *args, **kwargs):
                super(ReportObjectCollection, self).__init__(*args, **kwargs)
                self.parent = parent
@@ -970,8 +972,7 @@
                        c.setFillColor(fontColor)
                        try:
                                c.setFont(fontName, fontSize)
-                       except:
-                       ### FIXME
+                       except StandardError:
                                # An unavailable fontName was likely specified. 
The rw docs promise to
                                # default to Helvetica in this case.
                                c.setFont("Helvetica", fontSize)
@@ -1241,16 +1242,13 @@
                        
                        canvas.draw()
                        size = canvas.get_renderer().get_canvas_width_height()
-                       buf=canvas.tostring_rgb()
-                       im=PILImage.fromstring('RGB', size, buf, 'raw', 'RGB', 
0, 1)
+                       buf = canvas.tostring_rgb()
+                       im = PILImage.fromstring('RGB', size, buf, 'raw', 
'RGB', 0, 1)
                        im.fp = "PILIMAGE"
                        imageData = ImageReader(im)
 
-                       try:
-                               c.drawImage(imageData, 0, 0, width, height, 
mask)
-                       except:
-                       ### FIXME
-                               pass                    
+                       c.drawImage(imageData, 0, 0, width, height, mask)
+
                ## All done, restore the canvas state to how we found it 
(important because
                ## rotating, scaling, etc. are cumulative, not absolute and we 
don't want
                ## to start with a canvas in an unknown state.)
@@ -1512,8 +1510,7 @@
                                        if show is not None:
                                                try:
                                                        ev = eval(show)
-                                               except:
-                                               ### FIXME
+                                               except StandardError:
                                                        ## expression failed to 
eval: default to True (show it)
                                                        ev = True
                                                if not ev:




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]

Reply via email to