Jon Tibble has proposed merging lp:~meths/openlp/trivialfixes into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/46026

Make BibleServer code more robust
Fix BibleGateway code
-- 
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/46026
Your team OpenLP Core is requested to review the proposed merge of 
lp:~meths/openlp/trivialfixes into lp:openlp.
=== modified file 'openlp/plugins/bibles/lib/http.py'
--- openlp/plugins/bibles/lib/http.py	2011-01-11 23:43:27 +0000
+++ openlp/plugins/bibles/lib/http.py	2011-01-12 19:18:13 +0000
@@ -208,7 +208,8 @@
             u'version': u'%s' % version})
         cleaner = [(re.compile('&nbsp;|<br />|\'\+\''), lambda match: '')]
         soup = get_soup_for_bible_ref(
-            u'http://www.biblegateway.com/passage/?%s' % url_params, cleaner)
+            u'http://www.biblegateway.com/passage/?%s' % url_params,
+                cleaner=cleaner)
         if not soup:
             return None
         Receiver.send_message(u'openlp_process_events')
@@ -269,11 +270,12 @@
         if not soup:
             return None
         Receiver.send_message(u'openlp_process_events')
-        content = soup.find(u'div', u'content').find(u'div').findAll(u'div')
+        content = soup.find(u'div', u'content')
         if not content:
             log.exception(u'No verses found in the Bibleserver response.')
             send_error_message(u'parse')
             return None
+        content = content.find(u'div').findAll(u'div')
         verse_number = re.compile(r'v(\d{1,2})(\d{3})(\d{3}) verse')
         verses = {}
         for verse in content:

_______________________________________________
Mailing list: https://launchpad.net/~openlp-core
Post to     : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp

Reply via email to