From ade5993d7600b2e3efe31dc8795ffb0211a2fd36 Mon Sep 17 00:00:00 2001 From: Josh Wilson Date: Tue, 31 Oct 2006 03:33:30 +0000 Subject: [PATCH] changed way report uses notify --- direct/src/showbase/PythonUtil.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/direct/src/showbase/PythonUtil.py b/direct/src/showbase/PythonUtil.py index 6357ac6078..28bd731104 100644 --- a/direct/src/showbase/PythonUtil.py +++ b/direct/src/showbase/PythonUtil.py @@ -2393,10 +2393,12 @@ class ClassTree: return self._getStr() -def report(types = [],notifyName = None,notifyLevel = 'fatal'): +def report(types = [],notifyFunc = None): if __dev__: def decorator(f): def wrap(*args,**kwargs): + aargs = args + kkwargs = kwargs rArgs = [`x`+', ' for x in args] + [ x + ' = ' + '%s, ' % `y` for x,y in kwargs.items()] if not rArgs: @@ -2409,8 +2411,8 @@ def report(types = [],notifyName = None,notifyLevel = 'fatal'): if 'frameCount' in types: outStr = `globalClock.getFrameCount()` + ': ' + outStr - if args and notifyName: - eval('args[0].%s.%s(\'%s\')'%(notifyName,notifyLevel,outStr)) + if notifyFunc: + notifyFunc(outStr) else: print outStr