coherence.extern (package)¶
coherence.extern.covers_by_amazon (module)¶
Covers by Amazon
methods to retrieve covers/album art via the Amazon E-Commerce WebService v4 http://docs.amazonwebservices.com/AWSECommerceService/2007-04-04/DG/
The licence agreement says something about only one request per second, so we need to serialize and delay the calls a bit.
The AWSAccessKeyId supplied is _ONLY_ for the use in conjunction with Coherence, http://coherence.beebits.net
If you use this library in your own software please apply for your own key @ http://www.amazon.com/webservices and follow the rules of their license.
Especially you must add the following disclaimer in a place that is reasonably viewable by the user of your application:
PLEASE KEEP IN MIND THAT SOME OF THE CONTENT THAT WE MAKE AVAILABLE TO YOU THROUGH THIS APPLICATION COMES FROM AMAZON WEB SERVICES. ALL SUCH CONTENT IS PROVIDED TO YOU “AS IS.” THIS CONTENT AND YOUR USE OF IT ARE SUBJECT TO CHANGE AND/OR REMOVAL AT ANY TIME.
Furthermore if you save any of the cover images you have to take care that they are stored no longer than a maximum of one month and requested then from Amazon again.
-
class
WorkQueue
(method, *args, **kwargs)[source]¶ Bases:
object
-
_instance_
= None¶
-
queue
= []¶
-
workers
= []¶
-
max_workers
= 1¶
-
-
class
CoverGetter
(filename, aws_key, callback=None, not_found_callback=None, locale=None, image_size='large', title=None, artist=None, asin=None)[source]¶ Bases:
object
- 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: 75x75asin: 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
coherence.extern.db_row (module)¶
-
getdict
(results, description)[source]¶ Return the list of DBRows in results with a given description.
coherence.extern.louie (module)¶
Wrapper module for the louie implementation
-
class
GlobalDispatcher
[source]¶ Bases:
coherence.dispatcher.Dispatcher
-
_merge_results_and_receivers
(result, receivers)¶
-
deferred_emit
(signal, *args, **kwargs)¶
-
disconnect
(receiver)¶
-
emit
(signal, *args, **kwargs)¶
-
save_emit
(signal, *args, **kwargs)¶
-
-
connect
(receiver, signal=<class 'coherence.extern.louie.All'>, sender=<class 'coherence.extern.louie.Any'>, weak=True)[source]¶
-
disconnect
(receiver, signal=<class 'coherence.extern.louie.All'>, sender=<class 'coherence.extern.louie.Any'>, weak=True)[source]¶
-
send
(signal=<class 'coherence.extern.louie.All'>, sender=<class 'coherence.extern.louie.Anonymous'>, *arguments, **named)[source]¶
-
send_minimal
(signal=<class 'coherence.extern.louie.All'>, sender=<class 'coherence.extern.louie.Anonymous'>, *arguments, **named)[source]¶
coherence.extern.simple_plugin (module)¶
real simple plugin system meant as a replacement when setuptools/pkg_resources are not available
-
class
Reception
(plugin_path=None, log=None)[source]¶ Bases:
object
singleton class which holds information about known plugins
currently a singleton, and even a class, seems to be overkill for this, but maybe we’ll add some more functionality later
initializes the class and checks in if a path is provided
-
_instance_
= None¶
-