Add assert before notify.

This commit is contained in:
aignacio_sf 2006-10-11 20:18:31 +00:00
parent 89b4b41339
commit 19eebe69c1
2 changed files with 16 additions and 14 deletions

View File

@ -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

View File

@ -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):