Class e.p.y.y.YesfmResource(ResourceProvider):

Part of elisa.plugins.yesfm.yesfm_resource View In Hierarchy

This resource provider makes the Content of Yes.FM available inside elisa. It uses the public JSON-RPC-API. See #FIXME: ADD PATH for more informations.
Line # Kind Name Docs
141 Method __init__ Undocumented
147 Method initialize Initialize the component.
160 Method clean Clean the component.
177 Method login Undocumented
221 Method get Return a resource that uri is pointing to. A URI can point to
245 Method post Post certain data to the YesfmResource provider. Currently only two
305 Method get_model_for_uri_path Create the model corresponding to the given URI path.
348 Method parse_data_into_model Parse the data into the given model.
152 Method _local_initialize Undocumented
281 Method _get_raw Undocumented
401 Method _parse_list_of_data Undocumented
407 Method _rip_out Undocumented
413 Method _parse_picture Undocumented
423 Method _parse_simple Undocumented
437 Method _send_simple_request Undocumented
441 Method _send_request Undocumented
452 Method _parse_response Undocumented
461 Method _parse_raw Undocumented
467 Method _login_error Undocumented
476 Method _set_session_from_login Undocumented
487 Method _init_login_error Undocumented
491 Method _login_response Undocumented

Inherited from ResourceProvider:

Line # Kind Name Docs
107 Method put Put one resource into another. Both resources are identified with URIs.
129 Method delete Delete a Resource represented by a URI.

Inherited from Component (via ResourceProvider):

Line # Kind Name Docs
85 Class PathDescriptor Undocumented
97 Class Method create Create and initialize the component.
def __init__(self):
Undocumented
def initialize(self):

Initialize the component.

This method is called by Component.create to finish the initialization of a component.
Returnsa deferred called when a component is fully initialized (type: twisted.internet.defer.Deferred )
def _local_initialize(self, result):
Undocumented
def clean(self):

Clean the component.

This method is called when a component is not needed anymore to clean its state.
Returnsa deferred called when the component has finished cleaning its state (type: twisted.internet.defer.Deferred )
def login(self, user=None, password=None, userkey=None):
Undocumented
def get(self, uri, context_model):

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, uri, **postdata):
Post certain data to the YesfmResource provider. Currently only two URIs are supported:
  • /v1/auth/login : to try a login. The keyword for that need to be: user and password. Returns a elisa.plugins.search.models.LoginModel
  • / : allows to set 'sessionkey' and/or 'userkey'. Does not return anything.
def _get_raw(self, uri):
Undocumented
def get_model_for_uri_path(self, uri_path):

Create the model corresponding to the given URI path.

*Attention*: the uri_path is meant to start with /v1/. The next word after that decides about the model. See PATH_TO_MODEL to find out for which one. A sepcial case is the 'search' keyword as it has sub-classes. For search/artist/.. a ArtistsSearchResultModel will be created. For search/albums/.. a AlbumsSearchResultModel will be created.
Parametersuri_paththe path to the resource on the API-Server (type: str )
def parse_data_into_model(self, data, model):
Parse the data into the given model.
Parametersdata (type: dictionary )
modelthe model to parse the data into (type: Subclass of elisa.core.compontents.model.Model )
def _parse_list_of_data(self, ref_list, list_to_fill, klass):
Undocumented
def _rip_out(self, data, ripper):
Undocumented
def _parse_picture(self, data):
Undocumented
def _parse_simple(self, model, data, key_map, callback):
Undocumented
def _send_simple_request(self, uri):
Undocumented
def _send_request(self, request):
Undocumented
def _parse_response(self, response):
Undocumented
def _parse_raw(self, response_data, model):
Undocumented
def _login_error(self, failure, model):
Undocumented
def _set_session_from_login(self, model):
Undocumented
def _init_login_error(self, failure):
Undocumented
def _login_response(self, response_data, model, store=False):
Undocumented
API Documentation for Elisa Media Center, generated by pydoctor at 2008-11-03 19:10:55.