Package twisted :: Package web :: Module static :: Class File

[show private | hide private]
[frames | no frames]

## Class File

    Collection --+
                 |
       Constrained --+
                     |
      ConfigCollection --+
                         |
                  Resource --+
                             |
                 Versioned --+
                             |
                            File

File is a resource that represents a plain non-interpreted file. It's constructor takes a file path.

Method Summary
| ``__init__`(self, path, defaultType, ignoredExts, registry, allowExt)` Create a file with the given path.
| ``__getstate__`(self, dict)` 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)`
| ``delEntity`(self, name)` Remove a static reference for 'name'. (inherited from `Resource`)
| ``entityConstraint`(self, entity)` A method that determines whether an entity may be added to me. (inherited from `ConfigCollection`)
| ``getChild`(self, path, request)` See twisted.web.Resource.getChild.
| ``getChildForRequest`(self, request)` (internal) Get a child of mine dependant on a particular request. (inherited from `Resource`)
| ``getChildWithDefault`(self, path, request)` (internal) Retrieve a static or dynamically generated child resource from me. (inherited from `Resource`)
| ``getDynamicEntity`(self, name, request)` Subclass this to generate an entity on demand. (inherited from `Resource`)
| ``getEntity`(self, name, request)` Retrieve an entity from me. (inherited from `Collection`)
| `getEntityType(self)` (inherited from `ConfigCollection`)
| ``getFileSize`(self)` Return file size.
| `getIndex(self, request)`
| `getNameType(self)` (inherited from `ConfigCollection`)
| ``getStaticEntity`(self, name)` Get an entity that was added to me using putEntity. (inherited from `Resource`)
| `ignoreExt(self, ext)`
| ``listDynamicEntities`(self, request)` A list of all name, entity that I can generate on demand. (inherited from `Resource`)
| ``listDynamicNames`(self)` Retrieve a list of the names of entities that I store references to. (inherited from `Resource`)
| ``listEntities`(self)` Retrieve a list of all name, entity pairs that I store references to.
| ``listNames`(self)` Retrieve a list of the names of entities that I store references to.
| ``listStaticEntities`(self)` Retrieve a list of all name, entity pairs that I store references to. (inherited from `Resource`)
| ``listStaticNames`(self)` Retrieve a list of the names of entities that I store references to. (inherited from `Resource`)
| ``nameConstraint`(self, name)` A method that determines whether an entity may be added to me with a given name. (inherited from `Constrained`)
| ``openForReading`(self)` Open a file and return it.
| ``putChild`(self, path, child)` Register a child with me. (inherited from `Resource`)
| ``putEntity`(self, name, entity)` Store an entity if it meets both constraints. (inherited from `Constrained`)
| `reallyPutEntity(self, name, entity)` (inherited from `Resource`)
| `redirect(self, request)`
| ``removeEntity`(self, name, request)` Remove an entity for 'name', based on the content of 'request'. (inherited from `Collection`)
| ``render`(self, request)` You know what you doing.
| ``storeEntity`(self, name, request)` 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)`
| ``versionUpgrade`(self)` (internal) Do a version upgrade. (inherited from `Versioned`)

Class Variable Summary
`dictionary` | `contentEncodings`
`dictionary` | `contentTypes`
`list` | `indexNames`
`class` | `IResource`
`int` | `persistenceVersion`
`dictionary` | `processors`

Method Details

### __init__(self, path, defaultType='text/html', ignoredExts=(), registry=None, allowExt=0)
(Constructor)

Create a file with the given path.

### getChild(self, path, request)

See twisted.web.Resource.getChild.

### getFileSize(self)

Return file size.

### listEntities(self)

Retrieve a list of all name, entity pairs that I store references to.

See getStaticEntity.

  Overrides:
    `twisted.web.resource.Resource.listStaticEntities` (inherited documentation)

### listNames(self)

Retrieve a list of the names of entities that I store references to.

See getStaticEntity.

  Overrides:
    `twisted.web.resource.Resource.listStaticNames` (inherited documentation)

### openForReading(self)

Open a file and return it.

### render(self, request)

You know what you doing.

Class Variable Details

### contentEncodings

  Type:
    `dictionary`
  Value:

        {'.gz': 'application/x-gzip', '.bz2': 'appliation/x-bzip2'}

### contentTypes

  Type:
    `dictionary`
  Value:

        {'.%': 'application/x-trash',
         '.323': 'text/h323',
         '.ai': 'application/postscript',
         '.aif': 'audio/x-aiff',
         '.aifc': 'audio/x-aiff',
         '.aiff': 'audio/x-aiff',
         '.art': 'image/x-jg',
         '.asc': 'text/plain',
        ...

### indexNames

  Type:
    `list`
  Value:

        ['index', 'index.html', 'index.trp', 'index.rpy']

### IResource

`IResource` = `twisted.web.resource.IResource`

### persistenceVersion

  Type:
    `int`
  Value:

        6

### processors

  Type:
    `dictionary`
  Value:

        {}

Generated by Epydoc 1.1 on Sat Feb 15 21:18:16 2003 | http://epydoc.sf.net