openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #00737
[Merge] lp:~raoul-snyman/openlp/converter into lp:openlp
Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/converter into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
--
https://code.launchpad.net/~raoul-snyman/openlp/converter/+merge/14244
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp-1to2-converter.py'
--- openlp-1to2-converter.py 2009-10-25 21:36:04 +0000
+++ openlp-1to2-converter.py 2009-10-30 22:35:18 +0000
@@ -94,7 +94,7 @@
)""")
]
-def clean_string(dirty):
+def prepare_string(dirty):
return dirty_chars.sub(u'', dirty.replace(u'\r\n', ' ').replace(u'\n', ' '))
def display_sql(sql, params):
@@ -193,12 +193,12 @@
xml_verse += (xml_verse_template % (line + 1, verse))
verse_order += '%d ' % (line + 1)
xml_lyrics = xml_lyrics_template % xml_verse
- search_title = clean_string(clean_title)
- search_lyrics = clean_string(clean_lyrics)
+ search_title = prepare_string(clean_title)
+ search_lyrics = prepare_string(clean_lyrics)
sql_insert = u'INSERT INTO songs '\
'(id, song_book_id, title, lyrics, verse_order, copyright, search_title, search_lyrics) '\
'VALUES (NULL, 0, ?, ?, ?, ?, ?, ?)'
- sql_params = (clean_title, xml_lyrics, verse_order, clean_copyright, clean_title, clean_lyrics)
+ sql_params = (clean_title, xml_lyrics, verse_order, clean_copyright, search_title, search_lyrics)
if debug:
print '...', display_sql(sql_insert, (sql_params[0], u'%s...' % clean_lyrics[:7], sql_params[2], sql_params[3], sql_params[4], u'%s...' % search_lyrics[:7]))
elif verbose:
Follow ups