failure with simple use of registry

Hi, I downloaded and install twisted web today. Good documentation; told me exactly what I wanted to know. However I hit a problem with using the registry though, and I reduced it to a simple test case: ------------ from twisted.web.resource import Resource class Counter: def __init__(self): self.x = 0 def ping(self): self.x += 1 return self.x counter = registry.getComponent(Counter) if not counter: counter = Counter() registry.setComponent(Counter,counter) class MyResource(Resource): def render_GET(self, request): return '<HTML>'+`counter`+'</HTML>' ------------ When I view this through a web server I get a nicely formatted backtrace for an attribute error for '__adapt__' in my Counter class when I call registry.getComponent(Counter). I'm using Red Hat Linux 9, python 2.4.1, Twisted 2.0.1, ZopeInterface 3.0.1, and TwistedWeb 0.5.0. Any ideas what I'm doing wrong, or do I have version skew in the Twisted Web dependencies? Thanks, Dickon <http://orca:8080/teststatus/counter.rpy#tbend>
participants (1)
-
Dickon Reed