Fix unicode skip issue with the strip_rtf function.

Add doc comment to EasyWorship6 import method.
This commit is contained in:
Gary Talent 2016-09-20 22:10:28 -05:00
parent 5435dfc5cc
commit 08416db1d3
2 changed files with 9 additions and 3 deletions

View File

@ -512,10 +512,13 @@ def strip_rtf(text, default_encoding=None):
elif not ignorable:
ebytes.append(int(hex_, 16))
elif tchar:
if curskip > 0:
curskip -= 1
elif not ignorable:
if not ignorable:
ebytes += tchar.encode()
if len(ebytes) >= curskip:
ebytes = ebytes[curskip:]
else:
curskip -= len(ebytes)
ebytes = ""
text = ''.join(out)
return text, default_encoding

View File

@ -341,6 +341,9 @@ class EasyWorshipSongImport(SongImport):
self.memo_file.close()
def import_sqlite_db(self):
"""
Import the songs from an EasyWorship 6 SQLite database
"""
# get database handles
songs_conn = sqlite3.connect(self.import_source + "/Databases/Data/Songs.db")
words_conn = sqlite3.connect(self.import_source + "/Databases/Data/SongWords.db")