forked from openlp/openlp
Update files to provide list of values for bibles
Update code to read from files in code base and not .openlp bzr-revno: 318
This commit is contained in:
parent
649208afe5
commit
19395e6880
@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with
|
|||||||
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||||
Place, Suite 330, Boston, MA 02111-1307 USA
|
Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
@ -325,20 +324,22 @@ class BiblePlugin(Plugin, PluginUtils):
|
|||||||
log.debug("_initialise_form")
|
log.debug("_initialise_form")
|
||||||
self.QuickSearchComboBox.clear()
|
self.QuickSearchComboBox.clear()
|
||||||
self.QuickVersionComboBox.clear()
|
self.QuickVersionComboBox.clear()
|
||||||
self.AdvancedVersionComboBox.clear()
|
self.AdvancedVersionComboBox.clear()
|
||||||
bibles = self.biblemanager.get_bibles("full")
|
|
||||||
self.QuickSearchComboBox.addItem("Verse Search")
|
self.QuickSearchComboBox.addItem("Verse Search")
|
||||||
self.QuickSearchComboBox.addItem("Text Search")
|
self.QuickSearchComboBox.addItem("Text Search")
|
||||||
self.ClearQuickSearchComboBox.addItem("Clear")
|
self.ClearQuickSearchComboBox.addItem("Clear")
|
||||||
self.ClearQuickSearchComboBox.addItem("Keep")
|
self.ClearQuickSearchComboBox.addItem("Keep")
|
||||||
self.ClearAdvancedSearchComboBox.addItem("Clear")
|
self.ClearAdvancedSearchComboBox.addItem("Clear")
|
||||||
self.ClearAdvancedSearchComboBox.addItem("Keep")
|
self.ClearAdvancedSearchComboBox.addItem("Keep")
|
||||||
self.SettingsOutputStyleComboBox.addItem("Verse")
|
self.SettingsOutputStyleComboBox.addItem("Continuous")
|
||||||
self.SettingsOutputStyleComboBox.addItem("Paragraph")
|
self.SettingsOutputStyleComboBox.addItem("Paragraph")
|
||||||
self.SettingsVerseStyleComboBox.addItem("No Brackets")
|
self.SettingsVerseStyleComboBox.addItem("No Brackets")
|
||||||
self.SettingsVerseStyleComboBox.addItem("( and )")
|
self.SettingsVerseStyleComboBox.addItem("( and )")
|
||||||
self.SettingsVerseStyleComboBox.addItem("{ and }")
|
self.SettingsVerseStyleComboBox.addItem("{ and }")
|
||||||
self.SettingsVerseStyleComboBox.addItem("[ and ]")
|
self.SettingsVerseStyleComboBox.addItem("[ and ]")
|
||||||
|
|
||||||
|
bibles = self.biblemanager.get_bibles("full")
|
||||||
for b in bibles: # load bibles into the combo boxes
|
for b in bibles: # load bibles into the combo boxes
|
||||||
self.QuickVersionComboBox.addItem(b)
|
self.QuickVersionComboBox.addItem(b)
|
||||||
|
|
||||||
|
@ -40,29 +40,43 @@ class BibleImportForm(QDialog, Ui_BibleImportDialog, PluginUtils):
|
|||||||
self.AddressEdit.setText(self.config.get_config("addressedit", ""))
|
self.AddressEdit.setText(self.config.get_config("addressedit", ""))
|
||||||
self.UsernameEdit.setText(self.config.get_config("usernameedit", ""))
|
self.UsernameEdit.setText(self.config.get_config("usernameedit", ""))
|
||||||
self.PasswordEdit.setText(self.config.get_config("passwordedit",""))
|
self.PasswordEdit.setText(self.config.get_config("passwordedit",""))
|
||||||
|
|
||||||
|
filepath = os.path.split(os.path.abspath(__file__))[0]
|
||||||
|
filepath = os.path.abspath(os.path.join(filepath, '..', 'resources','crosswalkbooks.csv'))
|
||||||
|
fbibles=open(filepath, 'r')
|
||||||
|
self.bible_versions = {}
|
||||||
|
self.BibleComboBox.clear()
|
||||||
|
for line in fbibles:
|
||||||
|
p = line.split(",")
|
||||||
|
self.bible_versions[p[0]] = p[1].replace('\n', '')
|
||||||
|
self.BibleComboBox.addItem(str(p[0]))
|
||||||
|
|
||||||
|
|
||||||
QtCore.QObject.connect(self.LocationComboBox, QtCore.SIGNAL("activated(int)"), self.onLocationComboBox)
|
QtCore.QObject.connect(self.LocationComboBox, QtCore.SIGNAL("activated(int)"), self.onLocationComboBox)
|
||||||
QtCore.QObject.connect(self.BibleComboBox, QtCore.SIGNAL("activated(int)"), self.onBibleComboBox)
|
QtCore.QObject.connect(self.BibleComboBox, QtCore.SIGNAL("activated(int)"), self.onBibleComboBox)
|
||||||
|
|
||||||
@pyqtSignature("")
|
@pyqtSignature("")
|
||||||
def on_VersesFileButton_clicked(self):
|
def on_VersesFileButton_clicked(self):
|
||||||
filename = QtGui.QFileDialog.getOpenFileName(self, 'Open file',self._get_last_dir())
|
filename = QtGui.QFileDialog.getOpenFileName(self, 'Open file',self._get_last_dir(1))
|
||||||
self.VerseLocationEdit.setText(filename)
|
self.VerseLocationEdit.setText(filename)
|
||||||
self._save_last_directory(filename)
|
if filename != "":
|
||||||
|
self._save_last_directory(filename, 1)
|
||||||
self.setCSV()
|
self.setCSV()
|
||||||
|
|
||||||
@pyqtSignature("")
|
@pyqtSignature("")
|
||||||
def on_BooksFileButton_clicked(self):
|
def on_BooksFileButton_clicked(self):
|
||||||
filename = QtGui.QFileDialog.getOpenFileName(self, 'Open file',self._get_last_dir(1))
|
filename = QtGui.QFileDialog.getOpenFileName(self, 'Open file',self._get_last_dir(2))
|
||||||
self.BooksLocationEdit.setText(filename)
|
self.BooksLocationEdit.setText(filename)
|
||||||
self._save_last_directory(filename, 1)
|
if filename != "":
|
||||||
|
self._save_last_directory(filename, 2)
|
||||||
self.setCSV()
|
self.setCSV()
|
||||||
|
|
||||||
@pyqtSignature("")
|
@pyqtSignature("")
|
||||||
def on_OsisFileButton_clicked(self):
|
def on_OsisFileButton_clicked(self):
|
||||||
filename = QtGui.QFileDialog.getOpenFileName(self, 'Open file',self._get_last_dir(2))
|
filename = QtGui.QFileDialog.getOpenFileName(self, 'Open file',self._get_last_dir(3))
|
||||||
self.OSISLocationEdit.setText(filename)
|
self.OSISLocationEdit.setText(filename)
|
||||||
self._save_last_directory(filename, 2)
|
if filename != "":
|
||||||
|
self._save_last_directory(filename, 3)
|
||||||
self.setOSIS()
|
self.setOSIS()
|
||||||
|
|
||||||
def on_OSISLocationEdit_lostFocus(self):
|
def on_OSISLocationEdit_lostFocus(self):
|
||||||
@ -90,7 +104,6 @@ class BibleImportForm(QDialog, Ui_BibleImportDialog, PluginUtils):
|
|||||||
@pyqtSignature("")
|
@pyqtSignature("")
|
||||||
def on_AddressEdit_lostFocus(self):
|
def on_AddressEdit_lostFocus(self):
|
||||||
self.config.set_config("addressedit", str(self.AddressEdit.displayText()))
|
self.config.set_config("addressedit", str(self.AddressEdit.displayText()))
|
||||||
|
|
||||||
|
|
||||||
@pyqtSignature("")
|
@pyqtSignature("")
|
||||||
def on_UsernameEdit_lostFocus(self):
|
def on_UsernameEdit_lostFocus(self):
|
||||||
@ -166,6 +179,8 @@ class BibleImportForm(QDialog, Ui_BibleImportDialog, PluginUtils):
|
|||||||
self.biblemanager.register_csv_file_bible(str(self.BibleNameEdit.displayText()), self.BooksLocationEdit.displayText(), self.VerseLocationEdit.displayText())
|
self.biblemanager.register_csv_file_bible(str(self.BibleNameEdit.displayText()), self.BooksLocationEdit.displayText(), self.VerseLocationEdit.displayText())
|
||||||
else:
|
else:
|
||||||
self.setMax(1) # set a value as it will not be needed
|
self.setMax(1) # set a value as it will not be needed
|
||||||
|
bible = self.bible_versions[str(self.BibleComboBox.currentText())]
|
||||||
|
print bible
|
||||||
self.biblemanager.register_http_bible(str(self.BibleComboBox.currentText()), \
|
self.biblemanager.register_http_bible(str(self.BibleComboBox.currentText()), \
|
||||||
str(self.LocationComboBox.currentText()), \
|
str(self.LocationComboBox.currentText()), \
|
||||||
str(self.AddressEdit.displayText()), \
|
str(self.AddressEdit.displayText()), \
|
||||||
|
@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License along with
|
|||||||
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||||
Place, Suite 330, Boston, MA 02111-1307 USA
|
Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
"""
|
"""
|
||||||
|
import os
|
||||||
|
import os.path
|
||||||
import logging
|
import logging
|
||||||
from openlp.plugins.bibles.lib.bibleDBimpl import BibleDBImpl
|
from openlp.plugins.bibles.lib.bibleDBimpl import BibleDBImpl
|
||||||
from openlp.core.lib import Receiver
|
from openlp.core.lib import Receiver
|
||||||
@ -27,8 +29,11 @@ class BibleOSISImpl():
|
|||||||
def __init__(self, biblepath, bibledb):
|
def __init__(self, biblepath, bibledb):
|
||||||
self.bibledb = bibledb
|
self.bibledb = bibledb
|
||||||
self.booksOfBible = {} # books of the bible linked to bibleid {osis , name}
|
self.booksOfBible = {} # books of the bible linked to bibleid {osis , name}
|
||||||
self.abbrevOfBible = {} # books of the bible linked to bibleid {osis ,Abbrev }
|
self.abbrevOfBible = {} # books of the bible linked to bibleid {osis ,Abbrev }
|
||||||
fbibles=open(biblepath+"/osisbooks_en.txt", 'r')
|
|
||||||
|
filepath = os.path.split(os.path.abspath(__file__))[0]
|
||||||
|
filepath = os.path.abspath(os.path.join(filepath, '..', 'resources','osisbooks.csv'))
|
||||||
|
fbibles=open(filepath, 'r')
|
||||||
for line in fbibles:
|
for line in fbibles:
|
||||||
p = line.split(",")
|
p = line.split(",")
|
||||||
self.booksOfBible[p[0]] = p[1].replace('\n', '')
|
self.booksOfBible[p[0]] = p[1].replace('\n', '')
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
1,50,ge,31:25:3:4
|
|
||||||
2,40,ex,5:6:7:8
|
|
||||||
3,27,le,9:10:11:13
|
|
||||||
4,36,nu,1:35:6
|
|
||||||
5,34,de,1:3:4
|
|
||||||
23,150,ps,1:4:5
|
|
||||||
47,28,mt,25:23:30
|
|
||||||
48,15,mr,21:23:23
|
|
||||||
49,24,lu,23:43:34
|
|
||||||
50,21,joh,23:65:76
|
|
||||||
73,22,re,20:23:24
|
|
@ -1,11 +0,0 @@
|
|||||||
Genesis,1
|
|
||||||
Exodus,2
|
|
||||||
Leviticus,3
|
|
||||||
Numbers,4
|
|
||||||
Deuteronomy,5
|
|
||||||
Psalms,23
|
|
||||||
Matthew,47
|
|
||||||
Mark,48
|
|
||||||
Luke,49
|
|
||||||
John,50
|
|
||||||
Revelation,73
|
|
27
openlp/plugins/bibles/resources/crosswalkbooks.csv
Normal file
27
openlp/plugins/bibles/resources/crosswalkbooks.csv
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
New American Standard,nas
|
||||||
|
American Standard Version,asv
|
||||||
|
English Standard Version,esv
|
||||||
|
New King James Version,nkj
|
||||||
|
King James Version,kjv
|
||||||
|
Holman Christian Standard Bible,csb
|
||||||
|
Third Millennium Bible,tmb
|
||||||
|
New International Version,niv
|
||||||
|
New Living Translation,nlt
|
||||||
|
New Revised Standard,nrs
|
||||||
|
Revised Standard Version,rsv
|
||||||
|
Good News Translation,gnt
|
||||||
|
Douay-Rheims Bible,rhe
|
||||||
|
The Message,msg
|
||||||
|
The Complete Jewish Bible,cjb
|
||||||
|
New Century Version,ncv
|
||||||
|
GOD'S WORD Translation,gwd
|
||||||
|
Hebrew Names Version,hnv
|
||||||
|
World English Bible,web
|
||||||
|
The Bible in Basic English,bbe
|
||||||
|
Young's Literal Translation,ylt
|
||||||
|
Today's New International Version,tnv
|
||||||
|
New International Reader's Version,nrv
|
||||||
|
The Darby Translation,dby
|
||||||
|
The Webster Bible,wbt
|
||||||
|
The Latin Vulgate,vul
|
||||||
|
Weymouth New Testament,wnt
|
|
66
openlp/plugins/bibles/resources/httpbooks.csv
Normal file
66
openlp/plugins/bibles/resources/httpbooks.csv
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
Genesis,ge,1
|
||||||
|
Exodus,ex,1
|
||||||
|
Leviticus,le,1
|
||||||
|
Numbers,nu,1
|
||||||
|
Deuteronomy,de,1
|
||||||
|
Joshua,jos,1
|
||||||
|
Judges,jud,1
|
||||||
|
Ruth,ru,1
|
||||||
|
1 Samual,1sa,1
|
||||||
|
2 Samual,2sa,1
|
||||||
|
1 Kings,1ki,1
|
||||||
|
2 Kings,2ki,1
|
||||||
|
1 Chronicles,1ch,1
|
||||||
|
2 Chronicles,2ch,1
|
||||||
|
Ezra,ezr,1
|
||||||
|
Nehemiah,ne,1
|
||||||
|
Esther,es,1
|
||||||
|
Job,job,1
|
||||||
|
Psalms,ps,1
|
||||||
|
Proverbs,pr,1
|
||||||
|
Ecclesiastes,ec,1
|
||||||
|
Song of Songs,so,1
|
||||||
|
Isaiah,isa,1
|
||||||
|
Jeremiah,jer,1
|
||||||
|
Lamentations,la,1
|
||||||
|
Ezekiel,exe,1
|
||||||
|
Daniel,da,1
|
||||||
|
Hosea,ho,1
|
||||||
|
Joel,joe,1
|
||||||
|
Amos,am,1
|
||||||
|
Obad,ob,1
|
||||||
|
Jonah,Jonah,1
|
||||||
|
Micah,mic,1
|
||||||
|
Naham,na,1
|
||||||
|
Habakkuk,hab,1
|
||||||
|
Zephaniah,zep,1
|
||||||
|
Haggai,hag,1
|
||||||
|
Zechariah,zec,1
|
||||||
|
Malachi,mal,1
|
||||||
|
Matthew,mt,2
|
||||||
|
Mark,mk,2
|
||||||
|
Luke,lu,2
|
||||||
|
John,joh,2
|
||||||
|
Acts,ac,2
|
||||||
|
Romans,ro,2
|
||||||
|
1 Corinthans,1co,2
|
||||||
|
2 Corinthans,2co,2
|
||||||
|
Galatians,ga,2
|
||||||
|
Ephesians,eph,2
|
||||||
|
Philippians,php,2
|
||||||
|
Colossians,col,2
|
||||||
|
1 Thessalonians,1th,2
|
||||||
|
2 Thessalonians,2th,2
|
||||||
|
1 Timothy,1ti,2
|
||||||
|
2 Timothy,2ti,2
|
||||||
|
Titus,tit,2
|
||||||
|
Philemon,phm,2
|
||||||
|
Hebrews,heb,2
|
||||||
|
James,jas,2
|
||||||
|
1 Peter,1pe,2
|
||||||
|
2 Peter,2pe,2
|
||||||
|
1 John,1jo,2
|
||||||
|
2 John,2jo,2
|
||||||
|
3 John,3jo,2
|
||||||
|
Jude,jude,2
|
||||||
|
Revelation,re,2
|
|
66
openlp/plugins/bibles/resources/osisbooks.csv
Normal file
66
openlp/plugins/bibles/resources/osisbooks.csv
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
Gen,Genesis,Gen
|
||||||
|
Exod,Exodus,Exod
|
||||||
|
Lev,Leviticus,Lev
|
||||||
|
Num,Numbers,Num
|
||||||
|
Deut,Deuteronomy,Deut
|
||||||
|
Josh,Joshua,Josh
|
||||||
|
Judg,Judges,Judg
|
||||||
|
Ruth,Ruth,Ruth
|
||||||
|
1Sam,1 Samual,1Sam
|
||||||
|
2Sam,2 Samual,2Sam
|
||||||
|
1Kgs,1 Kings,1Kgs
|
||||||
|
2Kgs,2 Kings,2Kgs
|
||||||
|
1Chr,1 Chronicles,1Chr
|
||||||
|
2Chr,2 Chronicles,2Chr
|
||||||
|
Ezra,Ezra,Ezra
|
||||||
|
Neh,Nehemiah,Neh
|
||||||
|
Esth,Esther,Esth
|
||||||
|
Job,Job,Job
|
||||||
|
Ps,Psalms,Ps
|
||||||
|
Prov,Proverbs,Prov
|
||||||
|
Eccl,Ecclesiastes,Eccl
|
||||||
|
Song,Song of Songs,Song
|
||||||
|
Isa,Isaiah,Isa
|
||||||
|
Jer,Jeremiah,Jer
|
||||||
|
Lam,Lamentations,Lam
|
||||||
|
Ezek,Ezekiel,Ezek
|
||||||
|
Dan,Daniel,Dan
|
||||||
|
Hos,Hosea,Hos
|
||||||
|
Joel,Joel,Joel
|
||||||
|
Amos,Amos,Amos
|
||||||
|
Obad,Obad,Obad
|
||||||
|
Jonah,Jonah,Jonah
|
||||||
|
Mic,Micah,Mic
|
||||||
|
Nah,Naham,Nah
|
||||||
|
Hab,Habakkuk,Hab
|
||||||
|
Zeph,Zephaniah,Zeph
|
||||||
|
Hag,Haggai,Hag
|
||||||
|
Zech,Zechariah,Zech
|
||||||
|
Mal,Malachi,Mal
|
||||||
|
Matt,Matthew,Matt
|
||||||
|
Mark,Mark,Mark
|
||||||
|
Luke,Luke,Luke
|
||||||
|
John,John,John
|
||||||
|
Acts,Acts,Acts
|
||||||
|
Rom,Romans,Rom
|
||||||
|
1Cor,1 Corinthans,1Cor
|
||||||
|
2Cor,2 Corinthans,2Cor
|
||||||
|
Gal,Galatians,Gal
|
||||||
|
Eph,Ephesians,Eph
|
||||||
|
Phil,Philippians,Phil
|
||||||
|
Col,Colossians,Col
|
||||||
|
1Thess,1 Thessalonians,1Thess
|
||||||
|
2Thess,2 Thessalonians,2Thess
|
||||||
|
1Tim,1 Timothy,1Tim
|
||||||
|
2Tim,2 Timothy,2Tim
|
||||||
|
Titus,Titus,Titus
|
||||||
|
Phlm,Philemon,Phlm
|
||||||
|
Heb,Hebrews,Heb
|
||||||
|
Jas,James,Jas
|
||||||
|
1Pet,1 Peter,1Pet
|
||||||
|
2Pet,2 Peter,2Pet
|
||||||
|
1John,1 John,1John
|
||||||
|
2John,2 John,2John
|
||||||
|
3John,3 John,3John
|
||||||
|
Jude,Jude,Jude
|
||||||
|
Rev,Revelation,Rev
|
|
Loading…
Reference in New Issue
Block a user