[PEAK] Strange dispatch problem after cvs up
Jay Parlar
parlar at gmail.com
Wed Apr 20 09:45:09 EDT 2005
I've been using the dispatch and protocols modules from PEAK quite
happily for a few months now, but after doing a 'cvs up' today, they
don't seem to work anymore.
I've got a class with a method marked as a [dispatch.generic()], and
now when I run my doctests I get the following:
File "outputlogic.py", line 46, in VarMgrLogic
[make_header.when("IvarmgrClass(ctrl).get_varmgr()"
File "c:\Python24\lib\site-packages\dispatch\functions.py", line 690, in when
return self._decorate(cond)
File "c:\Python24\lib\site-packages\dispatch\functions.py", line
577, in _decorate
cond = self.parseRule(cond,frame=frame) or cond
File "<string>", line 10, in parseRule
File "c:\Python24\lib\site-packages\dispatch\functions.py", line
440, in parseRule
return self.parse(rule, frame.f_locals, frame.f_globals)
File "c:\Python24\lib\site-packages\dispatch\functions.py", line 323, in parse
from dispatch.predicates import CriteriaBuilder
File "c:\Python24\Lib\site-packages\dispatch\predicates.py", line 722, in ?
[expressionSignature.when(
File "c:\Python24\Lib\site-packages\dispatch\predicates.py", line 722, in ?
[expressionSignature.when(
File "c:\Python24\lib\site-packages\protocols\advice.py", line 289, in tracer
frm.f_locals[k] = callback(frm,k,v,old_locals)
File "c:\Python24\lib\site-packages\dispatch\functions.py", line
597, in registerMethod
self.addMethod(cond,func)
File "c:\Python24\lib\site-packages\dispatch\functions.py", line
559, in addMethod
self[signature] = function
File "c:\Python24\lib\site-packages\dispatch\functions.py", line
421, in __setitem__
signature = strategy.Signature(
File "c:\Python24\lib\site-packages\dispatch\functions.py", line
500, in _dispatch_id
self.disp_indexes[disp] = criterion.node_type.make_index()
TypeError: unbound method make_index() must be called with Node
instance as first argument (got nothing instead)
make: *** [test] Error 1
The code I'm trying to dispatch with is:
[dispatch.generic()]
def make_header(self, ctrl):
'" ... "
[make_header.when("IvarmgrClass(ctrl).get_varmgr()"
" and IvarmgrClass(ctrl).get_num_indexes() == 0")]
def make_header(self, ctrl):
...
The IvarmgrClass is a PyProtocols Interface.
I'm trying to reproduce this error with code other than that from my
project, but I don't seem to be able to.
Any thoughts?
Jay P.
More information about the PEAK
mailing list