forked from openlp/openlp
Fix Traceback when importing OpenLyrics file
bzr-revno: 2095
This commit is contained in:
commit
0e4aeaac76
@ -763,18 +763,19 @@ class OpenLyrics(object):
|
|||||||
if not verse_number:
|
if not verse_number:
|
||||||
verse_number = u'1'
|
verse_number = u'1'
|
||||||
lang = verse.get(u'lang')
|
lang = verse.get(u'lang')
|
||||||
|
translit = verse.get(u'translit')
|
||||||
# In OpenLP 1.9.6 we used v1a, v1b ... to represent visual slide
|
# In OpenLP 1.9.6 we used v1a, v1b ... to represent visual slide
|
||||||
# breaks. In OpenLyrics 0.7 an attribute has been added.
|
# breaks. In OpenLyrics 0.7 an attribute has been added.
|
||||||
if song_xml.get(u'modifiedIn') in (u'1.9.6', u'OpenLP 1.9.6') and \
|
if song_xml.get(u'modifiedIn') in (u'1.9.6', u'OpenLP 1.9.6') and \
|
||||||
song_xml.get(u'version') == u'0.7' and \
|
song_xml.get(u'version') == u'0.7' and \
|
||||||
(verse_tag, verse_number, lang) in verses:
|
(verse_tag, verse_number, lang, translit) in verses:
|
||||||
verses[(verse_tag, verse_number, lang, None)] += u'\n[---]\n' + text
|
verses[(verse_tag, verse_number, lang, translit, None)] += u'\n[---]\n' + text
|
||||||
# Merge v1a, v1b, .... to v1.
|
# Merge v1a, v1b, .... to v1.
|
||||||
elif (verse_tag, verse_number, lang, verse_part) in verses:
|
elif (verse_tag, verse_number, lang, translit, verse_part) in verses:
|
||||||
verses[(verse_tag, verse_number, lang)] += u'\n' + text
|
verses[(verse_tag, verse_number, lang, translit, verse_part)] += u'\n' + text
|
||||||
else:
|
else:
|
||||||
verses[(verse_tag, verse_number, lang, verse_part)] = text
|
verses[(verse_tag, verse_number, lang, translit, verse_part)] = text
|
||||||
verse_def_list.append((verse_tag, verse_number, lang, verse_part))
|
verse_def_list.append((verse_tag, verse_number, lang, translit, verse_part))
|
||||||
# We have to use a list to keep the order, as dicts are not sorted.
|
# We have to use a list to keep the order, as dicts are not sorted.
|
||||||
for verse in verse_def_list:
|
for verse in verse_def_list:
|
||||||
sxml.add_verse_to_lyrics(
|
sxml.add_verse_to_lyrics(
|
||||||
|
Loading…
Reference in New Issue
Block a user