forked from openlp/openlp
Fix unicode skip issue with the strip_rtf function.
Add doc comment to EasyWorship6 import method.
This commit is contained in:
parent
5435dfc5cc
commit
08416db1d3
@ -512,10 +512,13 @@ def strip_rtf(text, default_encoding=None):
|
|||||||
elif not ignorable:
|
elif not ignorable:
|
||||||
ebytes.append(int(hex_, 16))
|
ebytes.append(int(hex_, 16))
|
||||||
elif tchar:
|
elif tchar:
|
||||||
if curskip > 0:
|
if not ignorable:
|
||||||
curskip -= 1
|
|
||||||
elif not ignorable:
|
|
||||||
ebytes += tchar.encode()
|
ebytes += tchar.encode()
|
||||||
|
if len(ebytes) >= curskip:
|
||||||
|
ebytes = ebytes[curskip:]
|
||||||
|
else:
|
||||||
|
curskip -= len(ebytes)
|
||||||
|
ebytes = ""
|
||||||
text = ''.join(out)
|
text = ''.join(out)
|
||||||
return text, default_encoding
|
return text, default_encoding
|
||||||
|
|
||||||
|
@ -341,6 +341,9 @@ class EasyWorshipSongImport(SongImport):
|
|||||||
self.memo_file.close()
|
self.memo_file.close()
|
||||||
|
|
||||||
def import_sqlite_db(self):
|
def import_sqlite_db(self):
|
||||||
|
"""
|
||||||
|
Import the songs from an EasyWorship 6 SQLite database
|
||||||
|
"""
|
||||||
# get database handles
|
# get database handles
|
||||||
songs_conn = sqlite3.connect(self.import_source + "/Databases/Data/Songs.db")
|
songs_conn = sqlite3.connect(self.import_source + "/Databases/Data/Songs.db")
|
||||||
words_conn = sqlite3.connect(self.import_source + "/Databases/Data/SongWords.db")
|
words_conn = sqlite3.connect(self.import_source + "/Databases/Data/SongWords.db")
|
||||||
|
Loading…
Reference in New Issue
Block a user