[Twisted-web] Re: [PATCH] nevow.static.File directory listing
missive at hotmail.com
Sun Apr 4 19:03:14 MDT 2004
>Can you explain *why* you have the following code (copied from your
> from twisted.application import service
> from twisted.application import internet
> class ADir(rend.Page):
> def locateChild(self, request, segments):
> path = '/'.join(segments)
> return static.File(path), ()
> application = service.Application('ADirlist')
> webservice = internet.TCPServer(
>What is the use case? Why not let static.File handle everything?
Well... it is certainly possible that I am going about this all wrong.
I was trying to figure out how to serve images from the nevow server to
go along with my web pages. This was the first way I figured to do that.
If there is a better way, I am certainly willing to use it.
Is this code flawed in some way? When I try to run it without that patch,
I get an error like this trying to load the root url:
2004/04/04 20:52 EDT [HTTPChannel,0,127.0.0.1] Traceback (most recent call
554, in requestReceived
line 130, in process
189, in addCallback
180, in addCallbacks
--- <exception caught here> ---
313, in _runCallbacks
self.result = callback(self.result, *args, **kw)
line 133, in <lambda>
lambda resource: inevow.IResource(resource).renderHTTP(self)
line 290, in renderHTTP
f = self.openForReading()
line 253, in openForReading
138, in open
return open(self.path, mode+'b')
exceptions.IOError: [Errno 21] Is a directory
2004/04/04 20:52 EDT [HTTPChannel,0,127.0.0.1] html is not a string: None
Tired of spam? Get advanced junk mail protection with MSN 8.
More information about the Twisted-web