forked from openlp/openlp
Jon missed these
This commit is contained in:
parent
4aae4fa317
commit
ce7857fd66
@ -28,7 +28,7 @@ from common import BibleCommon, SearchResults
|
|||||||
|
|
||||||
class BGExtract(BibleCommon):
|
class BGExtract(BibleCommon):
|
||||||
global log
|
global log
|
||||||
log=logging.getLogger(u'BibleHTTPMgr(BG_extract)')
|
log = logging.getLogger(u'BibleHTTPMgr(BG_extract)')
|
||||||
log.info(u'BG_extract loaded')
|
log.info(u'BG_extract loaded')
|
||||||
|
|
||||||
def __init__(self, proxyurl= None):
|
def __init__(self, proxyurl= None):
|
||||||
@ -65,7 +65,7 @@ class BGExtract(BibleCommon):
|
|||||||
bible = {}
|
bible = {}
|
||||||
while versePos > -1:
|
while versePos > -1:
|
||||||
# clear out string
|
# clear out string
|
||||||
verseText = ''
|
verseText = u''
|
||||||
versePos = xml_string.find(u'</span', versePos)
|
versePos = xml_string.find(u'</span', versePos)
|
||||||
i = xml_string.find(VerseSearch, versePos+1)
|
i = xml_string.find(VerseSearch, versePos+1)
|
||||||
if i == -1:
|
if i == -1:
|
||||||
@ -121,8 +121,8 @@ class CWExtract(BibleCommon):
|
|||||||
xml_string = self._get_web_text(urlstring, self.proxyurl)
|
xml_string = self._get_web_text(urlstring, self.proxyurl)
|
||||||
## Strip Book Title from Heading to return it to system
|
## Strip Book Title from Heading to return it to system
|
||||||
##
|
##
|
||||||
i= xml_string.find(u'<title>')
|
i = xml_string.find(u'<title>')
|
||||||
j= xml_string.find(u'-', i)
|
j = xml_string.find(u'-', i)
|
||||||
book_title = xml_string[i + 7:j]
|
book_title = xml_string[i + 7:j]
|
||||||
book_title = book_title.rstrip()
|
book_title = book_title.rstrip()
|
||||||
log.debug(u'Book Title %s', book_title)
|
log.debug(u'Book Title %s', book_title)
|
||||||
@ -133,15 +133,15 @@ class CWExtract(BibleCommon):
|
|||||||
log.debug(u'Book Chapter %s', book_chapter)
|
log.debug(u'Book Chapter %s', book_chapter)
|
||||||
# Strip Verse Data from Page and build an array
|
# Strip Verse Data from Page and build an array
|
||||||
|
|
||||||
i= xml_string.find(u'NavCurrentChapter')
|
i = xml_string.find(u'NavCurrentChapter')
|
||||||
xml_string = xml_string[i:len(xml_string)]
|
xml_string = xml_string[i:len(xml_string)]
|
||||||
i= xml_string.find(u'<TABLE')
|
i = xml_string.find(u'<TABLE')
|
||||||
xml_string = xml_string[i:len(xml_string)]
|
xml_string = xml_string[i:len(xml_string)]
|
||||||
i= xml_string.find(u'<B>')
|
i = xml_string.find(u'<B>')
|
||||||
#remove the <B> at the front
|
#remove the <B> at the front
|
||||||
xml_string = xml_string[i + 3 :len(xml_string)]
|
xml_string = xml_string[i + 3 :len(xml_string)]
|
||||||
# Remove the heading for the book
|
# Remove the heading for the book
|
||||||
i= xml_string.find(u'<B>')
|
i = xml_string.find(u'<B>')
|
||||||
#remove the <B> at the front
|
#remove the <B> at the front
|
||||||
xml_string = xml_string[i + 3 :len(xml_string)]
|
xml_string = xml_string[i + 3 :len(xml_string)]
|
||||||
versePos = xml_string.find(u'<BLOCKQUOTE>')
|
versePos = xml_string.find(u'<BLOCKQUOTE>')
|
||||||
@ -151,7 +151,7 @@ class CWExtract(BibleCommon):
|
|||||||
versePos = xml_string.find(u'<B><I>', versePos) + 6
|
versePos = xml_string.find(u'<B><I>', versePos) + 6
|
||||||
i = xml_string.find(u'</I></B>', versePos)
|
i = xml_string.find(u'</I></B>', versePos)
|
||||||
# Got the Chapter
|
# Got the Chapter
|
||||||
verse= xml_string[versePos:i]
|
verse = xml_string[versePos:i]
|
||||||
# move the starting position to begining of the text
|
# move the starting position to begining of the text
|
||||||
versePos = i + 8
|
versePos = i + 8
|
||||||
# find the start of the next verse
|
# find the start of the next verse
|
||||||
@ -180,8 +180,7 @@ class BibleHTTPImpl():
|
|||||||
|
|
||||||
Init confirms the bible exists and stores the database path.
|
Init confirms the bible exists and stores the database path.
|
||||||
"""
|
"""
|
||||||
#bible = {}
|
self.biblesource = u''
|
||||||
self.biblesource = ''
|
|
||||||
self.proxyurl = None
|
self.proxyurl = None
|
||||||
self.bibleid = None
|
self.bibleid = None
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ class BibleOSISImpl():
|
|||||||
filepath = os.path.split(os.path.abspath(__file__))[0]
|
filepath = os.path.split(os.path.abspath(__file__))[0]
|
||||||
filepath = os.path.abspath(os.path.join(
|
filepath = os.path.abspath(os.path.join(
|
||||||
filepath, u'..', u'resources',u'osisbooks.csv'))
|
filepath, u'..', u'resources',u'osisbooks.csv'))
|
||||||
fbibles=open(filepath, u'r')
|
fbibles = open(filepath, u'r')
|
||||||
for line in fbibles:
|
for line in fbibles:
|
||||||
p = line.split(u',')
|
p = line.split(u',')
|
||||||
self.booksOfBible[p[0]] = p[1].replace(u'\n', u'')
|
self.booksOfBible[p[0]] = p[1].replace(u'\n', u'')
|
||||||
@ -99,9 +99,11 @@ class BibleOSISImpl():
|
|||||||
if self.loadbible == False:
|
if self.loadbible == False:
|
||||||
break
|
break
|
||||||
pos = file_record.find(verseText)
|
pos = file_record.find(verseText)
|
||||||
if pos > -1: # we have a verse
|
# we have a verse
|
||||||
epos= file_record.find(u'>', pos)
|
if pos > -1:
|
||||||
ref = file_record[pos+15:epos-1] # Book Reference
|
epos = file_record.find(u'>', pos)
|
||||||
|
# Book Reference
|
||||||
|
ref = file_record[pos+15:epos-1]
|
||||||
#lets find the bible text only
|
#lets find the bible text only
|
||||||
# find start of text
|
# find start of text
|
||||||
pos = epos + 1
|
pos = epos + 1
|
||||||
|
Loading…
Reference in New Issue
Block a user