Home | Trees | Index | Help |
---|
Package twisted :: Package web :: Module static :: Class File |
|
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. | |
Get state, adding a version number to it on its way out. (inherited from Versioned )
| |
__setstate__(self,
state)
(inherited from Versioned )
| |
createPickleChild(self,
name,
child)
| |
createSimilarFile(self,
path)
| |
Remove a static reference for 'name'. (inherited from Resource )
| |
A method that determines whether an entity may be added to me. (inherited from ConfigCollection )
| |
See twisted.web.Resource.getChild. | |
(internal) Get a child of mine dependant on a particular request. (inherited from Resource )
| |
Retrieve a static or dynamically generated child resource from me. (inherited from Resource )
| |
Subclass this to generate an entity on demand. (inherited from Resource )
| |
Retrieve an entity from me. (inherited from Collection )
| |
getEntityType(self)
(inherited from ConfigCollection )
| |
Return file size. | |
getIndex(self,
request)
| |
getNameType(self)
(inherited from ConfigCollection )
| |
Get an entity that was added to me using putEntity. (inherited from Resource )
| |
ignoreExt(self,
ext)
| |
A list of all name, entity that I can generate on demand. (inherited from Resource )
| |
Retrieve a list of the names of entities that I store references to. (inherited from Resource )
| |
listEntities(self)
| |
listNames(self)
| |
Retrieve a list of all name, entity pairs that I store references to. (inherited from Resource )
| |
Retrieve a list of the names of entities that I store references to. (inherited from Resource )
| |
A method that determines whether an entity may be added to me with a given name. (inherited from Constrained )
| |
Open a file and return it. | |
Register a static child. (inherited from Resource )
| |
Store an entity if it meets both constraints. (inherited from Constrained )
| |
reallyPutEntity(self,
name,
entity)
(inherited from Resource )
| |
redirect(self,
request)
| |
Remove an entity for 'name', based on the content of 'request'. (inherited from Collection )
| |
You know what you doing. | |
Store an entity for 'name', based on the content of 'request'. (inherited from Collection )
| |
upgradeToVersion1(self)
| |
upgradeToVersion2(self)
| |
upgradeToVersion3(self)
| |
upgradeToVersion4(self)
| |
upgradeToVersion5(self)
| |
upgradeToVersion6(self)
| |
(internal) Do a version upgrade. (inherited from Versioned )
|
Class Variable Summary | |
---|---|
MetaInterface |
__implements__
|
dict |
contentEncodings
|
dict |
contentTypes
|
list |
indexNames
|
int |
persistenceVersion
|
dict |
processors
|
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. |
openForReading(self)Open a file and return it. |
render(self, request)You know what you doing. |
Class Variable Details |
---|
__implements__
|
contentEncodings
|
indexNames
|
persistenceVersion
|
processors
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 1.1 on Thu May 8 13:19:09 2003 | http://epydoc.sf.net |