Armin Köhler has proposed merging lp:~orangeshirt/openlp/bibles_fixes into 
lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~orangeshirt/openlp/bibles_fixes/+merge/62922

Fixes problems with unicode book names on Biblegateway
Fixes download problem with first verses
-- 
https://code.launchpad.net/~orangeshirt/openlp/bibles_fixes/+merge/62922
Your team OpenLP Core is requested to review the proposed merge of 
lp:~orangeshirt/openlp/bibles_fixes into lp:openlp.
=== modified file 'openlp/plugins/bibles/lib/http.py'
--- openlp/plugins/bibles/lib/http.py	2011-05-26 20:41:19 +0000
+++ openlp/plugins/bibles/lib/http.py	2011-05-30 21:21:29 +0000
@@ -72,9 +72,8 @@
         log.debug(u'BGExtract.get_bible_chapter("%s", "%s", "%s")', version, 
             bookname, chapter)
         urlbookname = urllib.quote(bookname.encode("utf-8"))
-        url_params = urllib.urlencode(
-            {u'search': u'%s %s' % (urlbookname, chapter),
-            u'version': u'%s' % version})
+        url_params = u'search=%s+%s&version=%s' % (urlbookname, chapter, 
+            version)
         cleaner = [(re.compile('&nbsp;|<br />|\'\+\''), lambda match: '')]
         soup = get_soup_for_bible_ref(
             u'http://www.biblegateway.com/passage/?%s' % url_params,
@@ -97,7 +96,7 @@
         verse_list = {}
         # Cater for inconsistent mark up in the first verse of a chapter.
         first_verse = verses.find(u'versenum')
-        if first_verse:
+        if first_verse and 0 in first_verse.contents:
             verse_list[1] = unicode(first_verse.contents[0])
         for verse in verses(u'sup', u'versenum'):
             raw_verse_num =  verse.next

_______________________________________________
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