Handles [C] followed by non-numbered lines, by assigned them all to [C1]

This commit is contained in:
Martin Thompson 2010-06-22 22:24:24 +01:00
parent e8a397d3ec
commit 9c573d7bef
2 changed files with 8 additions and 4 deletions

View File

@ -48,6 +48,7 @@ class OpenSongImport:
or: or:
<lyrics> <lyrics>
[V]
1List of words 1List of words
2Some words for the 2nd Verse 2Some words for the 2nd Verse
@ -55,9 +56,9 @@ class OpenSongImport:
2etc... 2etc...
</lyrics> </lyrics>
Either or both forms can be used in one song. Either or both forms can be used in one song. The Number does not necessarily appear at the start of the line
The [v1] labels can have either upper or loewr case Vs The [v1] labels can have either upper or lower case Vs
Other labels can be used also: Other labels can be used also:
C - Chorus C - Chorus
B - Bridge B - Bridge
@ -134,7 +135,7 @@ class OpenSongImport:
versenum=int(l[2:right_bracket]) versenum=int(l[2:right_bracket])
versetag=u'%s%d'%(versetype,versenum) versetag=u'%s%d'%(versetype,versenum)
else: else:
versenum = None # allow error trap versenum = 1
continue continue
words=None words=None
@ -180,6 +181,7 @@ class OpenSongImport:
assert len(our_verse_order)>0 assert len(our_verse_order)>0
order=our_verse_order order=our_verse_order
for tag in order: for tag in order:
print tag
if not versetags.has_key(tag): if not versetags.has_key(tag):
raise OpenSongImportError raise OpenSongImportError
else: else:

View File

@ -27,10 +27,12 @@
[b1] [b1]
Bridge 1 Bridge 1
Bridge 1 line 2 Bridge 1 line 2
[C1] [C]
. A B
Chorus 1 Chorus 1
[C2] [C2]
. A B
Chorus 2 Chorus 2
</lyrics> </lyrics>
<style index="default_style"> <style index="default_style">