openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #01399
[Merge] lp:~raoul-snyman/openlp/converters into lp:openlp
Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/converters into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
--
https://code.launchpad.net/~raoul-snyman/openlp/converters/+merge/23125
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'scripts/openlp-1to2-converter.py'
--- scripts/openlp-1to2-converter.py 2010-03-21 23:58:01 +0000
+++ scripts/openlp-1to2-converter.py 2010-04-09 17:04:17 +0000
@@ -183,16 +183,18 @@
xml_verse_template = u'<verse label="%d" type="Verse"><![CDATA[%s]]></verse>'
for row in rows:
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')
verse_order = u''
text_lyrics = clean_lyrics.split(u'\n\n')
xml_verse = u''
+ verses = []
for line, verse in enumerate(text_lyrics):
if not verse:
continue
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
search_title = prepare_string(clean_title)
search_lyrics = prepare_string(clean_lyrics)
Follow ups