Changeset 4072

Show
Ignore:
Timestamp:
05/05/08 13:12:04 (3 months ago)
Author:
ed
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/ui/uiwx/dPemMixin.py

    r3998 r4072  
    433433    def _bindDelayed(self): 
    434434        for evt, mthdString in self._delayedEventBindings: 
     435            if not mthdString: 
     436                # Empty method string; this is a sign of a bug in the UI code. 
     437                # Log it and continue 
     438                dabo.errorLog.write(_("Empty Event Binding: Object: %s; Event: %s") % (self.Name, evt)) 
     439                continue 
    435440            try: 
    436441                mthd = eval(mthdString)