← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~phill-ridout/openlp/sspBug into lp:openlp

 

phill has proposed merging lp:~phill-ridout/openlp/sspBug into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #735357 in OpenLP: "Songshow plus import adds O1 for title slide in verse order"
  https://bugs.launchpad.net/openlp/+bug/735357

For more details, see:
https://code.launchpad.net/~phill-ridout/openlp/sspBug/+merge/53506

Done it as I thought best, please suggest a more appropiate way if there is.
-- 
https://code.launchpad.net/~phill-ridout/openlp/sspBug/+merge/53506
Your team OpenLP Core is requested to review the proposed merge of lp:~phill-ridout/openlp/sspBug into lp:openlp.
=== modified file 'openlp/plugins/songs/lib/songshowplusimport.py'
--- openlp/plugins/songs/lib/songshowplusimport.py	2011-02-24 15:54:21 +0000
+++ openlp/plugins/songs/lib/songshowplusimport.py	2011-03-15 19:41:02 +0000
@@ -154,9 +154,10 @@
                     elif blockKey == COMMENTS:
                         self.comments = unicode(data, u'cp1252')
                     elif blockKey == VERSE_ORDER:
-                        verseTag = self.toOpenLPVerseTag(data)
-                        self.sspVerseOrderList.append(unicode(verseTag,
-                            u'cp1252'))
+                        verseTag = self.toOpenLPVerseTag(data, 1)
+                        if verseTag:
+                            self.sspVerseOrderList.append(unicode(verseTag,
+                                u'cp1252'))
                     elif blockKey == SONG_BOOK:
                         self.song_book_name = unicode(data, u'cp1252')
                     elif blockKey == SONG_NUMBER:
@@ -174,7 +175,7 @@
                     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 @@
             verseTag = "B"
         else:
             if not self.otherList.has_key(verseName):
+                if ignoreUnique:
+                    return False
                 self.otherCount = self.otherCount + 1
                 self.otherList[verseName] = str(self.otherCount)
             verseTag = "O"


Follow ups