forked from openlp/openlp
clean ups
This commit is contained in:
parent
e17f6c7c9e
commit
919b07bd61
@ -4,7 +4,7 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
# OpenLP - Open Source Lyrics Projection #
|
# OpenLP - Open Source Lyrics Projection #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2010 Raoul Snyman #
|
# Copyright (c) 2008-2010 Raoul Snyman + #
|
||||||
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
||||||
@ -64,10 +64,10 @@ class Verse(BaseModel):
|
|||||||
|
|
||||||
def init_schema(url):
|
def init_schema(url):
|
||||||
"""
|
"""
|
||||||
Setup a bible database connection and initialise the database schema
|
Setup a bible database connection and initialise the database schema.
|
||||||
|
|
||||||
``url``
|
``url``
|
||||||
The database to setup
|
The database to setup.
|
||||||
"""
|
"""
|
||||||
session, metadata = init_db(url)
|
session, metadata = init_db(url)
|
||||||
|
|
||||||
|
@ -187,16 +187,16 @@ class BGExtract(object):
|
|||||||
|
|
||||||
def get_bible_chapter(self, version, bookname, chapter):
|
def get_bible_chapter(self, version, bookname, chapter):
|
||||||
"""
|
"""
|
||||||
Access and decode bibles via the BibleGateway website
|
Access and decode bibles via the BibleGateway website.
|
||||||
|
|
||||||
``version``
|
``version``
|
||||||
The version of the bible like 31 for New International version
|
The version of the bible like 31 for New International version.
|
||||||
|
|
||||||
``bookname``
|
``bookname``
|
||||||
Name of the Book
|
Name of the Book.
|
||||||
|
|
||||||
``chapter``
|
``chapter``
|
||||||
Chapter number
|
Chapter number.
|
||||||
"""
|
"""
|
||||||
log.debug(u'get_bible_chapter %s, %s, %s', version, bookname, chapter)
|
log.debug(u'get_bible_chapter %s, %s, %s', version, bookname, chapter)
|
||||||
url_params = urllib.urlencode(
|
url_params = urllib.urlencode(
|
||||||
@ -298,13 +298,13 @@ class CWExtract(object):
|
|||||||
versetext = versetext + part
|
versetext = versetext + part
|
||||||
elif part and part.attrMap and \
|
elif part and part.attrMap and \
|
||||||
(part.attrMap[u'class'] == u'WordsOfChrist' or \
|
(part.attrMap[u'class'] == u'WordsOfChrist' or \
|
||||||
part.attrMap[u'class'] == u'strongs'):
|
part.attrMap[u'class'] == u'strongs'):
|
||||||
for subpart in part.contents:
|
for subpart in part.contents:
|
||||||
Receiver.send_message(u'openlp_process_events')
|
Receiver.send_message(u'openlp_process_events')
|
||||||
if isinstance(subpart, NavigableString):
|
if isinstance(subpart, NavigableString):
|
||||||
versetext = versetext + subpart
|
versetext = versetext + subpart
|
||||||
elif subpart and subpart.attrMap and \
|
elif subpart and subpart.attrMap and \
|
||||||
subpart.attrMap[u'class'] == u'strongs':
|
subpart.attrMap[u'class'] == u'strongs':
|
||||||
for subsub in subpart.contents:
|
for subsub in subpart.contents:
|
||||||
Receiver.send_message(u'openlp_process_events')
|
Receiver.send_message(u'openlp_process_events')
|
||||||
if isinstance(subsub, NavigableString):
|
if isinstance(subsub, NavigableString):
|
||||||
@ -382,14 +382,14 @@ class HTTPBible(BibleDB):
|
|||||||
|
|
||||||
``reference_list``
|
``reference_list``
|
||||||
This is the list of references the media manager item wants. It is
|
This is the list of references the media manager item wants. It is
|
||||||
a list of tuples, with the following format::
|
a list of tuples, with the following format:
|
||||||
|
|
||||||
(book, chapter, start_verse, end_verse)
|
(book, chapter, start_verse, end_verse)
|
||||||
|
|
||||||
Therefore, when you are looking for multiple items, simply break
|
Therefore, when you are looking for multiple items, simply break
|
||||||
them up into references like this, bundle them into a list. This
|
them up into references like this, bundle them into a list. This
|
||||||
function then runs through the list, and returns an amalgamated
|
function then runs through the list, and returns an amalgamated
|
||||||
list of ``Verse`` objects. For example::
|
list of ``Verse`` objects. For example:
|
||||||
|
|
||||||
[(u'Genesis', 1, 1, 1), (u'Genesis', 2, 2, 3)]
|
[(u'Genesis', 1, 1, 1), (u'Genesis', 2, 2, 3)]
|
||||||
"""
|
"""
|
||||||
@ -428,7 +428,7 @@ class HTTPBible(BibleDB):
|
|||||||
|
|
||||||
def get_chapter(self, book, chapter):
|
def get_chapter(self, book, chapter):
|
||||||
"""
|
"""
|
||||||
Receive the request and call the relevant handler methods
|
Receive the request and call the relevant handler methods.
|
||||||
"""
|
"""
|
||||||
log.debug(u'get_chapter %s, %s', book, chapter)
|
log.debug(u'get_chapter %s, %s', book, chapter)
|
||||||
log.debug(u'source = %s', self.download_source)
|
log.debug(u'source = %s', self.download_source)
|
||||||
|
Loading…
Reference in New Issue
Block a user