Update of /cvsroot/freevo/freevo/src/audio/plugins
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18754/src/audio/plugins

Modified Files:
        coversearch.py 
Log Message:
use fthread to be non blocking

Index: coversearch.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/audio/plugins/coversearch.py,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** coversearch.py      20 Nov 2004 18:23:00 -0000      1.37
--- coversearch.py      2 Jan 2005 11:49:05 -0000       1.38
***************
*** 14,17 ****
--- 14,20 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.38  2005/01/02 11:49:05  dischi
+ # use fthread to be non blocking
+ #
  # Revision 1.37  2004/11/20 18:23:00  dischi
  # use python logger module for debug
***************
*** 85,88 ****
--- 88,92 ----
  
  from util import amazon
+ import util.fthread as fthread
  
  import logging
***************
*** 186,191 ****
          search_string = re.sub('[\(\[].*[\)\]]', '', search_string)
          try:
!             cover = amazon.searchByKeyword(search_string ,
!                                            product_line="music")
          except amazon.AmazonError:
              box.destroy()
--- 190,195 ----
          search_string = re.sub('[\(\[].*[\)\]]', '', search_string)
          try:
!             cover = fthread.call(amazon.searchByKeyword, search_string,
!                                  product_line="music")
          except amazon.AmazonError:
              box.destroy()
***************
*** 217,221 ****
          for i in range(len(cover)):
              try:
!                 m = urllib2.urlopen(cover[i].ImageUrlLarge)
              except urllib2.HTTPError:
                  # Amazon returned a 404
--- 221,225 ----
          for i in range(len(cover)):
              try:
!                 m = fthread.call(urllib2.urlopen, cover[i].ImageUrlLarge)
              except urllib2.HTTPError:
                  # Amazon returned a 404
***************
*** 233,237 ****
                  # see if a small one is available
                  try:
!                     n = urllib2.urlopen(cover[i].ImageUrlMedium)
                  except urllib2.HTTPError:
                      MissingFile = True
--- 237,241 ----
                  # see if a small one is available
                  try:
!                     n = fthread.call(urllib2.urlopen, cover[i].ImageUrlMedium)
                  except urllib2.HTTPError:
                      MissingFile = True
***************
*** 250,254 ****
                      cover[i].ImageUrlLarge = large
                      try:
!                         n = urllib2.urlopen(cover[i].ImageUrlLarge)
  
                          if not (n.info()['Content-Length'] == '807'):
--- 254,258 ----
                      cover[i].ImageUrlLarge = large
                      try:
!                         n = fthread.call(urllib2.urlopen, 
cover[i].ImageUrlLarge)
  
                          if not (n.info()['Content-Length'] == '807'):
***************
*** 296,300 ****
              filename = '%s/cover.jpg' % (os.path.dirname(self.item.filename))
  
!         fp = urllib2.urlopen(str(arg))
          m = vfs.open(filename,'wb')
          m.write(fp.read())
--- 300,304 ----
              filename = '%s/cover.jpg' % (os.path.dirname(self.item.filename))
  
!         fp = fthread.call(urllib2.urlopen, str(arg))
          m = vfs.open(filename,'wb')
          m.write(fp.read())
***************
*** 338,342 ****
              menuw.delete_menu()
  
-         if back == 0:
-             menuw.refresh()
          box.destroy()
--- 342,345 ----
              menuw.delete_menu()
  
          box.destroy()
+         menuw.refresh()



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to