Format fixes, comment fixes and biblegateway.csv updated

This commit is contained in:
M2j 2010-12-17 23:10:29 +01:00
parent 04d4d76dcd
commit c226979f24
8 changed files with 105 additions and 110 deletions

View File

@ -339,31 +339,27 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard):
"""
Load the list of Crosswalk and BibleGateway bibles.
"""
# Load and store Crosswalk Bibles.
# Load Crosswalk Bibles.
filepath = AppLocation.get_directory(AppLocation.PluginsDir)
filepath = os.path.join(filepath, u'bibles', u'resources')
books_file = None
try:
self.web_bible_list[WebDownload.Crosswalk] = {}
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))
books_file.seek(0)
books_reader = csv.reader(books_file, dialect)
for line in books_reader:
ver = line[0]
name = line[1]
if not isinstance(ver, unicode):
ver = unicode(ver, u'utf8')
if not isinstance(name, unicode):
name = unicode(name, u'utf8')
ver = unicode(line[0], u'utf-8')
name = unicode(line[1], u'utf-8')
self.web_bible_list[WebDownload.Crosswalk][ver] = name.strip()
except IOError:
log.exception(u'Crosswalk resources missing')
finally:
if books_file:
books_file.close()
# Load and store BibleGateway Bibles.
# Load BibleGateway Bibles.
books_file = None
try:
self.web_bible_list[WebDownload.BibleGateway] = {}
@ -385,8 +381,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard):
finally:
if books_file:
books_file.close()
# Load and store Bibleserver Bibles.
# Load and Bibleserver Bibles.
filepath = AppLocation.get_directory(AppLocation.PluginsDir)
filepath = os.path.join(filepath, u'bibles', u'resources')
books_file = None
@ -402,7 +397,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard):
name = unicode(line[1], u'utf-8')
self.web_bible_list[WebDownload.Bibleserver][ver] = name.strip()
except IOError, UnicodeError:
log.exception(u'Bibelserver resources could not be imported')
log.exception(u'Bibelserver resources missing')
finally:
if books_file:
books_file.close()

View File

@ -46,7 +46,7 @@ def get_reference_match(match_type):
# verse range match: (<chapter>:)?<verse>(-(<chapter>:)?<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'(?P<to_verse>[0-9]+)|%(sep_e)s)?)?' % separators)
r'(?P<to_verse>[0-9]+)|%(sep_e)s)?)?') % separators
if match_type == u'range':
return re.compile(r'^\s*' + range_string + r'\s*$', re.UNICODE)
elif match_type == u'range_separator':
@ -69,9 +69,9 @@ def parse_reference(reference):
- Each reference starts with the book name. A chapter name is manditory.
``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
- 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-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
@ -82,7 +82,7 @@ def parse_reference(reference):
number of verse references. It is not possible to refer to verses in
additional books.
``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
chapter 3 verse 1
- 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]+)``
The verse reference ``from_verse`` is manditory
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
separator.
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]+)``
The ``to_verse`` reference is equivalent to group 2.
@ -126,7 +126,6 @@ def parse_reference(reference):
Returns None or a reference list.
"""
log.debug('parse_reference("%s")', reference)
match = get_reference_match(u'full').match(reference)
if match:
@ -135,7 +134,7 @@ def parse_reference(reference):
ranges = match.group(u'ranges')
range_list = get_reference_match(u'range_separator').split(ranges)
ref_list = []
chapter = 0
chapter = None
for this_range in range_list:
range_match = get_reference_match(u'range').match(this_range)
from_chapter = range_match.group(u'from_chapter')
@ -169,6 +168,7 @@ def parse_reference(reference):
to_chapter = chapter
else:
to_chapter = to_verse
to_verse = None
# Append references to the list
if has_range:
if not from_verse:

View File

@ -250,13 +250,13 @@ class BSExtract(object):
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``
The version of the bible like NIV for New International Version
``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 number
@ -291,11 +291,11 @@ class BSExtract(object):
finally:
if not content:
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 = {}
for verse in content:
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')
return SearchResults(bookname, chapter, verses)

View File

@ -312,7 +312,7 @@ class BibleManager(object):
'Scripture Reference Error'),
translate('BiblesPlugin.BibleManager', 'You did not enter 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.'))
return None

View File

@ -906,7 +906,6 @@ class BibleMediaItem(MediaManagerItem):
``verse``
The verse number (int).
"""
verse_separator = get_reference_match(u'sep_v_display')
if not self.parent.settings_tab.show_new_chapters or \
old_chapter != chapter:

View File

@ -1,80 +1,81 @@
Amuzgo de Guerrero,AMU
Arabic Life Application Bible,ALAB
Bulgarian Bible,BULG
1940 Bulgarian Bible,BG1940
Chinanteco de Comaltepec,CCO
Cakchiquel Occidental,CKW
Haitian Creole Version,HCV
Slovo na cestu,SNC
Dette er Biblen på dansk,DN1933
Hoffnung für Alle,HOF
Luther Bibel 1545,LUTH1545
New International Version,NIV
New American Standard Bible,NASB
The Message,MSG
Amplified Bible,AMP
New Living Translation,NLT
King James Version,KJV
English Standard Version,ESV
Contemporary English Version,CEV
New King James Version,NKJV
New Century Version,NCV
21st Century King James Version,KJ21
American Standard Version,ASV
Young's Literal Translation,YLT
Darby Translation,DARBY
Holman Christian Standard Bible,HCSB
New International Reader's Version,NIRV
Wycliffe New Testament,WYC
Worldwide English (New Testament),WE
New International Version - UK,NIVUK
Today's New International Version,TNIV
Reina-Valera 1960,RVR1960
Nueva Versión Internacional,NVI
Reina-Valera 1995,RVR1995
Castilian,CST
Reina-Valera Antigua,RVA
Biblia en Lenguaje Sencillo,BLS
La Biblia de las Américas,LBLA
Louis Segond,LSG
La Bible du Semeur,BDS
1881 Westcott-Hort New Testament,WHNU
1550 Stephanus New Testament,TR1550
1894 Scrivener New Testament,TR1894
The Westminster Leningrad Codex,WLC
Hiligaynon Bible,HLGN
Croatian Bible,CRO
Hungarian Károli,KAR
Icelandic Bible,ICELAND
La Nuova Diodati,LND
La Parola è Vita,LM
Jacalteco - Oriental,JAC
Kekchi,KEK
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
التفسير التطبيقى للكتاب المقدس,ALAB
Shqip,ALB
Amplified Bible,AMP
Amuzgo de Guerrero,AMU
American Standard Version,ASV
La Bible du Semeur,BDS
Български 1940,BG1940
Български,BULG
Chinanteco de Comaltepec,CCO
Contemporary English Version,CEV
Cakchiquel Occidental,CKW
Hrvatski,CRO
Castilian,CST
聖經和合本 (简体中文),CUVS
聖經和合本 (繁体中文),CUV
Darby Translation,DARBY
Dette er Biblen på dansk,DN1933
Det Norsk Bibelselskap 1930,DNB1930
English Standard Version,ESV
GODS WORD Translation,GW
Holman Christian Standard Bible,HCSB
Kreyòl ayisyen bib,HCV
Hiligaynon Bible,HLGN
Hoffnung für Alle,HOF
Het Boek,HTB
Icelandic Bible,ICELAND
Jacalteco Oriental,JAC
Károlyi-biblia,KAR
Kekchi,KEK
21st Century King James Version,KJ21
King James Version,KJV
La Biblia de las Américas,LBLA
Levande Bibeln,LB
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
Albanian Bible,ALB
Levande Bibeln,SVL
Svenska 1917,SV1917
Swahili New Testament,SNT
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 1995,RVR1995
Slovo na cestu,SNC
Ang Salita ng Diyos,SND
Ukrainian Bible,UKR
Swahili New Testament,SNT
Svenska 1917,SV1917
Levande Bibeln,SVL
Создать страницу,SZ
Traducción en lenguaje actual,TLA
New Romanian Translation,TLCR
Todays New International Version 2005,TNIV
Textus Receptus Stephanus 1550,TR1550
Textus Receptus Scrivener 1894,TR1894
Українська Біблія. Переклад Івана Огієнка,UKR
Uspanteco,USP
1934 Vietnamese Bible,VIET
Chinese Union Version (Simplified),CUVS
Chinese Union Version (Traditional),CUV
Kinh Thánh tiếng Việt 1934,VIET
Worldwide English (New Testament),WE
Codex Vaticanus Westcott-Hort 1881,WHNU
Westminster Leningrad Codex,WLC
Wycliffe New Testament,WYC
Young's Literal Translation,YLT

1 Amuzgo de Guerrero João Ferreira de Almeida Atualizada AMU AA
Amuzgo de Guerrero AMU
Arabic Life Application Bible ALAB
Bulgarian Bible BULG
1940 Bulgarian Bible BG1940
Chinanteco de Comaltepec CCO
Cakchiquel Occidental CKW
Haitian Creole Version HCV
Slovo na cestu SNC
Dette er Biblen på dansk DN1933
Hoffnung für Alle HOF
Luther Bibel 1545 LUTH1545
New International Version NIV
New American Standard Bible NASB
The Message MSG
Amplified Bible AMP
New Living Translation NLT
King James Version KJV
English Standard Version ESV
Contemporary English Version CEV
New King James Version NKJV
New Century Version NCV
21st Century King James Version KJ21
American Standard Version ASV
Young's Literal Translation YLT
Darby Translation DARBY
Holman Christian Standard Bible HCSB
New International Reader's Version NIRV
Wycliffe New Testament WYC
Worldwide English (New Testament) WE
New International Version - UK NIVUK
Today's New International Version TNIV
Reina-Valera 1960 RVR1960
Nueva Versión Internacional NVI
Reina-Valera 1995 RVR1995
Castilian CST
Reina-Valera Antigua RVA
Biblia en Lenguaje Sencillo BLS
La Biblia de las Américas LBLA
Louis Segond LSG
La Bible du Semeur BDS
1881 Westcott-Hort New Testament WHNU
1550 Stephanus New Testament TR1550
1894 Scrivener New Testament TR1894
The Westminster Leningrad Codex WLC
Hiligaynon Bible HLGN
Croatian Bible CRO
Hungarian Károli KAR
Icelandic Bible ICELAND
La Nuova Diodati LND
La Parola è Vita LM
Jacalteco - Oriental JAC
Kekchi KEK
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
1 João Ferreira de Almeida Atualizada João Ferreira de Almeida Atualizada AA AA
2 Quiché - Centro Occidental التفسير التطبيقى للكتاب المقدس QUT ALAB
3 Romanian Shqip RMNN ALB
4 Romanian Amplified Bible TLCR AMP
5 Russian Synodal Version Amuzgo de Guerrero RUSV AMU
6 Slovo Zhizny American Standard Version SZ ASV
7 La Bible du Semeur BDS
8 Български 1940 BG1940
9 Български BULG
10 Chinanteco de Comaltepec CCO
11 Contemporary English Version CEV
12 Cakchiquel Occidental CKW
13 Hrvatski CRO
14 Castilian CST
15 聖經和合本 (简体中文) CUVS
16 聖經和合本 (繁体中文) CUV
17 Darby Translation DARBY
18 Dette er Biblen på dansk DN1933
19 Det Norsk Bibelselskap 1930 DNB1930
20 English Standard Version ESV
21 GOD’S WORD Translation GW
22 Holman Christian Standard Bible HCSB
23 Kreyòl ayisyen bib HCV
24 Hiligaynon Bible HLGN
25 Hoffnung für Alle HOF
26 Het Boek HTB
27 Icelandic Bible ICELAND
28 Jacalteco – Oriental JAC
29 Károlyi-biblia KAR
30 Kekchi KEK
31 21st Century King James Version KJ21
32 King James Version KJV
33 La Biblia de las Américas LBLA
34 Levande Bibeln LB
35 La Parola è Vita LM
36 La Nuova Diodati LND
37 Louis Segond LSG
38 Luther Bibel 1545 LUTH1545
39 Māori Bible MAORI
40 Македонски Новиот Завет MNT
41 The Message MSG
42 Mam de Comitancillo Central MVC
43 Mam de Todos Santos Cuchumatán MVJ
44 New American Standard Bible NASB
45 New Century Version NCV
46 Náhuatl de Guerrero NGU
47 New International Reader's Version NIRV
48 New International Version 1984 NIV1984
49 New International Version 2010 NIV
50 New International Version - UK NIVUK
51 New King James Version NKJV
52 New Living Translation NLT
53 Nádej pre kazdého Nádej pre kazdého NPK NPK
54 Albanian Bible Nueva Versión Internacional ALB NVI
55 Levande Bibeln O Livro SVL OL
56 Svenska 1917 Quiché – Centro Occidental SV1917 QUT
57 Swahili New Testament Reimer 2001 SNT REIMER
58 Română Cornilescu RMNN
59 Новый перевод на русский язык RUSV
60 Reina-Valera Antigua RVA
61 Reina-Valera 1960 RVR1960
62 Reina-Valera 1995 RVR1995
63 Slovo na cestu SNC
64 Ang Salita ng Diyos Ang Salita ng Diyos SND SND
65 Ukrainian Bible Swahili New Testament UKR SNT
66 Svenska 1917 SV1917
67 Levande Bibeln SVL
68 Создать страницу SZ
69 Traducción en lenguaje actual TLA
70 New Romanian Translation TLCR
71 Today’s New International Version 2005 TNIV
72 Textus Receptus Stephanus 1550 TR1550
73 Textus Receptus Scrivener 1894 TR1894
74 Українська Біблія. Переклад Івана Огієнка UKR
75 Uspanteco Uspanteco USP USP
76 1934 Vietnamese Bible Kinh Thánh tiếng Việt 1934 VIET VIET
77 Chinese Union Version (Simplified) Worldwide English (New Testament) CUVS WE
78 Chinese Union Version (Traditional) Codex Vaticanus Westcott-Hort 1881 CUV WHNU
79 Westminster Leningrad Codex WLC
80 Wycliffe New Testament WYC
81 Young's Literal Translation YLT

View File

@ -27,7 +27,7 @@ En Levende Bok (NOR), NOR
Nádej pre kazdého, NPK
Noua traducere în limba românã, NTR
Nueva Versión Internacional, NVI
Hebrew OT, OT
הברית הישנה, OT
Słowo Życia, POL
O Livro, PRT
Новый перевод на русский язык, RUS
@ -36,4 +36,4 @@ Schlachter 2000, SLT
En Levande Bok (SWE), SVL
Today's New International Version, TNIV
Türkçe, TR
Vulgata, VUL
Biblia Vulgata, VUL

1 عربي ARA
27 Nádej pre kazdého NPK
28 Noua traducere în limba românã NTR
29 Nueva Versión Internacional NVI
30 Hebrew OT הברית הישנה OT
31 Słowo Życia POL
32 O Livro PRT
33 Новый перевод на русский язык RUS
36 En Levande Bok (SWE) SVL
37 Today's New International Version TNIV
38 Türkçe TR
39 Vulgata Biblia Vulgata VUL