Hi,<br>
<br>
I downloaded and install twisted web today. Good documentation; told me exactly what I wanted to know.<br>
<br>
However I hit a problem with using the registry though, and I reduced it to a simple test case:<br>
<br>
------------<br>
from twisted.web.resource import Resource<br>
<br>
class Counter:<br>
&nbsp; def __init__(self):<br>
&nbsp;&nbsp;&nbsp; self.x = 0<br>
&nbsp; def ping(self):<br>
&nbsp;&nbsp;&nbsp; self.x += 1<br>
&nbsp;&nbsp;&nbsp; return self.x<br>
<br>
counter = registry.getComponent(Counter)<br>
if not counter:<br>
&nbsp; counter = Counter()<br>
&nbsp; registry.setComponent(Counter,counter)<br>
<br>
<br>
class MyResource(Resource):<br>
&nbsp; def render_GET(self, request):<br>
&nbsp;&nbsp;&nbsp; return '&lt;HTML&gt;'+`counter`+'&lt;/HTML&gt;'<br>
------------<br>
<br>
<br>
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).<br>
<br>
I'm using Red Hat Linux 9, python 2.4.1, Twisted 2.0.1, ZopeInterface 3.0.1, and TwistedWeb 0.5.0.<br>
<br>
Any ideas what I'm doing wrong, or do I have version skew in the Twisted Web dependencies?<br>
<br>
Thanks,<br>
<br>
Dickon<br>
<span style="font-family: monospace;"><br>
</span><a href="http://orca:8080/teststatus/counter.rpy#tbend"></a>