stop adding a default verse order to OpenLyrics/service songs

bzr-revno: 1386
This commit is contained in:
Andreas Preikschat 2011-03-13 19:13:20 +01:00
commit d1592b46c7

View File

@ -444,7 +444,6 @@ class OpenLyrics(object):
""" """
sxml = SongXML() sxml = SongXML()
search_text = u'' search_text = u''
temp_verse_order = []
for verse in lyrics.verse: for verse in lyrics.verse:
text = u'' text = u''
for lines in verse.lines: for lines in verse.lines:
@ -455,11 +454,10 @@ class OpenLyrics(object):
verse_type_index = VerseType.from_tag(verse_name[0]) verse_type_index = VerseType.from_tag(verse_name[0])
verse_type = VerseType.Names[verse_type_index] verse_type = VerseType.Names[verse_type_index]
verse_number = re.compile(u'[a-zA-Z]*').sub(u'', verse_name) verse_number = re.compile(u'[a-zA-Z]*').sub(u'', verse_name)
verse_part = re.compile(u'[0-9]*').sub(u'', verse_name[1:]) # OpenLyrics allows e. g. "c", but we need "c1". However, this does
# OpenLyrics allows e. g. "c", but we need "c1". # not correct the verse order.
if not verse_number: if not verse_number:
verse_number = u'1' verse_number = u'1'
temp_verse_order.append((verse_type, verse_number, verse_part))
lang = None lang = None
if self._get(verse, u'lang'): if self._get(verse, u'lang'):
lang = self._get(verse, u'lang') lang = self._get(verse, u'lang')
@ -470,24 +468,6 @@ class OpenLyrics(object):
# Process verse order # Process verse order
if hasattr(properties, u'verseOrder'): if hasattr(properties, u'verseOrder'):
song.verse_order = self._text(properties.verseOrder) song.verse_order = self._text(properties.verseOrder)
else:
# We have to process the temp_verse_order, as the verseOrder
# property is not present.
previous_type = u''
previous_number = u''
previous_part = u''
verse_order = []
# Currently we do not support different "parts"!
for name in temp_verse_order:
if name[0] == previous_type:
if name[1] != previous_number:
verse_order.append(u''.join((name[0][0], name[1])))
else:
verse_order.append(u''.join((name[0][0], name[1])))
previous_type = name[0]
previous_number = name[1]
previous_part = name[2]
song.verse_order = u' '.join(verse_order)
def _process_songbooks(self, properties, song): def _process_songbooks(self, properties, song):
""" """