Author: duncan
Date: Thu Dec 21 00:06:20 2006
New Revision: 8753
Modified:
branches/rel-1/freevo/src/util/fxdimdb.py
Log:
Added some mote checks that BeautifulSoup does find something
Modified: branches/rel-1/freevo/src/util/fxdimdb.py
==============================================================================
--- branches/rel-1/freevo/src/util/fxdimdb.py (original)
+++ branches/rel-1/freevo/src/util/fxdimdb.py Thu Dec 21 00:06:20 2006
@@ -637,9 +637,16 @@
for i in genres[1:]:
self.info['genre'] += ' / ' + i
rating = soup.find(text='User Rating:').parent.findNextSibling('b')
- votes = rating.next.next.strip()
- self.info['rating'] = rating.string.strip() + ' ' + votes.strip()
- self.info['runtime'] = soup.find(text='Runtime:').next.strip()
+ if rating:
+ votes = rating.next.next.strip()
+ self.info['rating'] = rating.string.strip() + ' ' + votes.strip()
+ else:
+ self.info['rating'] = ''
+ runtime = soup.find(text='Runtime:')
+ if runtime and runtime.next:
+ self.info['runtime'] = runtime.next.strip()
+ else:
+ self.info['runtime'] = ''
if config.DEBUG:
for (k,v) in self.info.items():
print 'items:', k, ':', v
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog