Fix up some more linting issues

This commit is contained in:
Raoul Snyman 2018-10-26 21:13:33 -07:00
parent e3b46b9430
commit dc5a9590ba
6 changed files with 6 additions and 6 deletions

View File

@ -704,7 +704,7 @@ class ServiceManager(QtWidgets.QWidget, RegistryBase, Ui_ServiceManager, LogMixi
Settings().setValue('servicemanager/last file', file_path) Settings().setValue('servicemanager/last file', file_path)
else: else:
raise ValidationError(msg='No service data found') raise ValidationError(msg='No service data found')
except (NameError, OSError, ValidationError, zipfile.BadZipFile) as e: except (NameError, OSError, ValidationError, zipfile.BadZipFile):
self.log_exception('Problem loading service file {name}'.format(name=file_path)) self.log_exception('Problem loading service file {name}'.format(name=file_path))
critical_error_message_box( critical_error_message_box(
message=translate('OpenLP.ServiceManager', message=translate('OpenLP.ServiceManager',

View File

@ -583,7 +583,7 @@ class BibleImportForm(OpenLPWizard):
(WebDownload.Bibleserver, BSExtract())): (WebDownload.Bibleserver, BSExtract())):
try: try:
bibles = extractor.get_bibles_from_http() bibles = extractor.get_bibles_from_http()
except (urllib.error.URLError, ConnectionError) as err: except (urllib.error.URLError, ConnectionError):
critical_error_message_box(translate('BiblesPlugin.ImportWizardForm', 'Error during download'), critical_error_message_box(translate('BiblesPlugin.ImportWizardForm', 'Error during download'),
translate('BiblesPlugin.ImportWizardForm', translate('BiblesPlugin.ImportWizardForm',
'An error occurred while downloading the list of bibles from %s.')) 'An error occurred while downloading the list of bibles from %s.'))

View File

@ -749,7 +749,7 @@ def get_soup_for_bible_ref(reference_url, headers=None, pre_parse_regex=None, pr
return None return None
try: try:
page_source = get_web_page(reference_url, headers, update_openlp=True) page_source = get_web_page(reference_url, headers, update_openlp=True)
except Exception as e: except Exception:
log.exception('Unable to download Bible %s, unknown exception occurred', reference_url) log.exception('Unable to download Bible %s, unknown exception occurred', reference_url)
page_source = None page_source = None
if not page_source: if not page_source:

View File

@ -279,7 +279,7 @@ class PdfDocument(PresentationDocument):
for image_path in created_files: for image_path in created_files:
if image_path.is_file(): if image_path.is_file():
self.image_files.append(image_path) self.image_files.append(image_path)
except Exception as e: except Exception:
log.exception(runlog) log.exception(runlog)
return False return False
self.num_pages = len(self.image_files) self.num_pages = len(self.image_files)

View File

@ -107,7 +107,7 @@ class EasySlidesImport(SongImport):
def _add_authors(self, writer): def _add_authors(self, writer):
try: try:
self.parse_author(str(writer)) self.parse_author(str(writer))
except UnicodeDecodeError as e: except UnicodeDecodeError:
log.exception('Unicode decode error while decoding Writer') log.exception('Unicode decode error while decoding Writer')
self._success = False self._success = False

View File

@ -194,7 +194,7 @@ class SundayPlusImport(SongImport):
while True: while True:
try: try:
return blob.decode(self.encoding) return blob.decode(self.encoding)
except Exception as e: except Exception:
self.encoding = retrieve_windows_encoding() self.encoding = retrieve_windows_encoding()
def unescape(self, text): def unescape(self, text):