forked from openlp/openlp
Some fixes I thought I had fixed eons ago.
This commit is contained in:
parent
dec03a4f5c
commit
66d3c3c1bf
@ -183,16 +183,18 @@ def import_songs():
|
|||||||
xml_verse_template = u'<verse label="%d" type="Verse"><![CDATA[%s]]></verse>'
|
xml_verse_template = u'<verse label="%d" type="Verse"><![CDATA[%s]]></verse>'
|
||||||
for row in rows:
|
for row in rows:
|
||||||
clean_title = unicode(row[1], u'cp1252')
|
clean_title = unicode(row[1], u'cp1252')
|
||||||
clean_lyrics = unicode(row[2], u'cp1252')
|
clean_lyrics = unicode(row[2], u'cp1252').replace(u'\r\n', u'\n')
|
||||||
clean_copyright = unicode(row[3], u'cp1252')
|
clean_copyright = unicode(row[3], u'cp1252')
|
||||||
verse_order = u''
|
verse_order = u''
|
||||||
text_lyrics = clean_lyrics.split(u'\n\n')
|
text_lyrics = clean_lyrics.split(u'\n\n')
|
||||||
xml_verse = u''
|
xml_verse = u''
|
||||||
|
verses = []
|
||||||
for line, verse in enumerate(text_lyrics):
|
for line, verse in enumerate(text_lyrics):
|
||||||
if not verse:
|
if not verse:
|
||||||
continue
|
continue
|
||||||
xml_verse += (xml_verse_template % (line + 1, verse))
|
xml_verse += (xml_verse_template % (line + 1, verse))
|
||||||
verse_order += '%d ' % (line + 1)
|
verses.append(u'V%d' % (line + 1))
|
||||||
|
verse_order = u' '.join(verses)
|
||||||
xml_lyrics = xml_lyrics_template % xml_verse
|
xml_lyrics = xml_lyrics_template % xml_verse
|
||||||
search_title = prepare_string(clean_title)
|
search_title = prepare_string(clean_title)
|
||||||
search_lyrics = prepare_string(clean_lyrics)
|
search_lyrics = prepare_string(clean_lyrics)
|
||||||
|
Loading…
Reference in New Issue
Block a user