exception, if bibleserver.com response contains no verses

This commit is contained in:
M2j 2010-12-17 14:33:25 +01:00
parent a46ea7c4eb
commit 9c5177b0f7

View File

@ -295,7 +295,13 @@ class BSExtract(object):
if not soup: if not soup:
return None return None
Receiver.send_message(u'openlp_process_events') Receiver.send_message(u'openlp_process_events')
try:
content = soup.find(u'div', u'content').find(u'div').findAll(u'div') content = soup.find(u'div', u'content').find(u'div').findAll(u'div')
except:
log.exception(u'No verses found.')
finally:
if not content:
return None
verse_number = re.compile(r'v\d{5}(\d{3}) verse') verse_number = re.compile(r'v\d{5}(\d{3}) verse')
verses = {} verses = {}
for verse in content: for verse in content: