modules::clJamendo::Jamendo Class Reference

Module for interaction with jamendo. More...

List of all members.

Public Member Functions

def __init__
 Constructor.
def get_album_image
 Get cover image for a given album This function will download a image if it's not on disc, yet.
def set_ignore_cache
 Let the next query no be loaded from cache.
def get_ignore_cache
 Will the next query be cached?
def check
 Is a given jamendo-query-result usable?
def json_decode
 Decode a json encoded string.
def get
 Do a jamendo query This function is obsolete, run query() instead.
def cache
 Tests if a specific query can be found in cache and if it is up to date This methode is called by query() function for that you should not call this methode directly.
def query
 Query Jamendo via GET2 API Allways use this function to query jamendo - it will automatically do the caching and all the other stuff!
def last_query_hack
 This hack prevents the jamendo class from aborting the query with a "to fast" message - there should be a better solution.
def queryold
 Query Jamendo via REST API This function handles queries for jamendo's old rest api.
def get_similar_albums
 Get albums similar to the given one.
def top
 Get albums from Jamendo.
def stream
 Get stream URL for a track.
def trackinfos
 Get infos for a track Loads a plenty of track infos from jamendo.
def albuminfos_altundmaechtig
def albuminfos
def albumtracks
def artistalbums
def artistlist

Public Attributes

 cachedir
 The directory in which pyjama stores cached queries.
 cache_counter
 Counter for queries from cache.
 jamendo_counter
 Counter for queries from jamendo.
 json


Detailed Description

Module for interaction with jamendo.

Definition at line 102 of file clJamendo.py.


Member Function Documentation

def modules::clJamendo::Jamendo::cache (   self,
  query,
  CACHING_TIME = None 
)

Tests if a specific query can be found in cache and if it is up to date This methode is called by query() function for that you should not call this methode directly.

Parameters:
query The jamendo query you want to make
CACHING_TIME Must be CACHING_TIME_LONG or CACHING_TIME_SHORT from pyjama.cfg This param decides where is looked for the cached query
Returns:
  • False if query not in cache or to old
  • The cached itself when its cached

Definition at line 225 of file clJamendo.py.

def modules::clJamendo::Jamendo::check (   self,
  query 
)

Is a given jamendo-query-result usable?

Returns:
bool
Todo:
Tidy up return values

Definition at line 167 of file clJamendo.py.

def modules::clJamendo::Jamendo::get (   self,
  field,
  unit,
  params,
  format = "json" 
)

Do a jamendo query This function is obsolete, run query() instead.

Parameters:
self Object Pointer
field The fields to get (think of SELECT)
unit The table(s) from which you want to get (think of FROM)
params Additional params (think of WHERE)
format Which output format would you like to get? Use json or jsonpretty
Returns:
json string

Definition at line 207 of file clJamendo.py.

def modules::clJamendo::Jamendo::get_album_image (   self,
  album_id,
  size = 100 
)

Get cover image for a given album This function will download a image if it's not on disc, yet.

Else it will return the local uri

Parameters:
self OP
album_id Id of the album
size Size of the cover to get (default: 100)

Definition at line 138 of file clJamendo.py.

def modules::clJamendo::Jamendo::get_ignore_cache (   self  ) 

Will the next query be cached?

Returns:
bool

Definition at line 161 of file clJamendo.py.

def modules::clJamendo::Jamendo::get_similar_albums (   self,
  album_id,
  num = 5 
)

Get albums similar to the given one.

Parameters:
album_id The album to search similar albums for
Returns:
results from query()

Definition at line 384 of file clJamendo.py.

def modules::clJamendo::Jamendo::json_decode (   self,
  string 
)

Decode a json encoded string.

Parameters:
self Object Pointer
string The string to decode
Returns:
  • None if an error occured
  • The decoded string if successful

Definition at line 184 of file clJamendo.py.

def modules::clJamendo::Jamendo::query (   self,
  query,
  caching_time = None,
  raise_query_event = True 
)

Query Jamendo via GET2 API Allways use this function to query jamendo - it will automatically do the caching and all the other stuff!

Parameters:
query The Jamendo query - strip of 'http://api.jamendo.com/get2/' (!)
caching_time Must be CACHING_TIME_LONG or CACHING_TIME_SHORT from pyjama.cfg
Returns:
  • None if this query came to fast after another
  • -1 if jamendo could not be accesed
  • Dictionary if succesfull

Definition at line 289 of file clJamendo.py.

def modules::clJamendo::Jamendo::queryold (   self,
  query,
  caching_time = None,
  raise_query_event = True 
)

Query Jamendo via REST API This function handles queries for jamendo's old rest api.

Please try not to use this api.

Parameters:
query The Jamendo query - strip of 'http://api.jamendo.com/get2/' (!)
caching_time Must be CACHING_TIME_LONG or CACHING_TIME_SHORT from pyjama.cfg
Returns:
  • None if this query came to fast after another
  • -1 if jamendo could not be accesed
  • Dictionary if succesfull

Definition at line 343 of file clJamendo.py.

def modules::clJamendo::Jamendo::set_ignore_cache (   self,
  value 
)

Let the next query no be loaded from cache.

Parameters:
self Object Pointer
value Boolean If True is set, the next query will be ignored

Definition at line 156 of file clJamendo.py.

def modules::clJamendo::Jamendo::stream (   self,
  id 
)

Get stream URL for a track.

Parameters:
id The track-id
Returns:
results from query()

Definition at line 413 of file clJamendo.py.

def modules::clJamendo::Jamendo::top (   self,
  num = 10,
  order = "tag",
  page = 1,
  tag = "all" 
)

Get albums from Jamendo.

Parameters:
num Number of albums to fetch
order How the result are ordered (ratingweek, download ...)
page Which page should be fetched?
tag Only fetch albums with a particular tag
Returns:
results from query()

Definition at line 397 of file clJamendo.py.

def modules::clJamendo::Jamendo::trackinfos (   self,
  id 
)

Get infos for a track Loads a plenty of track infos from jamendo.

Parameters:
id The track id you want to query
Returns:
results from query()

Definition at line 428 of file clJamendo.py.


The documentation for this class was generated from the following file:

Generated on Thu Jun 4 19:08:24 2009 for Pyjama by  doxygen 1.5.8