Package elisa :: Package extern :: Package coherence :: Module covers_by_amazon :: Class CoverGetter
[hide private]
[frames] | no frames]

Class CoverGetter

source code



retrieve a cover image for a given ASIN,
                           a TITLE or
                           an ARTIST/TITLE combo

parameters are:

    filename: where to save a received image
              if NONE the image will be passed to the callback
    callback: a method to call with the filename
              or the image as a parameter
              after the image request and save was successful
              can be:
              - only a callable
              - a tuple with a callable,
                  - optional an argument or a tuple of arguments
                  - optional a dict with keyword arguments
    not_found_callback: a method to call when the search at Amazon failed
              can be:
              - only a callable
              - a tuple with a callable,
                  - optional an argument or a tuple of arguments
                  - optional a dict with keyword arguments
    locale:   which Amazon Webservice Server to use, defaults to .com
    image_size: request the cover as large|medium|small image
                resolution seems to be in pixels for
                large: 500x500, medium: 160x160 and small: 75x75
    asin: the Amazon Store Identification Number
    artist: the artists name
    title: the album title

if the filename extension and the received image extension differ,
the image is converted with PIL to the desired format
http://www.pythonware.com/products/pil/index.htm



Instance Methods [hide private]
 
__init__(self, filename, aws_key, callback='frontend', not_found_callback='frontend', locale='frontend', image_size='large', title='frontend', artist='frontend', asin='frontend')
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
send_request(self, url, *args, **kwargs) source code
 
got_image(self, result, convert_from='', convert_to='') source code
 
got_response(self, result) source code
 
got_error(self, failure, url) source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, filename, aws_key, callback='frontend', not_found_callback='frontend', locale='frontend', image_size='large', title='frontend', artist='frontend', asin='frontend')
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)