diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 7ccf3fc4c..cc66f21d7 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -138,6 +138,6 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog): if re.search(r'[/\\]openlp[/\\]', line): source = re.sub(r'.*[/\\]openlp[/\\](.*)".*', r'\1', line) if u':' in line: - exception = line.split(u'\n')[-1].split(u':')[0] + exception = line.split(u'\n')[-1].split(u':')[0] subject = u'Bug report: %s in %s' % (exception, source) mailto(address=u'bugs@openlp.org', subject=subject, body=body % content) diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index dade3ad44..099cb1706 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -350,7 +350,7 @@ class HTTPBible(BibleDB): Run the import. This method overrides the parent class method. Returns ``True`` on success, ``False`` on failure. """ - self.wizard.ImportProgressBar.setMaximum(2) + self.wizard.importProgressBar.setMaximum(2) self.wizard.incrementProgressBar('Registering bible...') self.create_meta(u'download source', self.download_source) self.create_meta(u'download name', self.download_name) diff --git a/openlp/plugins/bibles/lib/osis.py b/openlp/plugins/bibles/lib/osis.py index 53a6f152c..f39a4ab0f 100644 --- a/openlp/plugins/bibles/lib/osis.py +++ b/openlp/plugins/bibles/lib/osis.py @@ -134,9 +134,9 @@ class OSISBible(BibleDB): testament) if last_chapter == 0: if book == u'Gen': - self.wizard.ImportProgressBar.setMaximum(1188) + self.wizard.importProgressBar.setMaximum(1188) else: - self.wizard.ImportProgressBar.setMaximum(260) + self.wizard.importProgressBar.setMaximum(260) if last_chapter != chapter: if last_chapter != 0: self.session.commit() diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index b7f4a3f0b..58488a6e9 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -108,6 +108,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.TopicsListView.setSortingEnabled(False) self.TopicsListView.setAlternatingRowColors(True) self.findVerseSplit = re.compile(u'---\[\]---\n', re.UNICODE) + self.whitespace = re.compile(r'\W+', re.UNICODE) def initialise(self): self.VerseEditButton.setEnabled(False) @@ -738,7 +739,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): verseId = unicode(item.data(QtCore.Qt.UserRole).toString()) bits = verseId.split(u':') sxml.add_verse_to_lyrics(bits[0], bits[1], unicode(item.text())) - text = text + re.sub(r'\W+', u' ', + text = text + whitespace.sub(u' ', unicode(self.VerseListWidget.item(i, 0).text())) + u' ' if (bits[1] > u'1') and (bits[0][0] not in multiple): multiple.append(bits[0][0]) diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index ea36d55b5..f305b90c7 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -247,7 +247,7 @@ class SongImport(QtCore.QObject): """ Extracts alphanumeric words for searchable fields """ - return re.sub(r'\W+', u' ', text) + return re.sub(r'\W+', u' ', text, re.UNICODE) def finish(self): """ diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 32336c507..b55b05988 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -31,7 +31,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib.db import Manager -from openlp.plugins.songs.lib import SongMediaItem, SongsTab +from openlp.plugins.songs.lib import SongMediaItem, SongsTab, SongXMLParser from openlp.plugins.songs.lib.db import init_schema, Song from openlp.plugins.songs.lib.importer import SongFormat @@ -150,9 +150,13 @@ class SongsPlugin(Plugin): song.title = u'' if song.alternate_title is None: song.alternate_title = u'' - song.search_title = self.whitespace.sub(u' ', \ - song.title.lower()) + u' ' + \ - self.whitespace.sub(u' ', song.alternate_title.lower()) + song.search_title = self.whitespace.sub(u' ', song.title.lower() + \ + u' ' + song.alternate_title.lower()) + lyrics = u'' + verses = SongXMLParser(song.lyrics).get_verses() + for verse in verses: + lyrics = lyrics + self.whitespace.sub(u' ', verse[1]) + u' ' + song.search_lyrics = lyrics.lower() progressDialog.setValue(counter) self.manager.save_objects(songs) counter += 1