dabo Commit
Revision 1462
Date: 2005-10-17 15:21:22 -0700 (Mon, 17 Oct 2005)
Author: paul
Changed:
U trunk/dabo/dEvents.py
Log:
This is the proper fix to dEvents __getattr__(). We need to check the
EventData and return the attribute if it is there, otherwise we need
to raise the AttributeError ourselves.
This actually breaks some code, at least in datanav, that relied on
__getattr__ searching the native event directly. Try doing an
incremental search in a datanav.Grid to see one of these broken
cases. I'll go through and fix them as I find them.
Diff:
Modified: trunk/dabo/dEvents.py
===================================================================
--- trunk/dabo/dEvents.py 2005-10-17 21:59:05 UTC (rev 1461)
+++ trunk/dabo/dEvents.py 2005-10-17 22:21:22 UTC (rev 1462)
@@ -99,9 +99,10 @@
break
def __getattr__(self, att):
- if self._eventData.has_key(att):
+ if self.EventData.has_key(att):
return self._eventData[att]
- return None
+ raise AttributeError, "%s.%s object has no attribute %s." % (
+ self.__class__.__module__, self.__class__.__name__, att)
def _getContinue(self):
return self._continue
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev