fixed bug #1063421 (Error when attempting to import a Sunday Plus song file.)

bzr-revno: 2082
Fixes: https://launchpad.net/bugs/1063421
This commit is contained in:
Philip Ridout 2012-10-11 11:44:11 +02:00 committed by Andreas Preikschat
commit fb624d0c54

View File

@ -154,18 +154,20 @@ class SundayPlusImport(SongImport):
# If any line inside any verse contains CCLI or
# only Public Domain, we treat this as special data:
# we remove that line and add data to specific field.
processed_lines = []
for i in xrange(len(lines)):
lines[i] = lines[i].strip()
line = lines[i]
if line[:4].lower() == u'ccli':
line = lines[i].strip()
if line[:3].lower() == u'ccl':
m = re.search(r'[0-9]+', line)
if m:
self.ccliNumber = int(m.group(0))
lines.pop(i)
continue
elif line.lower() == u'public domain':
self.copyright = u'Public Domain'
lines.pop(i)
self.addVerse('\n'.join(lines).strip(), verse_type)
continue
processed_lines.append(line)
self.addVerse('\n'.join(processed_lines).strip(),
verse_type)
if end == -1:
break
i = end + 1