# Class e.p.d.d.DiscogsResource(ResourceProvider):

Part of elisa.plugins.discogs.discogs_resource View In Hierarchy

No class docstring

Line # | Kind | Name | Docs
--- | --- | --- | ---
48 | Method | __init__ | Undocumented
52 | Method | get | Return a resource that `uri` is pointing to. A URI can point to
82 | Method | clean | Clean the component.
89 | Method | unzip | Unzip the data from the response to be further processed in parse.
100 | Method | parse | Parse xml data into model.

Inherited from ResourceProvider:

Line # | Kind | Name | Docs
--- | --- | --- | ---
94 | Method | post | Update the resource pointed by `uri` with `parameters`.
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.
130 | Method | initialize | Initialize the component.

def __init__(self):
overrides elisa.core.log.Loggable.__init__
Undocumented
def get(self, uri, model):
overrides elisa.core.components.resource_provider.ResourceProvider.get

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.

Parameters | uri | URI pointing to the resource (type: `elisa.core.media_uri.MediaUri` )
| context_model | the 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` )
Returns | a 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 clean(self):
overrides elisa.core.component.Component.clean

Clean the component.

This method is called when a component is not needed anymore to clean its state.

Returns | a deferred called when the component has finished cleaning its state (type: `twisted.internet.defer.Deferred` )

def unzip(self, data):
Unzip the data from the response to be further processed in parse.

Parameters | data | gzip compressed data from response (type: `str` )
Returns | decompressed data (type: `str` )

def parse(self, data, model):
Parse xml data into model. At the moment only the artist name and the artist pictures, with thumbnails, are used from the xml data. The parsed data is then stored in a ArtistModel which holds a `list` of `elisa.plugins.base.models.image.ImageModel`s.

Parameters | data | plain xml data from response (type: `str` )
| model | the ArtistModel that gets filled (type: `elisa.plugins.base.models.audio.ArtistModel` )
Returns | a filled ArtistModel (type: `elisa.plugins.base.models.audio.ArtistModel` )