From 62091b92fe01f0f05c6166d1f597f80149725c94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Fri, 18 Feb 2011 10:25:43 +0200 Subject: [PATCH] These would have been left behind. 2% less typos now. --- openlp/plugins/songs/forms/editsongform.py | 2 +- openlp/plugins/songs/forms/editverseform.py | 2 +- openlp/plugins/songs/lib/__init__.py | 2 +- openlp/plugins/songs/lib/songimport.py | 20 ++++++++++---------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 0470a2d32..77caf012e 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -448,7 +448,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if self.verse_form.exec_(): after_text, verse_tag, verse_num = self.verse_form.getVerse() verse_def = u'%s%s' % (verse_tag, verse_num) - item = QtGui.QTableWidgetItem(afterText) + item = QtGui.QTableWidgetItem(after_text) item.setData(QtCore.Qt.UserRole, QtCore.QVariant(verse_def)) item.setText(after_text) self.verseListWidget.setRowCount( diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index a5b8e2696..6156e6821 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -57,7 +57,7 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): QtCore.QObject.connect(self.verseTypeComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), self.onVerseTypeComboBoxChanged) - self.verse_regex = re.compile(r'---\[(.+):\D*(\d.)\D*\]---') + self.verse_regex = re.compile(r'---\[(.+):\D*(\d*)\D*.*\]---') def contextMenu(self, point): item = self.serviceManagerList.itemAt(point) diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index 8b64618c0..95fae92a8 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -178,7 +178,7 @@ class VerseType(object): verse_index = VerseType.from_string(verse_name) if verse_index is None: verse_index = VerseType.from_translated_tag(verse_name) - elif verse_index is None: + if verse_index is None: verse_index = VerseType.from_tag(verse_name) return verse_index diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index f1f4b4249..e0e078c43 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -79,7 +79,7 @@ class SongImport(QtCore.QObject): self.verse_order_list_generated = [] self.verse_order_list = [] self.verses = [] - self.versecounts = {} + self.verse_counts = {} self.copyright_string = unicode(translate( 'SongsPlugin.SongImport', 'copyright')) self.copyright_symbol = unicode(translate( @@ -130,10 +130,10 @@ class SongImport(QtCore.QObject): return text def process_song_text(self, text): - versetexts = text.split(u'\n\n') - for versetext in versetexts: - if versetext.strip() != u'': - self.process_verse_text(versetext.strip()) + verse_texts = text.split(u'\n\n') + for verse_text in verse_texts: + if verse_text.strip() != u'': + self.process_verse_text(verse_text.strip()) def process_verse_text(self, text): lines = text.split(u'\n') @@ -227,10 +227,10 @@ class SongImport(QtCore.QObject): else: self.verse_counts[verse_def[0]] = 1 if len(verse_def) == 1: - verse_def += unicode(self.versecounts[verse_def[0]]) - elif int(verse_def[1:]) > self.versecounts[verse_def[0]]: - self.versecounts[verse_def[0]] = int(verse_def[1:]) - self.verses.append([verse_def, versetext.rstrip(), lang]) + verse_def += unicode(self.verse_counts[verse_def[0]]) + elif int(verse_def[1:]) > self.verse_counts[verse_def[0]]: + self.verse_counts[verse_def[0]] = int(verse_def[1:]) + self.verses.append([verse_def, verse_text.rstrip(), lang]) self.verse_order_list_generated.append(verse_def) def repeat_verse(self): @@ -278,7 +278,7 @@ class SongImport(QtCore.QObject): other_count = 1 for (verse_def, verse_text, lang) in self.verses: if verse_def[0].lower() in VerseType.Tags: - verse_def = verse_def[0].lower() + verse_tag = verse_def[0].lower() else: new_verse_def = u'%s%d' % (VerseType.Tags[VerseType.Other], other_count)