dabo Commit
Revision 4072
Date: 2008-05-05 13:12:04 -0700 (Mon, 05 May 2008)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/4072

Changed:
U   trunk/dabo/ui/uiwx/dPemMixin.py

Log:
Modified _bindDelayed to handle passing an empty string to a method binding 
parameter. E.g.,

btn = dabo.ui.dButton(self, Caption="Walrus", OnClick="")

Previously this would cause a crash; now it logs the error and continues.


Diff:
Modified: trunk/dabo/ui/uiwx/dPemMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dPemMixin.py     2008-05-05 20:10:06 UTC (rev 4071)
+++ trunk/dabo/ui/uiwx/dPemMixin.py     2008-05-05 20:12:04 UTC (rev 4072)
@@ -432,6 +432,11 @@
 
        def _bindDelayed(self):
                for evt, mthdString in self._delayedEventBindings:
+                       if not mthdString:
+                               # Empty method string; this is a sign of a bug 
in the UI code.
+                               # Log it and continue
+                               dabo.errorLog.write(_("Empty Event Binding: 
Object: %s; Event: %s") % (self.Name, evt))
+                               continue
                        try:
                                mthd = eval(mthdString)
                        except (AttributeError, NameError), e:




_______________________________________________
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