These would have been left behind. 2% less typos now.

This commit is contained in:
Mattias Põldaru 2011-02-18 10:25:43 +02:00
parent 1651e42bca
commit 62091b92fe
4 changed files with 13 additions and 13 deletions

View File

@ -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(

View File

@ -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)

View File

@ -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

View File

@ -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)