Tim Bentley has proposed merging lp:~trb143/openlp/fixes into lp:openlp. Requested reviews: OpenLP Core (openlp-core)
Added Biblegateway bibles list and added into screens so can be selected Bibles now downloaded in various languages and character sets. -- https://code.launchpad.net/~trb143/openlp/fixes/+merge/14111 Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/ui/settingsform.py' --- openlp/core/ui/settingsform.py 2009-10-19 14:56:44 +0000 +++ openlp/core/ui/settingsform.py 2009-10-28 21:05:21 +0000 @@ -53,6 +53,7 @@ def insertTab(self, tab, location): log.debug(u'Inserting %s tab' % tab.title()) + #13 : There are 3 tables currently and lcations starts at -10 self.SettingsTabWidget.insertTab(location + 13, tab, tab.title()) def removeTab(self, name): === modified file 'openlp/plugins/bibles/forms/bibleimportdialog.py' --- openlp/plugins/bibles/forms/bibleimportdialog.py 2009-10-27 07:20:01 +0000 +++ openlp/plugins/bibles/forms/bibleimportdialog.py 2009-10-28 21:05:21 +0000 @@ -250,8 +250,6 @@ self.LocationComboBox.setItemText(0, self.trUtf8(u'Crosswalk')) self.LocationComboBox.setItemText(1, self.trUtf8(u'BibleGateway')) self.BibleLabel.setText(self.trUtf8(u'Bible:')) - self.BibleComboBox.setItemText(1, self.trUtf8(u'NIV')) - self.BibleComboBox.setItemText(2, self.trUtf8(u'KJV')) self.ProxyGroupBox.setTitle(self.trUtf8(u'Proxy Settings (Optional)')) self.AddressLabel.setText(self.trUtf8(u'Proxy Address:')) self.UsernameLabel.setText(self.trUtf8(u'Username:')) === modified file 'openlp/plugins/bibles/forms/bibleimportform.py' --- openlp/plugins/bibles/forms/bibleimportform.py 2009-10-24 16:40:36 +0000 +++ openlp/plugins/bibles/forms/bibleimportform.py 2009-10-28 21:05:21 +0000 @@ -53,18 +53,34 @@ self.AddressEdit.setText(self.config.get_config(u'proxy_address', u'')) self.UsernameEdit.setText(self.config.get_config(u'proxy_username',u'')) self.PasswordEdit.setText(self.config.get_config(u'proxy_password',u'')) - + #Load and store Crosswalk Bibles filepath = os.path.split(os.path.abspath(__file__))[0] filepath = os.path.abspath(os.path.join(filepath, u'..', u'resources', u'crosswalkbooks.csv')) fbibles=open(filepath, 'r') - self.bible_versions = {} + self.cwBibleVersions = {} + for line in fbibles: + p = line.split(u',') + self.cwBibleVersions [p[0]] = p[1].replace(u'\n', u'') + #Load and store BibleGateway Bibles + filepath = os.path.split(os.path.abspath(__file__))[0] + filepath = os.path.abspath(os.path.join(filepath, u'..', + u'resources', u'biblegateway.csv')) + fbibles=open(filepath, 'r') + self.bgBibleVersions = {} + for line in fbibles: + p = line.split(u',') + self.bgBibleVersions [p[0]] = p[1].replace(u'\n', u'') + self.loadBibleCombo(self.cwBibleVersions ) + self.cwActive = True + + def loadBibleCombo(self, biblesList): self.BibleComboBox.clear() self.BibleComboBox.addItem(u'') - for line in fbibles: - p = line.split(u',') - self.bible_versions[p[0]] = p[1].replace(u'\n', u'') - self.BibleComboBox.addItem(unicode(p[0])) + for bible in biblesList: + row = self.BibleComboBox.count() + self.BibleComboBox.addItem(unicode(self.trUtf8(bible))) + self.BibleComboBox.setItemData(row, QtCore.QVariant(bible)) #Combo Boxes QtCore.QObject.connect(self.LocationComboBox, @@ -150,12 +166,19 @@ self.config.set_config( u'proxy_password', unicode(self.PasswordEdit.displayText())) - def onLocationComboBoxSelected(self): + def onLocationComboBoxSelected(self, value): + if value == 0: + self.loadBibleCombo(self.cwBibleVersions ) + self.cwActive = True + else: + self.loadBibleCombo(self.bgBibleVersions ) + self.cwActive = False self.checkHttp() - def onBibleComboBoxSelected(self): + def onBibleComboBoxSelected(self, value): self.checkHttp() self.BibleNameEdit.setText(unicode(self.BibleComboBox.currentText())) + self.VersionNameEdit.setText(unicode(self.BibleComboBox.currentText())) def onCancelButtonClicked(self): # tell import to stop @@ -210,8 +233,12 @@ else: # set a value as it will not be needed self.setMax(1) - bible = self.bible_versions[ - unicode(self.BibleComboBox.currentText())] + if self.cwActive: + bible = self.cwBibleVersions [ + unicode(self.BibleComboBox.currentText())] + else: + bible = self.bgBibleVersions [ + unicode(self.BibleComboBox.currentText())] loaded = self.biblemanager.register_http_bible( unicode(self.BibleComboBox.currentText()), unicode(self.LocationComboBox.currentText()), === modified file 'openlp/plugins/bibles/lib/bibleHTTPimpl.py' --- openlp/plugins/bibles/lib/bibleHTTPimpl.py 2009-10-27 17:25:58 +0000 +++ openlp/plugins/bibles/lib/bibleHTTPimpl.py 2009-10-28 21:05:21 +0000 @@ -50,12 +50,11 @@ """ log.debug(u'get_bible_chapter %s,%s,%s', version, bookname, chapter) - version=u'nasb' urlstring = \ - u'http://www.biblegateway.com/passage/?search=%s %s&version=%s' % \ - (bookname, unicode(chapter) , version) + u'http://www.biblegateway.com/passage/?search=%s+%d&version=%s' % \ + (bookname, chapter, version) + log.debug(u'BibleGateway urm = %s' % urlstring) xml_string = self._get_web_text(urlstring, self.proxyurl) - #print xml_string verseSearch = u'<sup class=\"versenum' verseFootnote = u'<sup class=\'footnote' verse = 1 @@ -68,13 +67,15 @@ verseText = u'' versePos = xml_string.find(u'</sup>', versePos) + 6 i = xml_string.find(verseSearch, versePos + 1) + # Not sure if this is needed now if i == -1: i = xml_string.find(u'</div', versePos + 1) j = xml_string.find(u'<strong', versePos + 1) if j > 0 and j < i: i = j verseText = xml_string[versePos + 7 : i ] - bible[verse] = self._clean_text(verseText) # store the verse + # store the verse + bible[verse] = self._clean_text(verseText) versePos = -1 else: verseText = xml_string[versePos: i] @@ -85,8 +86,10 @@ start_tag = verseText.find(verseFootnote) # Chop off verse and start again xml_string = xml_string[i:] - versePos = xml_string.find(verseSearch) #look for the next verse - bible[verse] = self._clean_text(verseText) # store the verse + #look for the next verse + versePos = xml_string.find(verseSearch) + # store the verse + bible[verse] = self._clean_text(verseText) verse += 1 return SearchResults(bookname, chapter, bible) === modified file 'openlp/plugins/bibles/lib/manager.py' --- openlp/plugins/bibles/lib/manager.py 2009-10-27 16:55:09 +0000 +++ openlp/plugins/bibles/lib/manager.py 2009-10-28 21:05:21 +0000 @@ -66,15 +66,7 @@ self.bibleSuffix = u'sqlite' self.dialogobject = None self.reload_bibles() - - def set_media_manager(self, media): - """ - Sets the reference to the media manager. - - ``media`` - The reference to the media manager. - """ - self.media = media + self.media = None def reload_bibles(self): log.debug(u'Reload bibles') === modified file 'openlp/plugins/bibles/lib/mediaitem.py' --- openlp/plugins/bibles/lib/mediaitem.py 2009-10-24 16:40:36 +0000 +++ openlp/plugins/bibles/lib/mediaitem.py 2009-10-28 21:05:21 +0000 @@ -268,7 +268,7 @@ def initialise(self): log.debug(u'bible manager initialise') self.loadBibles() - self.parent.biblemanager.set_media_manager(self) + self.parent.biblemanager.media = self self.configUpdated() log.debug(u'bible manager initialise complete') === added file 'openlp/plugins/bibles/resources/biblegateway.csv' --- openlp/plugins/bibles/resources/biblegateway.csv 1970-01-01 00:00:00 +0000 +++ openlp/plugins/bibles/resources/biblegateway.csv 2009-10-28 21:05:21 +0000 @@ -0,0 +1,80 @@ +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 +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 \ No newline at end of file === modified file 'openlp/plugins/songusage/lib/manager.py' --- openlp/plugins/songusage/lib/manager.py 2009-10-27 08:38:02 +0000 +++ openlp/plugins/songusage/lib/manager.py 2009-10-28 21:05:21 +0000 @@ -101,7 +101,7 @@ return True except: self.session.rollback() - log.excertion(u'SongUsage Item failed to delete') + log.exception(u'SongUsage Item failed to delete') return False else: return True @@ -116,7 +116,7 @@ return True except: self.session.rollback() - log.excertion(u'Failed to delete all Song Usage items') + log.exception(u'Failed to delete all Song Usage items') return False def delete_to_date(self, date): @@ -130,5 +130,5 @@ return True except: self.session.rollback() - log.excertion(u'Failed to delete all Song Usage items to %s' % date) + log.exception(u'Failed to delete all Song Usage items to %s' % date) return False
_______________________________________________ Mailing list: https://launchpad.net/~openlp-core Post to : openlp-core@lists.launchpad.net Unsubscribe : https://launchpad.net/~openlp-core More help : https://help.launchpad.net/ListHelp