forked from openlp/openlp
Better wording, indentation
This commit is contained in:
parent
d3923fa08c
commit
bc6eca2dec
@ -64,21 +64,25 @@ class EasyWorshipSongImport(SongImport):
|
|||||||
|
|
||||||
def doImport(self):
|
def doImport(self):
|
||||||
# Open the DB and MB files if they exist
|
# Open the DB and MB files if they exist
|
||||||
import_source_mb = self.importSource.replace('.DB', '.MB').replace('.db', '.mb')
|
import_source_mb = self.importSource.replace('.DB', '.MB')
|
||||||
|
.replace('.db', '.mb')
|
||||||
if not os.path.isfile(self.importSource):
|
if not os.path.isfile(self.importSource):
|
||||||
self.logError(self.importSource, translate('SongsPlugin.EasyWorshipSongImport',
|
self.logError(self.importSource, translate(
|
||||||
'This file does not exist.'))
|
'SongsPlugin.EasyWorshipSongImport',
|
||||||
|
'This file does not exist.'))
|
||||||
return
|
return
|
||||||
return
|
return
|
||||||
if not os.path.isfile(import_source_mb):
|
if not os.path.isfile(import_source_mb):
|
||||||
self.logError(self.importSource, translate('SongsPlugin.EasyWorshipSongImport',
|
self.logError(self.importSource, translate(
|
||||||
'Could not find the "Songs.MB" file. It must be in the same '
|
'SongsPlugin.EasyWorshipSongImport',
|
||||||
'folder as the "Songs.DB" file.'))
|
'Could not find the "Songs.MB" file. It must be in the same '
|
||||||
|
'folder as the "Songs.DB" file.'))
|
||||||
return
|
return
|
||||||
db_size = os.path.getsize(self.importSource)
|
db_size = os.path.getsize(self.importSource)
|
||||||
if db_size < 0x800:
|
if db_size < 0x800:
|
||||||
self.logError(self.importSource, translate('SongsPlugin.EasyWorshipSongImport',
|
self.logError(self.importSource, translate(
|
||||||
'This file is no valid EasyWorship Database.'))
|
'SongsPlugin.EasyWorshipSongImport',
|
||||||
|
'This file is not a valid EasyWorship database.'))
|
||||||
return
|
return
|
||||||
db_file = open(self.importSource, 'rb')
|
db_file = open(self.importSource, 'rb')
|
||||||
self.memoFile = open(import_source_mb, 'rb')
|
self.memoFile = open(import_source_mb, 'rb')
|
||||||
@ -88,8 +92,9 @@ class EasyWorshipSongImport(SongImport):
|
|||||||
if header_size != 0x800 or block_size < 1 or block_size > 4:
|
if header_size != 0x800 or block_size < 1 or block_size > 4:
|
||||||
db_file.close()
|
db_file.close()
|
||||||
self.memoFile.close()
|
self.memoFile.close()
|
||||||
self.logError(self.importSource, translate('SongsPlugin.EasyWorshipSongImport',
|
self.logError(self.importSource, translate(
|
||||||
'This file is no valid EasyWorship Database.'))
|
'SongsPlugin.EasyWorshipSongImport',
|
||||||
|
'This file is not a valid EasyWorship database.'))
|
||||||
return
|
return
|
||||||
# Take a stab at how text is encoded
|
# Take a stab at how text is encoded
|
||||||
self.encoding = u'cp1252'
|
self.encoding = u'cp1252'
|
||||||
@ -203,8 +208,9 @@ class EasyWorshipSongImport(SongImport):
|
|||||||
result = strip_rtf(words, self.encoding)
|
result = strip_rtf(words, self.encoding)
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
# The unicode chars in the rtf was not escaped in the expected manner.
|
# The unicode chars in the rtf was not escaped in the expected manner.
|
||||||
self.logError(self.title, unicode(translate('SongsPlugin.EasyWorshipSongImport',
|
self.logError(self.title, unicode(translate(
|
||||||
'Unexpected data formatting.')))
|
'SongsPlugin.EasyWorshipSongImport',
|
||||||
|
'Unexpected data formatting.')))
|
||||||
continue
|
continue
|
||||||
if result is None:
|
if result is None:
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user