Add specific error messages for file problems.

Remove unicode strings in calls to translate()
This commit is contained in:
Gerald Britton 2011-05-26 14:20:14 -04:00
parent e70ba41373
commit 74e47dcbc7

View File

@ -67,14 +67,10 @@ class OooImport(SongImport):
self.log_error( self.log_error(
self.import_source[0], self.import_source[0],
translate('SongsPlugin.SongImport', translate('SongsPlugin.SongImport',
u'Unable to open OpenOffice.org or LibreOffice')) 'Unable to open OpenOffice.org or LibreOffice'))
log.error(exc) log.error(exc)
return return
self.import_wizard.progressBar.setMaximum(len(self.import_source)) self.import_wizard.progressBar.setMaximum(len(self.import_source))
error_msg = lambda: self.log_error(
self.filepath,
translate('SongsPlugin.SongImport',
u'Unable to open file'))
for filename in self.import_source: for filename in self.import_source:
if self.stop_import_flag: if self.stop_import_flag:
break break
@ -85,9 +81,13 @@ class OooImport(SongImport):
self.process_ooo_document() self.process_ooo_document()
self.close_ooo_file() self.close_ooo_file()
else: else:
error_msg() self.log_error(self.filepath,
translate('SongsPlugin.SongImport',
'Unable to open file'))
else: else:
error_msg() self.log_error(self.filepath,
translate('SongsPlugin.SongImport',
'File not found'))
self.close_ooo() self.close_ooo()
def process_ooo_document(self): def process_ooo_document(self):