forked from openlp/openlp
Clean up song imports
This commit is contained in:
parent
e06556489e
commit
4714502f67
@ -106,7 +106,8 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
|
||||
self.VerseTypeComboBox.setCurrentIndex(VerseType.from_string(verse_type))
|
||||
self.VerseNumberBox.setValue(verse_number)
|
||||
|
||||
def setVerse(self, text, single=False, tag=u'%s:1' % VerseType.to_string(VerseType.Verse)):
|
||||
def setVerse(self, text, single=False,
|
||||
tag=u'%s:1' % VerseType.to_string(VerseType.Verse)):
|
||||
if single:
|
||||
verse_type, verse_number = tag.split(u':')
|
||||
self.VerseTypeComboBox.setCurrentIndex(VerseType.from_string(verse_type))
|
||||
|
@ -29,6 +29,7 @@ from PyQt4 import QtGui
|
||||
|
||||
from openlp.core.lib import SongXMLBuilder
|
||||
from openlp.plugins.songs.lib.models import Song, Author, Topic, Book
|
||||
from openlp.plugins.songs.forms import VerseType
|
||||
|
||||
class SongImport(object):
|
||||
"""
|
||||
@ -293,19 +294,19 @@ class SongImport(object):
|
||||
sxml.add_lyrics_to_song()
|
||||
for (versetag, versetext) in self.verses:
|
||||
if versetag[0] == u'C':
|
||||
versetype = u'Chorus'
|
||||
versetype = VerseType.to_string(VerseType.Chorus)
|
||||
elif versetag[0] == u'V':
|
||||
versetype = u'Verse'
|
||||
versetype = VerseType.to_string(VerseType.Verse)
|
||||
elif versetag[0] == u'B':
|
||||
versetype = u'Bridge'
|
||||
versetype = VerseType.to_string(VerseType.Bridge)
|
||||
elif versetag[0] == u'I':
|
||||
versetype = u'Intro'
|
||||
versetype = VerseType.to_string(VerseType.Intro)
|
||||
elif versetag[0] == u'P':
|
||||
versetype = u'Prechorus'
|
||||
versetype = VerseType.to_string(VerseType.PreChorus)
|
||||
elif versetag[0] == u'E':
|
||||
versetype = u'Ending'
|
||||
versetype = VerseType.to_string(VerseType.Ending)
|
||||
else:
|
||||
versetype = u'Other'
|
||||
versetype = VerseType.to_string(VerseType.Other)
|
||||
sxml.add_verse_to_lyrics(versetype, versetag[1:], versetext)
|
||||
song.search_lyrics += u' ' + self.remove_punctuation(versetext)
|
||||
song.lyrics = unicode(sxml.extract_xml(), u'utf-8')
|
||||
|
Loading…
Reference in New Issue
Block a user