[Twisted-web] [PATCH] nevow.static.File directory listing

Lee Harr missive at hotmail.com
Fri Apr 2 20:40:57 MST 2004


I was getting an infinitely recursive redirect trying to do something
like this ...



from nevow import rend, static
from nevow import appserver

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(
    8080,
    appserver.NevowSite(ADir())
)
webservice.setServiceParent(application)




This patch to nevow.static.File fixes the problem for me.

274c274,279
<             return self.redirect(request)
---
>             return dirlist.DirectoryLister(self.fp.path,
>                                             None,
>                                             self.contentTypes,
>                                             self.contentEncodings,
>                                             self.defaultType)
>             #return self.redirect(request)

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail




More information about the Twisted-web mailing list