*** empty log message ***

This commit is contained in:
Joe Shochet 2001-02-07 23:40:21 +00:00
parent 3fb67aef60
commit d249ff24e5
2 changed files with 29 additions and 2 deletions

View File

@ -125,10 +125,12 @@ def copyFuncs(fromClass, toClass):
newFunc = value
# See if we already have a function with this name
if toClass.__dict__.has_key(key):
# Look in the messenger to see if this old function pointer
# is stored, and update it to the new function pointer
# Look in the messenger and taskMgr to see if this
# old function pointer is stored there,
# and update it to the new function pointer
oldFunc = toClass.__dict__[key]
replaceMessengerFunc(oldFunc, newFunc)
replaceTaskMgrFunc(oldFunc, newFunc)
toClass.__dict__[key] = newFunc
def replaceMessengerFunc(oldFunc, newFunc):
@ -136,3 +138,7 @@ def replaceMessengerFunc(oldFunc, newFunc):
if res:
print ('replaced messenger function: ' + newFunc.__name__)
def replaceTaskMgrFunc(oldFunc, newFunc):
res = taskMgr.replaceMethod(oldFunc, newFunc)
if res:
print ('replaced taskMgr function: ' + newFunc.__name__)

View File

@ -290,6 +290,27 @@ class TaskManager:
# Set a flag so we will stop before beginning next frame
self.running = 0
def replaceMethod(self, oldMethod, newFunction):
import new
for task in self.taskList:
method = task.__call__
if (type(method) == types.MethodType):
function = method.im_func
else:
function = method
#print ('function: ' + `function` + '\n' +
# 'method: ' + `method` + '\n' +
# 'oldMethod: ' + `oldMethod` + '\n' +
# 'newFunction: ' + `newFunction` + '\n')
if (function == oldMethod):
newMethod = new.instancemethod(newFunction,
method.im_self,
method.im_class)
task.__call__ = newMethod
# Found it retrun true
return 1
return 0
def __repr__(self):
str = ''
str = str + 'taskList\n'