Home | Trees | Indices | Help |
|
---|
|
1 # This application is released under the GNU General Public License 2 # v3 (or, at your option, any later version). You can find the full 3 # text of the license under http://www.gnu.org/licenses/gpl.txt. 4 # By using, editing and/or distributing this software you agree to 5 # the terms and conditions of this license. 6 # Thank you for using free software! 7 8 9 from AmazonCoverArtSearch import AmazonCoverArtSearch 10 from Loader import Loader 11 import os 12 13 import threading 14 import time 1517 loader = None 18 Result = False 19 artist = "" 20 album = "" 21 callback_fn = False 22 23 AlbumCover = "/tmp/nowplaying-album.jpg" 246526 self.loader = Loader() 27 self.engine = AmazonCoverArtSearch(self.loader) 28 self.Result = False 29 threading.Thread.__init__(self)30 35 4143 data = self.engine.get_best_match_urls(result) 44 if data and self.artist == artist and self.album == album: 45 #print data[0] 46 self.loader.get_url(data[0], self.saveimg)4749 if os.path.exists(self.AlbumCover): os.remove(self.AlbumCover) 50 self.Result = False 51 self.engine.search (self.artist, self.album, self.cb) 52 while True: 53 if self.Result: 54 break 55 if not self.engine.search_next (): 56 break 57 58 cover = False 59 if os.path.exists(self.AlbumCover): 60 cover = self.AlbumCover 61 62 #print threading.currentThread() 63 self.callback_fn(cover) 64 return None
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Wed Jun 4 18:53:01 2008 | http://epydoc.sourceforge.net |