From 95256fa6b19058a1bd190e5c1d80bb3a218f2742 Mon Sep 17 00:00:00 2001 From: Dave Schuyler Date: Fri, 17 Dec 2004 01:35:21 +0000 Subject: [PATCH] added secondaryFSM debugging --- direct/src/directnotify/Notifier.py | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/direct/src/directnotify/Notifier.py b/direct/src/directnotify/Notifier.py index 5b3be84967..aec54352c6 100644 --- a/direct/src/directnotify/Notifier.py +++ b/direct/src/directnotify/Notifier.py @@ -196,7 +196,8 @@ class Notifier: """ print string - def debugStateCall(self, obj=None, fsmMemberName='fsm'): + def debugStateCall(self, obj=None, fsmMemberName='fsm', + secondaryFsm='secondaryFSM'): """ If this notify is in debug mode, print the time of the call followed by the [fsm state] notifier category and @@ -204,17 +205,33 @@ class Notifier: """ if (self.__debug): state = '' + doId = '' if obj is not None: - if hasattr(obj, fsmMemberName) and obj.fsm.getCurrentState() is not None: - #state = "%s=%s"%(obj.fsm.getName(), obj.fsm.getCurrentState().getName()) - state = obj.fsm.getCurrentState().getName() + + fsm=obj.__dict__.get(fsmMemberName) + if fsm is not None: + stateObj = fsm.getCurrentState() + if stateObj is not None: + #state = "%s=%s"%(fsmMemberName, stateObj.getName()) + state = stateObj.getName() + + fsm=obj.__dict__.get(secondaryFsm) + if fsm is not None: + stateObj = fsm.getCurrentState() + if stateObj is not None: + #state = "%s=%s"%(fsmMemberName, stateObj.getName()) + state = "%s, %s"%(state, stateObj.getName()) + + if hasattr(obj, 'doId'): + doId = " doId:%s"%(obj.doId,) if 1 or type(obj) == types.ClassType: name = "%s."%(obj.__class__.__name__,) else: name = "%s "%(self.__name,) - string = ":%s [%-7s] %s %s%s"%( + string = ":%s [%-7s]%s %s %s%s"%( self.getOnlyTime(), state, + doId, id(obj), name, PythonUtil.traceParentCall())