Class e.c.t.t.FooResourceProvider(ResourceProvider):

Part of elisa.core.tests.test_resource_manager View In Hierarchy

A stupid providers that just stores the last called method and its parameters
Line # Kind Name Docs
45 Method get Return a resource that uri is pointing to. A URI can point to
48 Method post Update the resource pointed by uri with parameters.
51 Method delete Delete a Resource represented by a URI.
54 Method put Put one resource into another. Both resources are identified with URIs.
37 Method _last_called Undocumented

Inherited from Component (via ResourceProvider):

Line # Kind Name Docs
85 Class PathDescriptor Undocumented
97 Class Method create Create and initialize the component.
130 Method initialize Initialize the component.
142 Method clean Clean the component.

Inherited from Loggable (via ResourceProvider, Component):

Line # Kind Name Docs
81 Method __init__ Undocumented
def _last_called(self, method, *args, **kw):
Undocumented
def get(self, *args, **kwargs):
Return a resource that uri is pointing to. A URI can point to any kind of resource. Resources are returned as models.

The model that is returned does not always already contain all the resource. The deferred is fired when the resource loading is complete.

ParametersuriURI pointing to the resource (type: elisa.core.media_uri.MediaUri )
context_modelthe URI often comes from a certain context. For example a URI pointing to a MusicAlbum can come from a Model that could contain the album cover or the album name. If the context_model is provided the resource_provider should try to reuse its data if possible. (type: elisa.core.components.model.Model )
Returnsa new model and a deferred fired when the model is fully loaded (type: tuple of elisa.core.components.model.Model elisa.core.utils.defer.Deferred )
def post(self, *args, **kwargs):
Update the resource pointed by uri with parameters.
ParametersuriURI pointing to the resource to update (type: elisa.core.media_uri.MediaUri )
parametersparameters of the resource that should be updated
Returnsa deferred fired when the parameters got posted (type: elisa.core.utils.defer.Deferred )
def delete(self, *args, **kwargs):
Delete a Resource represented by a URI.
ParametersuriURI pointing to the resource that should be deleted (type: elisa.media_uri.MediaUri )
Returnsa deferred fired when the resource got deleted (type: elisa.core.utils.defer.Deferred )
def put(self, *args, **kwargs):
Put one resource into another. Both resources are identified with URIs.
Parameterssource_uriURI pointing to the resource that should be put into the other one (type: elisa.core.media_uri.MediaUri )
container_uriURI pointing to the resource that should receive the resource (type: elisa.core.media_uri.MediaUri )
source_modelOften the resource behind the source_uri is already existing as a model-representation. To prevent from doing a 'get' for the given source_uri this model can also be given to the put request. (type: elisa.core.components.model.Model )
Returnsa deferred fired when the resource got put (type: elisa.core.utils.defer.Deferred )
API Documentation for Elisa Media Center, generated by pydoctor at 2009-02-16 19:15:05.