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

Requested reviews:
  Tim Bentley (trb143)
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/53513

Done it as I thought best, please suggest a more appropiate way if there is.
-- 
https://code.launchpad.net/~phill-ridout/openlp/sspBug/+merge/53513
Your team OpenLP Core is subscribed to branch 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 20:14:32 +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, True)
+                        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"

_______________________________________________
Mailing list: https://launchpad.net/~openlp-core
Post to     : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp

Reply via email to