Class e.c.m.MetadataManager(Manager):

Part of elisa.core.metadata_manager View In Hierarchy

The MetadataManager can be queried for a given metadata request to fill a model.

It will go sequentially through all the registered metadata capabilities that are able to handle the request until the expected metadata is filled.

Line # Kind Name Docs
51 Method register_component Register a new metadata capability.
80 Method get_metadata Try to retrieve the requested metadata and populate the model with it.

Inherited from Manager:

Line # Kind Name Docs
65 Method __init__ Undocumented
73 Method clean Undocumented
172 Method unregister_component Unregister a component.
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 register_component(self, capability):
Register a new metadata capability.

The internal list of capabilities is always kept sorted by decreasing rank.

Parameterscapabilityan instance of a metadata capability to register (type: elisa.core.components.metadata_capability.MetadataCapability )
Returnsa deferred fired when the capability is registered (type: elisa.core.utils.defer.Deferred )
def get_metadata(self, model, check_callback):
Try to retrieve the requested metadata and populate the model with it.

All the capabilities able to handle the request are tried sequentially in decreasing order of capability rank until all the requested metadata is retrieved or all the capabilities have been tried. If all the capabilities have been tried and the requested metadata remains incomplete, the IncompleteMetadataResponse exception will be raised.

Parametersmodelthe model that should be populated with the metadata (type: a subclass of elisa.core.components.model.Model )
check_callbackA function called after each capability.get_metadata was called and has answered. The only parameter is the model itself. The callback should check whether we can stop processing this model as all desired values are set (by returning True) or if the manager should keep on processing the model. (type: callable )
Returnsa deferred fired when the metadata retrieval is complete (type: elisa.core.utils.defer.Deferred )
RaisesIncompleteMetadataResponsewhen the requested metadata remains incomplete
API Documentation for Elisa Media Center, generated by pydoctor at 2009-02-16 19:15:05.