Package flumotion :: Package twisted :: Module rtsp :: Class RTSPResource
[hide private]

Class RTSPResource

source code

twisted.web.resource.Resource --+
                                |
          common.log.Loggable --+
                                |
                               RTSPResource
Known Subclasses:

I am a base class for all RTSP Resource classes.

Nested Classes [hide private]

Inherited from twisted.web.resource.Resource: entityType

Instance Methods [hide private]
 
getChild(self, path, request)
Retrieve a 'child' resource from me.
source code
 
getChildWithDefault(self, path, request)
Retrieve a static or dynamically generated child resource from me.
source code
 
noputChild(self, path, r) source code
 
render_startCSeqDate(self, request, method)
Set CSeq and Date on response to given request.
source code
 
render_start(self, request, method) source code
 
render_GET(self, request) source code

Inherited from twisted.web.resource.Resource: __init__, __providedBy__, delEntity, getChildForRequest, getDynamicEntity, getStaticEntity, listDynamicEntities, listDynamicNames, listEntities, listNames, listStaticEntities, listStaticNames, putChild, reallyPutEntity, render, render_HEAD

Inherited from common.log.Loggable: debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure

Class Variables [hide private]
  logCategory = 'resource'
Implementors can provide a category to log their messages under.

Inherited from twisted.web.resource.Resource: __implemented__, __provides__, isLeaf, server

Instance Variables [hide private]
tuple allowedMethods = ['OPTIONS']
a tuple of allowed methods that can be invoked on this resource.
Method Details [hide private]

getChild(self, path, request)

source code 

Retrieve a 'child' resource from me.

Implement this to create dynamic resource generation -- resources which are always available may be registered with self.putChild().

This will not be called if the class-level variable 'isLeaf' is set in your subclass; instead, the 'postpath' attribute of the request will be left as a list of the remaining path elements.

For example, the URL /foo/bar/baz will normally be:

 | site.resource.getChild('foo').getChild('bar').getChild('baz').

However, if the resource returned by 'bar' has isLeaf set to true, then the getChild call will never be made on it.

Parameters:
  • path - a string, describing the child
  • request - a twisted.web.server.Request specifying meta-information about the request that is being made for this child.
Overrides: twisted.web.resource.Resource.getChild
(inherited documentation)

getChildWithDefault(self, path, request)

source code 

Retrieve a static or dynamically generated child resource from me.

First checks if a resource was added manually by putChild, and then call getChild to check for dynamic resources. Only override if you want to affect behaviour of all child lookups, rather than just dynamic ones.

This will check to see if I have a pre-registered child resource of the given name, and call getChild if I do not.

Overrides: twisted.web.resource.Resource.getChildWithDefault
(inherited documentation)

render_startCSeqDate(self, request, method)

source code 

Set CSeq and Date on response to given request. This should be done even for errors.