From 66d3c3c1bf29f2b19fdc229d3703923735b6b160 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Fri, 9 Apr 2010 18:36:04 +0200 Subject: [PATCH 1/2] Some fixes I thought I had fixed eons ago. --- scripts/openlp-1to2-converter.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/openlp-1to2-converter.py b/scripts/openlp-1to2-converter.py index 3b805a1bd..64831c7eb 100755 --- a/scripts/openlp-1to2-converter.py +++ b/scripts/openlp-1to2-converter.py @@ -183,16 +183,18 @@ def import_songs(): xml_verse_template = u'' 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) From a4443cd44d6dd67d9dbe93a5b29c544058591fe1 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Fri, 9 Apr 2010 19:36:10 +0200 Subject: [PATCH 2/2] Added alternate title. --- scripts/openlp-1to2-converter.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/openlp-1to2-converter.py b/scripts/openlp-1to2-converter.py index 64831c7eb..8645fc2a4 100755 --- a/scripts/openlp-1to2-converter.py +++ b/scripts/openlp-1to2-converter.py @@ -58,6 +58,7 @@ create_statements = [ id INTEGER NOT NULL, song_book_id INTEGER, title VARCHAR(255) NOT NULL, + alternate_title VARCHAR(255), lyrics TEXT NOT NULL, verse_order VARCHAR(128), copyright VARCHAR(255),