Update of /cvsroot/freevo/freevo/src/audio/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv32662

Modified Files:
        amazon.py coversearch.py 
Log Message:
Trap ParserErrors if Amazon sends bad xml


Index: amazon.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/audio/plugins/amazon.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** amazon.py   4 Jun 2003 15:34:44 -0000       1.1
--- amazon.py   20 Jun 2003 20:51:42 -0000      1.2
***************
*** 241,245 ****
      u = urllib.FancyURLopener(proxies)
      usock = u.open(url)
!     xmldoc = minidom.parse(usock)
  
  #     from xml.dom.ext import PrettyPrint
--- 241,248 ----
      u = urllib.FancyURLopener(proxies)
      usock = u.open(url)
!     try:
!         xmldoc = minidom.parse(usock)
!     except:
!         raise ParseError
  
  #     from xml.dom.ext import PrettyPrint

Index: coversearch.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/audio/plugins/coversearch.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** coversearch.py      12 Jun 2003 23:41:11 -0000      1.5
--- coversearch.py      20 Jun 2003 20:51:42 -0000      1.6
***************
*** 14,17 ****
--- 14,20 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.6  2003/06/20 20:51:42  outlyer
+ # Trap ParserErrors if Amazon sends bad xml
+ #
  # Revision 1.5  2003/06/12 23:41:11  outlyer
  # Don't crash if no matches are found...
***************
*** 126,129 ****
--- 129,139 ----
              box.destroy() 
              box = PopupBox(text='No matches for %s - %s' % (str(artist),str(album)))
+             box.show()
+             time.sleep(2)
+             box.destroy()
+             return
+         except amazon.ParseError:
+             box.destroy()
+             box = PopupBox(text='The cover provider returned bad information.')
              box.show()
              time.sleep(2)




-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to