From 19eebe69c196421ccd303f416b54c18a64e32129 Mon Sep 17 00:00:00 2001 From: aignacio_sf <> Date: Wed, 11 Oct 2006 20:18:31 +0000 Subject: [PATCH] Add assert before notify. --- direct/src/interval/LerpInterval.py | 10 ++++++---- direct/src/showbase/Messenger.py | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/direct/src/interval/LerpInterval.py b/direct/src/interval/LerpInterval.py index 0bcbe73fc5..08b16865d0 100644 --- a/direct/src/interval/LerpInterval.py +++ b/direct/src/interval/LerpInterval.py @@ -39,7 +39,7 @@ class LerpNodePathInterval(CLerpNodePathInterval): # functor, false if none of them are. This is used by derived # classes to determine if a functor was passed in for a # parameter. - + for param in params: if callable(param): return 1 @@ -107,7 +107,7 @@ class LerpPosInterval(LerpNodePathInterval): self.setupParam(self.setEndPos, self.endPos) self.setupParam(self.setStartPos, self.startPos) LerpNodePathInterval.privDoEvent(self, t, event) - + class LerpHprInterval(LerpNodePathInterval): def __init__(self, nodePath, duration, hpr, @@ -630,7 +630,7 @@ class LerpFunctionInterval(Interval.Interval): if "%d" in name: name = name % LerpFunctionInterval.lerpFunctionIntervalNum LerpFunctionInterval.lerpFunctionIntervalNum += 1 - + # Initialize superclass Interval.Interval.__init__(self, name, duration) @@ -648,8 +648,10 @@ class LerpFunctionInterval(Interval.Interval): data = (self.fromData * (1 - bt)) + (self.toData * bt) # Evaluate function apply(self.function, [data] + self.extraArgs) + # Print debug information - self.notify.debug('updateFunc() - %s: t = %f' % (self.name, t)) + assert self.notify.debug('updateFunc() - %s: t = %f' % (self.name, t)) + self.state = CInterval.SStarted self.currT = t diff --git a/direct/src/showbase/Messenger.py b/direct/src/showbase/Messenger.py index deca454a08..89f9435e9f 100644 --- a/direct/src/showbase/Messenger.py +++ b/direct/src/showbase/Messenger.py @@ -72,7 +72,7 @@ class Messenger: self.notify.warning( "object: %s already accepting: %s" % (object.__class__.__name__, event)) - + acceptorDict[object] = [method, extraArgs, persistent] # Remember that this object is listening for this event @@ -159,7 +159,7 @@ class Messenger: Send this event, optionally passing in arguments """ if Messenger.notify.getDebug() and not self.quieting.get(event): - Messenger.notify.debug( + assert Messenger.notify.debug( 'sent event: ' + event + ' sentArgs: ' + `sentArgs`) if __debug__: foundWatch=0 @@ -276,10 +276,10 @@ class Messenger: """ return a matching event (needle) if found (in haystack). This is primarily a debugging tool. - + This is intended for debugging use only. This function is not defined if python is ran with -O (optimize). - + See Also: unwatch """ if not self.__watching.get(needle): @@ -290,10 +290,10 @@ class Messenger: """ return a matching event (needle) if found (in haystack). This is primarily a debugging tool. - + This is intended for debugging use only. This function is not defined if python is ran with -O (optimize). - + See Also: watch """ if self.__watching.get(needle): @@ -305,10 +305,10 @@ class Messenger: When verbose mode is on, don't spam the output with messages marked as quiet. This is primarily a debugging tool. - + This is intended for debugging use only. This function is not defined if python is ran with -O (optimize). - + See Also: unquiet """ if not self.quieting.get(message): @@ -319,10 +319,10 @@ class Messenger: Remove a message from the list of messages that are not reported in verbose mode. This is primarily a debugging tool. - + This is intended for debugging use only. This function is not defined if python is ran with -O (optimize). - + See Also: quiet """ if self.quieting.get(message):