Class n.s.File:

Part of nevow.static View Source View In Hierarchy

Implements interfaces: nevow.inevow.IResource

File is a resource that represents a plain non-interpreted file (although it can look for an extension like .rpy or .cgi and hand the file to a processor for interpretation if you wish). Its constructor takes a file path.

Alternatively, you can give a directory path to the constructor. In this case the resource will represent that directory, and its children will be files underneath that directory. This provides access to an entire filesystem tree with a single Resource.

If you map the URL 'http://server/FILE' to a resource created as File('/tmp'), then http://server/FILE/ will return an HTML-formatted listing of the /tmp/ directory, and http://server/FILE/foo/bar.html will return the contents of /tmp/foo/bar.html .
Line # Kind Name Docs
187 Method __init__ Create a file with the given path.
204 Method ignoreExt Ignore the given extension.
211 Method directoryListing Undocumented
218 Method putChild Undocumented
221 Method locateChild Locate another object which can be adapted to IResource
262 Method openForReading Open a file and return it.
266 Method getFileSize Return file size.
271 Method renderHTTP You know what you doing.
346 Method redirect Undocumented
349 Method listNames Undocumented
356 Method createSimilarFile Undocumented
def __init__(self, path, defaultType='text/html', ignoredExts=(), registry=None, allowExt=0): (source)
Create a file with the given path.
def ignoreExt(self, ext): (source)

Ignore the given extension.

Serve file.ext if file is requested
def directoryListing(self): (source)
Undocumented
def putChild(self, name, child): (source)
Undocumented
def locateChild(self, ctx, segments): (source)
Locate another object which can be adapted to IResource Return a tuple of resource, path segments
def openForReading(self): (source)
Open a file and return it.
def getFileSize(self): (source)
Return file size.
def renderHTTP(self, ctx): (source)
You know what you doing.
def redirect(self, request): (source)
Undocumented
def listNames(self): (source)
Undocumented
def createSimilarFile(self, path): (source)
Undocumented
API Documentation for Nevow, generated by pydoctor.