openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #17129
[Merge] lp:~raoul-snyman/openlp/bug-1051051 into lp:openlp
Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/bug-1051051 into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Related bugs:
Bug #1051051 in OpenLP: "Error when searching Biblegateway Het Boek Bible"
https://bugs.launchpad.net/openlp/+bug/1051051
For more details, see:
https://code.launchpad.net/~raoul-snyman/openlp/bug-1051051/+merge/124507
Fix bug #1051051 where "4-5" style verses would fail. Now they are imported as "4"
--
https://code.launchpad.net/~raoul-snyman/openlp/bug-1051051/+merge/124507
Your team OpenLP Core is requested to review the proposed merge of lp:~raoul-snyman/openlp/bug-1051051 into lp:openlp.
=== modified file 'openlp/plugins/bibles/lib/http.py'
--- openlp/plugins/bibles/lib/http.py 2012-06-22 14:14:53 +0000
+++ openlp/plugins/bibles/lib/http.py 2012-09-14 20:08:26 +0000
@@ -155,7 +155,14 @@
text = text.replace(old, new)
text = u' '.join(text.split())
if verse and text:
- verses.append((int(verse.strip()), text))
+ verse = verse.strip()
+ try:
+ verse = int(verse)
+ except (TypeError, ValueError):
+ verse_parts = verse.split(u'-')
+ if len(verse_parts) > 1:
+ verse = int(verse_parts[0])
+ verses.append((verse, text))
verse_list = {}
for verse, text in verses[::-1]:
verse_list[verse] = text
Follow ups