dabo Commit
Revision 6819
Date: 2011-09-02 14:53:27 -0700 (Fri, 02 Sep 2011)
Author: Paul
Trac: http://trac.dabodev.com/changeset/6819
Changed:
U trunk/dabo/lib/eventMixin.py
Log:
I removed some code in raiseEvent in r6755 that I thought wasn't necessary,
but apparently it is. This commit reverts that change. The following commit
will update the comments in the affected area of the code.
Diff:
Modified: trunk/dabo/lib/eventMixin.py
===================================================================
--- trunk/dabo/lib/eventMixin.py 2011-09-02 05:35:39 UTC (rev 6818)
+++ trunk/dabo/lib/eventMixin.py 2011-09-02 21:53:27 UTC (rev 6819)
@@ -49,6 +49,21 @@
# Instantiate the event, no matter if there aren't any
bindings: the event
# did happen, after all, and perhaps we want to log that fact.
+ # self.__raisedEvents keeps track of a possible problem
identified by
+ # Vladimir. It is debug code that isn't intended to stick
around.
+ try:
+ self.__raisedEvents
+ except AttributeError:
+ self.__raisedEvents = []
+
+ eventSig = (eventClass, args, kwargs)
+ if eventSig in self.__raisedEvents:
+ # The event has already been called, for reasons we
don't understand.
+ # Just return and do nothing.
+ return None
+ else:
+ self.__raisedEvents.append(eventSig)
+
eventData = None
if "eventData" in kwargs:
eventData = kwargs["eventData"]
@@ -74,6 +89,11 @@
# The event handler set the Continue flag to
False, specifying that
# no more event handlers should process the
event.
break
+ try:
+ self.__raisedEvents.pop()
+ except (AttributeError, IndexError):
+ # This is a deleted object; no need (or ability!) to do
anything else.
+ return
if uiEvent is not None:
# Let the UI lib know whether to do the default event
behavior
_______________________________________________
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]