Class e.c.r.ResourceManager(Manager):

Part of elisa.core.resource_manager View In Hierarchy

Provide access to resources through the use of ResourceProvider components that make use of various data sources.
Line # Kind Name Docs
60 Method __init__ Undocumented
66 Method register_component Register a new component.
78 Method unregister_component Unregister a component.
94 Method get_resource_provider_by_path Return the registered resource provider that corresponds to the given
149 Method get Return a resource that uri is pointing to. A URI can point to
178 Method post Update the resource pointed by uri with parameters.
195 Method put Put one resource into another. Both resources are identified with URIs.
225 Method delete Delete the resource that uri is pointing to.
112 Method _get_resource_provider Retrieve the ResourceProvider able to handle uri.
141 Method _proxy Undocumented

Inherited from Manager:

Line # Kind Name Docs
73 Method clean Undocumented
194 Method plugin_status_changed_cb Callback meant to be invoked (by the plugin registry) when the status
70 Method _clean_component Undocumented
77 Method _load_components Asynchronously load and register a list of components.
117 Method _unload_components Asynchronously unregister and unload a list of components.
def __init__(self):
Undocumented
def register_component(self, component):
Register a new component.

When trying to register a component twice, an AlreadyRegistered failure will be returned.

Parameterscomponentthe component to register (type: elisa.core.component.Component )
Returnsa deferred fired when the component is registered (type: elisa.core.utils.defer.Deferred )
def unregister_component(self, component):
Unregister a component.

When trying to unregister a component that is not registered, a CannotUnregister failure will be returned.

Parameterscomponentthe component to unregister (type: elisa.core.component.Component )
Returnsa deferred fired when the component is unregistered (type: elisa.core.utils.defer.Deferred )
def get_resource_provider_by_path(self, path):
Return the registered resource provider that corresponds to the given component path.

This method should not be called to gain direct access to a resource provider, it is meant to be called only by capabilities at initialization time (capabilities need a reference to their "parent" resource provider).

Parameterspaththe full component path for the resource provider (type: str )
def _get_resource_provider(self, uri):
Retrieve the ResourceProvider able to handle uri. If multiple ResourceProviders support it, the first one found is returned.
Parametersurilocation that will be passed to the resource provider returned (type: elisa.core.media_uri.MediaUri )
Returns (type: elisa.core.components.resource_provider.ResourceProvider )
RaisesNoMatchingResourceProviderin case no ResourceProvider has a matching regular expression
def _proxy(self, method_name, uri, *args, **kw):
Undocumented
def get(self, uri, context_model=None):
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 )
RaisesNoMatchingResourceProviderin case no ResourceProvider has a matching regular expression for uri
def post(self, uri, **parameters):
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 )
RaisesNoMatchingResourceProviderin case no ResourceProvider has a matching regular expression for uri
def put(self, source_uri, container_uri, source_model=None, **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 already exists as a Model. In order to avoid retrieving the resource pointed by source_uri that model can be passed to the put request (type: elisa.core.components.model.Model )
kwargsresource provider specific keyword options
Returnsa deferred fired when the resource got put (type: elisa.core.utils.defer.Deferred )
RaisesNoMatchingResourceProviderin case no ResourceProvider has a matching regular expression for the container_uri
def delete(self, uri):
Delete the resource that uri is pointing to.
ParametersuriURI pointing to the resource that should be deleted (type: elisa.core.media_uri.MediaUri )
Returnsa deferred fired when the resource got deleted (type: elisa.core.utils.defer.Deferred )
RaisesNoMatchingResourceProviderin case no ResourceProvider has a matching regular expression for uri
API Documentation for Elisa Media Center, generated by pydoctor at 2009-02-16 19:15:05.