forked from openlp/openlp
Format fixes, comment fixes and biblegateway.csv updated
This commit is contained in:
parent
04d4d76dcd
commit
c226979f24
@ -339,31 +339,27 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
"""
|
"""
|
||||||
Load the list of Crosswalk and BibleGateway bibles.
|
Load the list of Crosswalk and BibleGateway bibles.
|
||||||
"""
|
"""
|
||||||
# Load and store Crosswalk Bibles.
|
# Load Crosswalk Bibles.
|
||||||
filepath = AppLocation.get_directory(AppLocation.PluginsDir)
|
filepath = AppLocation.get_directory(AppLocation.PluginsDir)
|
||||||
filepath = os.path.join(filepath, u'bibles', u'resources')
|
filepath = os.path.join(filepath, u'bibles', u'resources')
|
||||||
books_file = None
|
books_file = None
|
||||||
try:
|
try:
|
||||||
self.web_bible_list[WebDownload.Crosswalk] = {}
|
self.web_bible_list[WebDownload.Crosswalk] = {}
|
||||||
books_file = open(
|
books_file = open(
|
||||||
os.path.join(filepath, u'crosswalkbooks.csv'), 'r')
|
os.path.join(filepath, u'crosswalkbooks.csv'), 'rb')
|
||||||
dialect = csv.Sniffer().sniff(books_file.read(1024))
|
dialect = csv.Sniffer().sniff(books_file.read(1024))
|
||||||
books_file.seek(0)
|
books_file.seek(0)
|
||||||
books_reader = csv.reader(books_file, dialect)
|
books_reader = csv.reader(books_file, dialect)
|
||||||
for line in books_reader:
|
for line in books_reader:
|
||||||
ver = line[0]
|
ver = unicode(line[0], u'utf-8')
|
||||||
name = line[1]
|
name = unicode(line[1], u'utf-8')
|
||||||
if not isinstance(ver, unicode):
|
|
||||||
ver = unicode(ver, u'utf8')
|
|
||||||
if not isinstance(name, unicode):
|
|
||||||
name = unicode(name, u'utf8')
|
|
||||||
self.web_bible_list[WebDownload.Crosswalk][ver] = name.strip()
|
self.web_bible_list[WebDownload.Crosswalk][ver] = name.strip()
|
||||||
except IOError:
|
except IOError:
|
||||||
log.exception(u'Crosswalk resources missing')
|
log.exception(u'Crosswalk resources missing')
|
||||||
finally:
|
finally:
|
||||||
if books_file:
|
if books_file:
|
||||||
books_file.close()
|
books_file.close()
|
||||||
# Load and store BibleGateway Bibles.
|
# Load BibleGateway Bibles.
|
||||||
books_file = None
|
books_file = None
|
||||||
try:
|
try:
|
||||||
self.web_bible_list[WebDownload.BibleGateway] = {}
|
self.web_bible_list[WebDownload.BibleGateway] = {}
|
||||||
@ -385,8 +381,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
finally:
|
finally:
|
||||||
if books_file:
|
if books_file:
|
||||||
books_file.close()
|
books_file.close()
|
||||||
|
# Load and Bibleserver Bibles.
|
||||||
# Load and store Bibleserver Bibles.
|
|
||||||
filepath = AppLocation.get_directory(AppLocation.PluginsDir)
|
filepath = AppLocation.get_directory(AppLocation.PluginsDir)
|
||||||
filepath = os.path.join(filepath, u'bibles', u'resources')
|
filepath = os.path.join(filepath, u'bibles', u'resources')
|
||||||
books_file = None
|
books_file = None
|
||||||
@ -402,7 +397,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
name = unicode(line[1], u'utf-8')
|
name = unicode(line[1], u'utf-8')
|
||||||
self.web_bible_list[WebDownload.Bibleserver][ver] = name.strip()
|
self.web_bible_list[WebDownload.Bibleserver][ver] = name.strip()
|
||||||
except IOError, UnicodeError:
|
except IOError, UnicodeError:
|
||||||
log.exception(u'Bibelserver resources could not be imported')
|
log.exception(u'Bibelserver resources missing')
|
||||||
finally:
|
finally:
|
||||||
if books_file:
|
if books_file:
|
||||||
books_file.close()
|
books_file.close()
|
||||||
|
@ -46,18 +46,18 @@ def get_reference_match(match_type):
|
|||||||
# verse range match: (<chapter>:)?<verse>(-(<chapter>:)?<verse>?)?
|
# verse range match: (<chapter>:)?<verse>(-(<chapter>:)?<verse>?)?
|
||||||
range_string = str(r'(?:(?P<from_chapter>[0-9]+)%(sep_v)s)?(?P<from_verse>'
|
range_string = str(r'(?:(?P<from_chapter>[0-9]+)%(sep_v)s)?(?P<from_verse>'
|
||||||
r'[0-9]+)(?P<range_to>%(sep_r)s(?:(?:(?P<to_chapter>[0-9]+)%(sep_v)s)?'
|
r'[0-9]+)(?P<range_to>%(sep_r)s(?:(?:(?P<to_chapter>[0-9]+)%(sep_v)s)?'
|
||||||
r'(?P<to_verse>[0-9]+)|%(sep_e)s)?)?' % separators)
|
r'(?P<to_verse>[0-9]+)|%(sep_e)s)?)?') % separators
|
||||||
if match_type == u'range':
|
if match_type == u'range':
|
||||||
return re.compile(r'^\s*' + range_string + r'\s*$', re.UNICODE)
|
return re.compile(r'^\s*' + range_string + r'\s*$', re.UNICODE)
|
||||||
elif match_type == u'range_separator':
|
elif match_type == u'range_separator':
|
||||||
return re.compile(separators[u'sep_l'])
|
return re.compile(separators[u'sep_l'])
|
||||||
elif match_type == u'full':
|
elif match_type == u'full':
|
||||||
# full reference match: <book>(<range>(,|(?=$)))+
|
# full reference match: <book>(<range>(,|(?=$)))+
|
||||||
return re.compile(str(r'^\s*(?!\s)(?P<book>[\d]*[^\d]+)(?<!\s)\s*'
|
return re.compile(str(r'^\s*(?!\s)(?P<book>[\d]*[^\d]+)(?<!\s)\s*'
|
||||||
r'(?P<ranges>(?:' + range_string + r'(?:%(sep_l)s|(?=\s*$)))+)\s*$')
|
r'(?P<ranges>(?:' + range_string + r'(?:%(sep_l)s|(?=\s*$)))+)\s*$')
|
||||||
% separators, re.UNICODE)
|
% separators, re.UNICODE)
|
||||||
else:
|
else:
|
||||||
return separators[match_type]
|
return separators[match_type]
|
||||||
|
|
||||||
def parse_reference(reference):
|
def parse_reference(reference):
|
||||||
"""
|
"""
|
||||||
@ -69,9 +69,9 @@ def parse_reference(reference):
|
|||||||
|
|
||||||
- Each reference starts with the book name. A chapter name is manditory.
|
- Each reference starts with the book name. A chapter name is manditory.
|
||||||
``John 3`` refers to Gospel of John chapter 3
|
``John 3`` refers to Gospel of John chapter 3
|
||||||
- A reference range can be given after a range seperator.
|
- A reference range can be given after a range separator.
|
||||||
``John 3-5`` refers to John chapters 3 to 5
|
``John 3-5`` refers to John chapters 3 to 5
|
||||||
- Single verses can be addressed after a verse seperator
|
- Single verses can be addressed after a verse separator
|
||||||
``John 3:16`` refers to John chapter 3 verse 16
|
``John 3:16`` refers to John chapter 3 verse 16
|
||||||
``John 3:16-4:3`` refers to John chapter 3 verse 16 to chapter 4 verse 3
|
``John 3:16-4:3`` refers to John chapter 3 verse 16 to chapter 4 verse 3
|
||||||
- After a verse reference all further single values are treat as verse in
|
- After a verse reference all further single values are treat as verse in
|
||||||
@ -82,7 +82,7 @@ def parse_reference(reference):
|
|||||||
number of verse references. It is not possible to refer to verses in
|
number of verse references. It is not possible to refer to verses in
|
||||||
additional books.
|
additional books.
|
||||||
``John 3:16,18`` refers to John chapter 3 verses 16 and 18
|
``John 3:16,18`` refers to John chapter 3 verses 16 and 18
|
||||||
``John 3:16-18,20`` refers to John chapter 3 verses 16 to 18 to 20
|
``John 3:16-18,20`` refers to John chapter 3 verses 16 to 18 and 20
|
||||||
``John 3:16-18,4:1`` refers to John chapter 3 verses 16 to 18 and
|
``John 3:16-18,4:1`` refers to John chapter 3 verses 16 to 18 and
|
||||||
chapter 3 verse 1
|
chapter 3 verse 1
|
||||||
- If there is a range separator without further verse declaration the last
|
- If there is a range separator without further verse declaration the last
|
||||||
@ -97,11 +97,11 @@ def parse_reference(reference):
|
|||||||
2. ``(?P<from_verse>[0-9]+)``
|
2. ``(?P<from_verse>[0-9]+)``
|
||||||
The verse reference ``from_verse`` is manditory
|
The verse reference ``from_verse`` is manditory
|
||||||
3. ``(?P<range_to>%(sep_r)s(?:`` ... ``|%(sep_e)s)?)?``
|
3. ``(?P<range_to>%(sep_r)s(?:`` ... ``|%(sep_e)s)?)?``
|
||||||
A ``range_to`` declaration is optional. It starts with a range seperator
|
A ``range_to`` declaration is optional. It starts with a range separator
|
||||||
and contains optional a chapter and verse declaration or a end
|
and contains optional a chapter and verse declaration or a end
|
||||||
separator.
|
separator.
|
||||||
4. ``(?:(?P<to_chapter>[0-9]+)%(sep_v)s)?``
|
4. ``(?:(?P<to_chapter>[0-9]+)%(sep_v)s)?``
|
||||||
The ``to_chapter`` reference with seperator is equivalent to group 1.
|
The ``to_chapter`` reference with separator is equivalent to group 1.
|
||||||
5. ``(?P<to_verse>[0-9]+)``
|
5. ``(?P<to_verse>[0-9]+)``
|
||||||
The ``to_verse`` reference is equivalent to group 2.
|
The ``to_verse`` reference is equivalent to group 2.
|
||||||
|
|
||||||
@ -126,7 +126,6 @@ def parse_reference(reference):
|
|||||||
|
|
||||||
Returns None or a reference list.
|
Returns None or a reference list.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
log.debug('parse_reference("%s")', reference)
|
log.debug('parse_reference("%s")', reference)
|
||||||
match = get_reference_match(u'full').match(reference)
|
match = get_reference_match(u'full').match(reference)
|
||||||
if match:
|
if match:
|
||||||
@ -135,7 +134,7 @@ def parse_reference(reference):
|
|||||||
ranges = match.group(u'ranges')
|
ranges = match.group(u'ranges')
|
||||||
range_list = get_reference_match(u'range_separator').split(ranges)
|
range_list = get_reference_match(u'range_separator').split(ranges)
|
||||||
ref_list = []
|
ref_list = []
|
||||||
chapter = 0
|
chapter = None
|
||||||
for this_range in range_list:
|
for this_range in range_list:
|
||||||
range_match = get_reference_match(u'range').match(this_range)
|
range_match = get_reference_match(u'range').match(this_range)
|
||||||
from_chapter = range_match.group(u'from_chapter')
|
from_chapter = range_match.group(u'from_chapter')
|
||||||
@ -169,6 +168,7 @@ def parse_reference(reference):
|
|||||||
to_chapter = chapter
|
to_chapter = chapter
|
||||||
else:
|
else:
|
||||||
to_chapter = to_verse
|
to_chapter = to_verse
|
||||||
|
to_verse = None
|
||||||
# Append references to the list
|
# Append references to the list
|
||||||
if has_range:
|
if has_range:
|
||||||
if not from_verse:
|
if not from_verse:
|
||||||
|
@ -250,13 +250,13 @@ class BSExtract(object):
|
|||||||
|
|
||||||
def get_bible_chapter(self, version, bookname, chapter):
|
def get_bible_chapter(self, version, bookname, chapter):
|
||||||
"""
|
"""
|
||||||
Access and decode bibles via http://m.Bibleserver.com
|
Access and decode bibles via Bibleserver mobile website
|
||||||
|
|
||||||
``version``
|
``version``
|
||||||
The version of the bible like NIV for New International Version
|
The version of the bible like NIV for New International Version
|
||||||
|
|
||||||
``bookname``
|
``bookname``
|
||||||
Text name of in english e.g. 'gen' for Genesis
|
Text name of bible book e.g. Genesis, 1. John, 1John or Offenbarung
|
||||||
|
|
||||||
``chapter``
|
``chapter``
|
||||||
Chapter number
|
Chapter number
|
||||||
@ -291,11 +291,11 @@ class BSExtract(object):
|
|||||||
finally:
|
finally:
|
||||||
if not content:
|
if not content:
|
||||||
return None
|
return None
|
||||||
verse_number = re.compile(r'v\d{5}(\d{3}) verse')
|
verse_number = re.compile(r'v(\d{2})(\d{3})(\d{3}) verse')
|
||||||
verses = {}
|
verses = {}
|
||||||
for verse in content:
|
for verse in content:
|
||||||
Receiver.send_message(u'openlp_process_events')
|
Receiver.send_message(u'openlp_process_events')
|
||||||
versenumber = int(verse_number.sub(r'\1', verse[u'class']))
|
versenumber = int(verse_number.sub(r'\3', verse[u'class']))
|
||||||
verses[versenumber] = verse.contents[1].rstrip(u'\n')
|
verses[versenumber] = verse.contents[1].rstrip(u'\n')
|
||||||
return SearchResults(bookname, chapter, verses)
|
return SearchResults(bookname, chapter, verses)
|
||||||
|
|
||||||
|
@ -312,7 +312,7 @@ class BibleManager(object):
|
|||||||
'Scripture Reference Error'),
|
'Scripture Reference Error'),
|
||||||
translate('BiblesPlugin.BibleManager', 'You did not enter a '
|
translate('BiblesPlugin.BibleManager', 'You did not enter a '
|
||||||
'search keyword.\nYou can separate different keywords by a '
|
'search keyword.\nYou can separate different keywords by a '
|
||||||
'space to search for all of your keywords and you can seperate '
|
'space to search for all of your keywords and you can separate '
|
||||||
'them by a comma to search for one of them.'))
|
'them by a comma to search for one of them.'))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -906,7 +906,6 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
``verse``
|
``verse``
|
||||||
The verse number (int).
|
The verse number (int).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
verse_separator = get_reference_match(u'sep_v_display')
|
verse_separator = get_reference_match(u'sep_v_display')
|
||||||
if not self.parent.settings_tab.show_new_chapters or \
|
if not self.parent.settings_tab.show_new_chapters or \
|
||||||
old_chapter != chapter:
|
old_chapter != chapter:
|
||||||
|
@ -1,80 +1,81 @@
|
|||||||
|
João Ferreira de Almeida Atualizada,AA
|
||||||
|
التفسير التطبيقى للكتاب المقدس,ALAB
|
||||||
|
Shqip,ALB
|
||||||
|
Amplified Bible,AMP
|
||||||
Amuzgo de Guerrero,AMU
|
Amuzgo de Guerrero,AMU
|
||||||
Arabic Life Application Bible,ALAB
|
American Standard Version,ASV
|
||||||
Bulgarian Bible,BULG
|
La Bible du Semeur,BDS
|
||||||
1940 Bulgarian Bible,BG1940
|
Български 1940,BG1940
|
||||||
Chinanteco de Comaltepec,CCO
|
Български,BULG
|
||||||
Cakchiquel Occidental,CKW
|
Chinanteco de Comaltepec,CCO
|
||||||
Haitian Creole Version,HCV
|
Contemporary English Version,CEV
|
||||||
Slovo na cestu,SNC
|
Cakchiquel Occidental,CKW
|
||||||
Dette er Biblen på dansk,DN1933
|
Hrvatski,CRO
|
||||||
Hoffnung für Alle,HOF
|
Castilian,CST
|
||||||
Luther Bibel 1545,LUTH1545
|
聖經和合本 (简体中文),CUVS
|
||||||
New International Version,NIV
|
聖經和合本 (繁体中文),CUV
|
||||||
New American Standard Bible,NASB
|
Darby Translation,DARBY
|
||||||
The Message,MSG
|
Dette er Biblen på dansk,DN1933
|
||||||
Amplified Bible,AMP
|
Det Norsk Bibelselskap 1930,DNB1930
|
||||||
New Living Translation,NLT
|
English Standard Version,ESV
|
||||||
King James Version,KJV
|
GOD’S WORD Translation,GW
|
||||||
English Standard Version,ESV
|
Holman Christian Standard Bible,HCSB
|
||||||
Contemporary English Version,CEV
|
Kreyòl ayisyen bib,HCV
|
||||||
New King James Version,NKJV
|
Hiligaynon Bible,HLGN
|
||||||
New Century Version,NCV
|
Hoffnung für Alle,HOF
|
||||||
21st Century King James Version,KJ21
|
Het Boek,HTB
|
||||||
American Standard Version,ASV
|
Icelandic Bible,ICELAND
|
||||||
Young's Literal Translation,YLT
|
Jacalteco – Oriental,JAC
|
||||||
Darby Translation,DARBY
|
Károlyi-biblia,KAR
|
||||||
Holman Christian Standard Bible,HCSB
|
Kekchi,KEK
|
||||||
New International Reader's Version,NIRV
|
21st Century King James Version,KJ21
|
||||||
Wycliffe New Testament,WYC
|
King James Version,KJV
|
||||||
Worldwide English (New Testament),WE
|
La Biblia de las Américas,LBLA
|
||||||
New International Version - UK,NIVUK
|
Levande Bibeln,LB
|
||||||
Today's New International Version,TNIV
|
La Parola è Vita,LM
|
||||||
|
La Nuova Diodati,LND
|
||||||
|
Louis Segond,LSG
|
||||||
|
Luther Bibel 1545,LUTH1545
|
||||||
|
Māori Bible,MAORI
|
||||||
|
Македонски Новиот Завет,MNT
|
||||||
|
The Message,MSG
|
||||||
|
Mam de Comitancillo Central,MVC
|
||||||
|
Mam de Todos Santos Cuchumatán,MVJ
|
||||||
|
New American Standard Bible,NASB
|
||||||
|
New Century Version,NCV
|
||||||
|
Náhuatl de Guerrero,NGU
|
||||||
|
New International Reader's Version,NIRV
|
||||||
|
New International Version 1984,NIV1984
|
||||||
|
New International Version 2010,NIV
|
||||||
|
New International Version - UK,NIVUK
|
||||||
|
New King James Version,NKJV
|
||||||
|
New Living Translation,NLT
|
||||||
|
Nádej pre kazdého,NPK
|
||||||
|
Nueva Versión Internacional,NVI
|
||||||
|
O Livro,OL
|
||||||
|
Quiché – Centro Occidental,QUT
|
||||||
|
Reimer 2001,REIMER
|
||||||
|
Română Cornilescu,RMNN
|
||||||
|
Новый перевод на русский язык,RUSV
|
||||||
|
Reina-Valera Antigua,RVA
|
||||||
Reina-Valera 1960,RVR1960
|
Reina-Valera 1960,RVR1960
|
||||||
Nueva Versión Internacional,NVI
|
Reina-Valera 1995,RVR1995
|
||||||
Reina-Valera 1995,RVR1995
|
Slovo na cestu,SNC
|
||||||
Castilian,CST
|
Ang Salita ng Diyos,SND
|
||||||
Reina-Valera Antigua,RVA
|
Swahili New Testament,SNT
|
||||||
Biblia en Lenguaje Sencillo,BLS
|
Svenska 1917,SV1917
|
||||||
La Biblia de las Américas,LBLA
|
Levande Bibeln,SVL
|
||||||
Louis Segond,LSG
|
Создать страницу,SZ
|
||||||
La Bible du Semeur,BDS
|
Traducción en lenguaje actual,TLA
|
||||||
1881 Westcott-Hort New Testament,WHNU
|
New Romanian Translation,TLCR
|
||||||
1550 Stephanus New Testament,TR1550
|
Today’s New International Version 2005,TNIV
|
||||||
1894 Scrivener New Testament,TR1894
|
Textus Receptus Stephanus 1550,TR1550
|
||||||
The Westminster Leningrad Codex,WLC
|
Textus Receptus Scrivener 1894,TR1894
|
||||||
Hiligaynon Bible,HLGN
|
Українська Біблія. Переклад Івана Огієнка,UKR
|
||||||
Croatian Bible,CRO
|
Uspanteco,USP
|
||||||
Hungarian Károli,KAR
|
Kinh Thánh tiếng Việt 1934,VIET
|
||||||
Icelandic Bible,ICELAND
|
Worldwide English (New Testament),WE
|
||||||
La Nuova Diodati,LND
|
Codex Vaticanus Westcott-Hort 1881,WHNU
|
||||||
La Parola è Vita,LM
|
Westminster Leningrad Codex,WLC
|
||||||
Jacalteco - Oriental,JAC
|
Wycliffe New Testament,WYC
|
||||||
Kekchi,KEK
|
Young's Literal Translation,YLT
|
||||||
Korean Bible,KOREAN
|
|
||||||
Maori Bible,MAORI
|
|
||||||
Macedonian New Testament,MNT
|
|
||||||
Mam - Central,MVC
|
|
||||||
Mam de Todos Santos Chuchumatán,MVJ
|
|
||||||
Reimer 2001,REIMER
|
|
||||||
Náhuatl de Guerrero,NGU
|
|
||||||
Het Boek,HTB
|
|
||||||
Det Norsk Bibelselskap 1930,DNB1930
|
|
||||||
Levande Bibeln,LB
|
|
||||||
O Livro,OL
|
|
||||||
João Ferreira de Almeida Atualizada,AA
|
|
||||||
Quiché - Centro Occidental,QUT
|
|
||||||
Romanian,RMNN
|
|
||||||
Romanian,TLCR
|
|
||||||
Russian Synodal Version,RUSV
|
|
||||||
Slovo Zhizny,SZ
|
|
||||||
Nádej pre kazdého,NPK
|
|
||||||
Albanian Bible,ALB
|
|
||||||
Levande Bibeln,SVL
|
|
||||||
Svenska 1917,SV1917
|
|
||||||
Swahili New Testament,SNT
|
|
||||||
Ang Salita ng Diyos,SND
|
|
||||||
Ukrainian Bible,UKR
|
|
||||||
Uspanteco,USP
|
|
||||||
1934 Vietnamese Bible,VIET
|
|
||||||
Chinese Union Version (Simplified),CUVS
|
|
||||||
Chinese Union Version (Traditional),CUV
|
|
||||||
|
|
@ -27,7 +27,7 @@ En Levende Bok (NOR), NOR
|
|||||||
Nádej pre kazdého, NPK
|
Nádej pre kazdého, NPK
|
||||||
Noua traducere în limba românã, NTR
|
Noua traducere în limba românã, NTR
|
||||||
Nueva Versión Internacional, NVI
|
Nueva Versión Internacional, NVI
|
||||||
Hebrew OT, OT
|
הברית הישנה, OT
|
||||||
Słowo Życia, POL
|
Słowo Życia, POL
|
||||||
O Livro, PRT
|
O Livro, PRT
|
||||||
Новый перевод на русский язык, RUS
|
Новый перевод на русский язык, RUS
|
||||||
@ -36,4 +36,4 @@ Schlachter 2000, SLT
|
|||||||
En Levande Bok (SWE), SVL
|
En Levande Bok (SWE), SVL
|
||||||
Today's New International Version, TNIV
|
Today's New International Version, TNIV
|
||||||
Türkçe, TR
|
Türkçe, TR
|
||||||
Vulgata, VUL
|
Biblia Vulgata, VUL
|
||||||
|
|
@ -24,4 +24,4 @@ New International Reader's Version,nrv
|
|||||||
The Darby Translation,dby
|
The Darby Translation,dby
|
||||||
The Webster Bible,wbt
|
The Webster Bible,wbt
|
||||||
The Latin Vulgate,vul
|
The Latin Vulgate,vul
|
||||||
Weymouth New Testament,wnt
|
Weymouth New Testament,wnt
|
||||||
|
|
Loading…
Reference in New Issue
Block a user