Home | Trees | Index | Help |
|
---|
Package twisted :: Package web :: Module static :: Class File |
|
FilePath
--+ |Collection
--+ | | |Constrained
--+ | | |ConfigCollection
--+ | | |Resource
--+ |Versioned
--+ | File
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 .Method Summary | |
---|---|
Create a file with the given path. | |
createPickleChild(self,
name,
child)
| |
createSimilarFile(self,
path)
| |
directoryListing(self)
| |
See twisted.web.Resource.getChild. | |
Return file size. | |
Ignore the given extension. | |
listEntities(self)
| |
listNames(self)
| |
Open a file and return it. | |
redirect(self,
request)
| |
You know what you doing. | |
upgradeToVersion1(self)
| |
upgradeToVersion2(self)
| |
upgradeToVersion3(self)
| |
upgradeToVersion4(self)
| |
upgradeToVersion5(self)
| |
upgradeToVersion6(self)
| |
Inherited from Resource | |
Remove a static reference for 'name'. | |
(internal) Get a child of mine dependant on a particular request. | |
Retrieve a static or dynamically generated child resource from me. | |
Subclass this to generate an entity on demand. | |
Get an entity that was added to me using putEntity. | |
A list of all name, entity that I can generate on demand. | |
Retrieve a list of the names of entities that I store references to. | |
Retrieve a list of all name, entity pairs that I store references to. | |
Retrieve a list of the names of entities that I store references to. | |
Register a static child. | |
| |
Inherited from ConfigCollection | |
A method that determines whether an entity may be added to me. | |
| |
| |
Inherited from Constrained | |
A method that determines whether an entity may be added to me with a given name. | |
Store an entity if it meets both constraints. | |
Inherited from Collection | |
Retrieve an entity from me. | |
Remove an entity for 'name', based on the content of 'request'. | |
Store an entity for 'name', based on the content of 'request'. | |
Inherited from Versioned | |
Get state, adding a version number to it on its way out. | |
| |
(internal) Do a version upgrade. | |
Inherited from FilePath | |
| |
| |
| |
Return my first existing child with a name in 'paths'. | |
| |
| |
| |
| |
| |
| |
Assuming I am representing a directory, return a list of FilePaths representing my children that match the given pattern. | |
| |
| |
| |
| |
| |
| |
| |
Use me if `path' might have slashes in it, but you know they're safe. | |
| |
| |
| |
| |
Attempt to return a path with my name, given multiple possible extensions. | |
| |
|
Class Variable Summary | |
---|---|
class |
__implements__ = twisted.web.resource.IResource |
class |
_directoryLister = twisted.web.woven.dirlist.DirectoryLister |
NoResource |
childNotFound : Resource used to render 404 Not Found error pages. |
dict |
contentEncodings = {'.bz2': 'appliation/x-bzip2', '.gz':...
|
dict |
contentTypes = {'.rm': 'audio/x-pn-realaudio', '.obj': '...
|
list |
indexNames = ['index', 'index.html', 'index.htm', 'index...
|
int |
persistenceVersion = 6 |
dict |
processors = {}
|
NoneType |
type = None |
Inherited from Resource | |
int |
isLeaf = 0 |
NoneType |
server = None |
Inherited from Versioned | |
tuple |
persistenceForgets = ()
|
Inherited from FilePath | |
NoneType |
statinfo = None |
Method Details |
---|
__init__(self,
path,
defaultType='text/html',
ignoredExts=(),
registry=None,
allowExt=0)
Create a file with the given path.
|
getChild(self, path, request)See twisted.web.Resource.getChild.
|
getFileSize(self)Return file size. |
ignoreExt(self, ext)Ignore the given extension. Serve file.ext if file is requested |
openForReading(self)Open a file and return it. |
render(self, request)You know what you doing.
|
Class Variable Details |
---|
childNotFoundResource used to render 404 Not Found error pages.
|
contentEncodings
|
indexNames
|
persistenceVersion
|
processors
|
type
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.0 on Sat Sep 13 04:20:55 2003 | http://epydoc.sf.net |