Fix song order in SongshowPlus import

bzr-revno: 1393
This commit is contained in:
Philip Ridout 2011-03-16 21:37:48 +00:00 committed by Jonathan Corwin
commit 5b7c909444

View File

@ -154,7 +154,8 @@ class SongShowPlusImport(SongImport):
elif blockKey == COMMENTS:
self.comments = unicode(data, u'cp1252')
elif blockKey == VERSE_ORDER:
verseTag = self.toOpenLPVerseTag(data)
verseTag = self.toOpenLPVerseTag(data, True)
if verseTag:
self.sspVerseOrderList.append(unicode(verseTag,
u'cp1252'))
elif blockKey == SONG_BOOK:
@ -174,7 +175,7 @@ class SongShowPlusImport(SongImport):
WizardStrings.ImportingType % file_name)
return True
def toOpenLPVerseTag(self, verseName):
def toOpenLPVerseTag(self, verseName, ignoreUnique=False):
if verseName.find(" ") != -1:
verseParts = verseName.split(" ")
verseType = verseParts[0]
@ -195,6 +196,8 @@ class SongShowPlusImport(SongImport):
verseTag = "B"
else:
if not self.otherList.has_key(verseName):
if ignoreUnique:
return None
self.otherCount = self.otherCount + 1
self.otherList[verseName] = str(self.otherCount)
verseTag = "O"