Пример #1
0
 def debugCall(self, debugString=''):
     """
     If this notify is in debug mode, print the time of the
     call followed by the notifier category and
     the function call (with parameters).
     """
     if self.__debug:
         message = str(debugString)
         string = ":%s:%s \"%s\" %s" % (self.getOnlyTime(),
                                        self.__name, message,
                                        PythonUtil.traceParentCall())
         self.__log(string)
         self.__print(string)
     return 1  # to allow assert self.notify.debugCall("blah")
Пример #2
0
 def debugCall(self, debugString=''):
     """
     If this notify is in debug mode, print the time of the
     call followed by the notifier category and
     the function call (with parameters).
     """
     if self.__debug:
         message = str(debugString)
         string = ":%s:%s \"%s\" %s"%(
             self.getOnlyTime(),
             self.__name,
             message,
             PythonUtil.traceParentCall())
         self.__log(string)
         self.__print(string)
     return 1 # to allow assert self.notify.debugCall("blah")
Пример #3
0
    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
        the function call (with parameters).
        """
        #f.f_locals['self'].__init__.im_class.__name__
        if self.__debug:
            state = ''
            doId = ''
            if obj is not None:

                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 type(obj) == types.ClassType:
            #    name = "%s."%(obj.__class__.__name__,)
            string = ":%s:%s [%-7s] id(%s)%s %s"%(
                self.getOnlyTime(),
                self.__name,
                state,
                id(obj),
                doId,
                PythonUtil.traceParentCall())
            self.__log(string)
            self.__print(string)
        return 1 # to allow assert self.notify.debugStateCall(self)
Пример #4
0
    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
        the function call (with parameters).
        """
        #f.f_locals['self'].__init__.im_class.__name__
        if self.__debug:
            state = ''
            doId = ''
            if obj is not None:

                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 type(obj) == types.ClassType:
            #    name = "%s."%(obj.__class__.__name__,)
            string = ":%s:%s [%-7s] id(%s)%s %s" % (
                self.getOnlyTime(), self.__name, state, id(obj), doId,
                PythonUtil.traceParentCall())
            self.__log(string)
            self.__print(string)
        return 1  # to allow assert self.notify.debugStateCall(self)