openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #33240
[Merge] lp:~raoul-snyman/openlp/fix-circ-deps into lp:openlp
Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/fix-circ-deps into lp:openlp.
Commit message:
Remove the circular dependency problems in the custom slide plugin, and clean up the linting issues.
Requested reviews:
Bastian Germann (bastian-germann)
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~raoul-snyman/openlp/fix-circ-deps/+merge/357905
Remove the circular dependency problems in the custom slide plugin, and clean up the linting issues.
--
Your team OpenLP Core is requested to review the proposed merge of lp:~raoul-snyman/openlp/fix-circ-deps into lp:openlp.
=== modified file 'openlp/core/api/__init__.py'
--- openlp/core/api/__init__.py 2017-12-29 09:15:48 +0000
+++ openlp/core/api/__init__.py 2018-10-27 04:14:21 +0000
@@ -19,10 +19,3 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
-
-from openlp.core.api.http import register_endpoint, requires_auth
-from openlp.core.api.http.endpoint import Endpoint
-from openlp.core.api.poll import Poller
-from openlp.core.api.tab import ApiTab
-
-__all__ = ['Endpoint', 'ApiTab', 'register_endpoint', 'requires_auth']
=== modified file 'openlp/core/api/endpoint/__init__.py'
--- openlp/core/api/endpoint/__init__.py 2017-12-29 09:15:48 +0000
+++ openlp/core/api/endpoint/__init__.py 2018-10-27 04:14:21 +0000
@@ -22,4 +22,3 @@
"""
The Endpoint class, which provides plugins with a way to serve their own portion of the API
"""
-from .pluginhelpers import search, live, service
=== modified file 'openlp/core/api/http/__init__.py'
--- openlp/core/api/http/__init__.py 2017-12-29 09:15:48 +0000
+++ openlp/core/api/http/__init__.py 2018-10-27 04:14:21 +0000
@@ -27,7 +27,6 @@
from openlp.core.api.http.wsgiapp import WSGIApplication
from openlp.core.common.settings import Settings
-from .errors import NotFound, ServerError, HttpError
application = WSGIApplication('api')
=== modified file 'openlp/core/api/poll.py'
--- openlp/core/api/poll.py 2017-12-29 09:15:48 +0000
+++ openlp/core/api/poll.py 2018-10-27 04:14:21 +0000
@@ -90,7 +90,7 @@
if self.stage_cache is None:
try:
page = get_web_page("http://localhost:4316/stage")
- except:
+ except Exception:
page = None
if page:
self.stage_cache = True
@@ -106,7 +106,7 @@
if self.live_cache is None:
try:
page = get_web_page("http://localhost:4316/main")
- except:
+ except Exception:
page = None
if page:
self.live_cache = True
@@ -122,7 +122,7 @@
if self.chords_cache is None:
try:
page = get_web_page("http://localhost:4316/chords")
- except:
+ except Exception:
page = None
if page:
self.chords_cache = True
=== modified file 'openlp/core/common/i18n.py'
--- openlp/core/common/i18n.py 2018-08-27 14:16:26 +0000
+++ openlp/core/common/i18n.py 2018-10-27 04:14:21 +0000
@@ -522,7 +522,7 @@
icu_locale = icu.Locale(language)
ICU_COLLATOR = icu.Collator.createInstance(icu_locale)
return ICU_COLLATOR.getSortKey(string)
- except:
+ except Exception:
return locale.strxfrm(string).encode()
=== modified file 'openlp/core/lib/db.py'
--- openlp/core/lib/db.py 2017-12-29 09:15:48 +0000
+++ openlp/core/lib/db.py 2018-10-27 04:14:21 +0000
@@ -408,7 +408,7 @@
self.session.rollback()
log.exception('Object list save failed')
return False
- except:
+ except Exception:
self.session.rollback()
raise
@@ -438,7 +438,7 @@
self.session.rollback()
log.exception('Object list save failed')
return False
- except:
+ except Exception:
self.session.rollback()
raise
@@ -555,7 +555,7 @@
self.session.rollback()
log.exception('Failed to delete object')
return False
- except:
+ except Exception:
self.session.rollback()
raise
else:
@@ -590,7 +590,7 @@
self.session.rollback()
log.exception('Failed to delete {name} records'.format(name=object_class.__name__))
return False
- except:
+ except Exception:
self.session.rollback()
raise
=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py 2018-04-22 06:59:35 +0000
+++ openlp/core/lib/serviceitem.py 2018-10-27 04:14:21 +0000
@@ -39,7 +39,7 @@
from openlp.core.common.mixins import RegistryProperties
from openlp.core.common.path import Path
from openlp.core.common.settings import Settings
-from openlp.core.lib import ImageSource, build_icon, clean_tags, expand_tags, expand_chords
+from openlp.core.lib import ImageSource, clean_tags, expand_tags, expand_chords
log = logging.getLogger(__name__)
=== modified file 'openlp/core/projectors/manager.py'
--- openlp/core/projectors/manager.py 2018-10-20 04:33:32 +0000
+++ openlp/core/projectors/manager.py 2018-10-27 04:14:21 +0000
@@ -470,7 +470,7 @@
projector = list_item.data(QtCore.Qt.UserRole)
try:
projector.link.set_shutter_closed()
- except:
+ except Exception:
continue
def on_doubleclick_item(self, item, opt=None):
@@ -485,7 +485,7 @@
try:
log.debug('ProjectorManager: Calling connect_to_host() on "{ip}"'.format(ip=projector.link.ip))
projector.link.connect_to_host()
- except:
+ except Exception:
log.debug('ProjectorManager: "{ip}" already connected - skipping'.format(ip=projector.link.ip))
return
@@ -504,7 +504,7 @@
projector = list_item.data(QtCore.Qt.UserRole)
try:
projector.link.connect_to_host()
- except:
+ except Exception:
continue
def on_delete_projector(self, opt=None):
@@ -586,7 +586,7 @@
projector = list_item.data(QtCore.Qt.UserRole)
try:
projector.link.disconnect_from_host()
- except:
+ except Exception:
continue
def on_edit_projector(self, opt=None):
@@ -619,7 +619,7 @@
projector = list_item.data(QtCore.Qt.UserRole)
try:
projector.link.set_power_off()
- except:
+ except Exception:
continue
def on_poweron_projector(self, opt=None):
@@ -637,7 +637,7 @@
projector = list_item.data(QtCore.Qt.UserRole)
try:
projector.link.set_power_on()
- except:
+ except Exception:
continue
def on_show_projector(self, opt=None):
@@ -655,7 +655,7 @@
projector = list_item.data(QtCore.Qt.UserRole)
try:
projector.link.set_shutter_open()
- except:
+ except Exception:
continue
def on_status_projector(self, opt=None):
=== modified file 'openlp/core/ui/exceptiondialog.py'
--- openlp/core/ui/exceptiondialog.py 2018-06-10 19:29:00 +0000
+++ openlp/core/ui/exceptiondialog.py 2018-10-27 04:14:21 +0000
@@ -23,7 +23,7 @@
The GUI widgets of the exception dialog.
"""
-from PyQt5 import QtGui, QtWidgets
+from PyQt5 import QtWidgets
from openlp.core.common.i18n import translate
from openlp.core.ui.icons import UiIcons
=== modified file 'openlp/core/ui/exceptionform.py'
--- openlp/core/ui/exceptionform.py 2017-12-29 09:15:48 +0000
+++ openlp/core/ui/exceptionform.py 2018-10-27 04:14:21 +0000
@@ -241,5 +241,5 @@
return node.getByName('ooSetupVersion')
except ImportError:
return '-'
- except:
+ except Exception:
return '- (Possible non-standard UNO installation)'
=== modified file 'openlp/core/ui/icons.py'
--- openlp/core/ui/icons.py 2018-08-05 20:28:01 +0000
+++ openlp/core/ui/icons.py 2018-10-27 04:14:21 +0000
@@ -173,9 +173,9 @@
setattr(self, key, qta.icon(icon))
except Exception:
import sys
- log.error("Unexpected error: %s" % sys.exc_info())
+ log.error('Unexpected error: %s' % sys.exc_info())
setattr(self, key, qta.icon('fa.plus-circle', color='red'))
- except:
+ except Exception:
setattr(self, key, qta.icon('fa.plus-circle', color='red'))
self.main_icon = build_icon(':/icon/openlp-logo.svg')
=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py 2018-08-25 14:08:19 +0000
+++ openlp/core/ui/maindisplay.py 2018-10-27 04:14:21 +0000
@@ -172,7 +172,7 @@
# Get a pointer to the underlying NSView
try:
nsview_pointer = self.winId().ascapsule()
- except:
+ except Exception:
nsview_pointer = voidptr(self.winId()).ascapsule()
# Set PyCapsule name so pyobjc will accept it
pythonapi.PyCapsule_SetName.restype = c_void_p
@@ -582,7 +582,7 @@
window_id = window.winId().__int__()
main_window_id = self.main_window.winId().__int__()
self_id = self.winId().__int__()
- except:
+ except Exception:
return
# If the passed window has the same id as our window make sure the display has the proper level and
# collection behavior.
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2018-08-25 14:36:46 +0000
+++ openlp/core/ui/mainwindow.py 2018-10-27 04:14:21 +0000
@@ -57,7 +57,7 @@
from openlp.core.ui.slidecontroller import LiveController, PreviewController
from openlp.core.ui.settingsform import SettingsForm
from openlp.core.ui.firsttimeform import FirstTimeForm
-from openlp.core.ui.media import MediaController
+from openlp.core.ui.media.mediacontroller import MediaController
from openlp.core.ui.printserviceform import PrintServiceForm
from openlp.core.ui.style import PROGRESSBAR_STYLE, get_library_stylesheet
from openlp.core.version import get_version
=== modified file 'openlp/core/ui/media/__init__.py'
--- openlp/core/ui/media/__init__.py 2018-07-02 20:38:47 +0000
+++ openlp/core/ui/media/__init__.py 2018-10-27 04:14:21 +0000
@@ -142,10 +142,3 @@
minutes=minutes,
seconds=seconds,
millis=millis)
-
-
-from .mediacontroller import MediaController
-from .playertab import PlayerTab
-from .endpoint import media_endpoint
-
-__all__ = ['MediaController', 'PlayerTab']
=== modified file 'openlp/core/ui/media/vendor/mediainfoWrapper.py'
--- openlp/core/ui/media/vendor/mediainfoWrapper.py 2018-10-16 20:58:39 +0000
+++ openlp/core/ui/media/vendor/mediainfoWrapper.py 2018-10-27 04:14:21 +0000
@@ -37,7 +37,7 @@
def __getattribute__(self, name):
try:
return object.__getattribute__(self, name)
- except:
+ except Exception:
pass
return None
@@ -63,14 +63,14 @@
try:
primary = o.replace('other_', '')
setattr(self, primary, int(getattr(self, primary)))
- except:
+ except Exception:
for v in getattr(self, o):
try:
current = getattr(self, primary)
setattr(self, primary, int(v))
getattr(self, o).append(current)
break
- except:
+ except Exception:
pass
def __repr__(self):
=== modified file 'openlp/core/ui/media/vlcplayer.py'
--- openlp/core/ui/media/vlcplayer.py 2018-03-18 15:33:50 +0000
+++ openlp/core/ui/media/vlcplayer.py 2018-10-27 04:14:21 +0000
@@ -69,7 +69,7 @@
is_vlc_available = False
try:
is_vlc_available = bool(sys.modules['openlp.core.ui.media.vendor.vlc'].get_default_instance())
- except:
+ except Exception:
pass
if is_vlc_available:
return sys.modules['openlp.core.ui.media.vendor.vlc']
@@ -106,7 +106,7 @@
if is_vlc_available:
try:
VERSION = vlc.libvlc_get_version().decode('UTF-8')
- except:
+ except Exception:
VERSION = '0.0.0'
# LooseVersion does not work when a string contains letter and digits (e. g. 2.0.5 Twoflower).
# http://bugs.python.org/issue14894
@@ -130,7 +130,7 @@
# If libx11.so.6 was not found, fallback to more generic libx11.so
x11 = ctypes.cdll.LoadLibrary('libX11.so')
x11.XInitThreads()
- except:
+ except Exception:
log.exception('Failed to run XInitThreads(), VLC might not work properly!')
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py 2018-08-25 14:36:46 +0000
+++ openlp/core/ui/servicemanager.py 2018-10-27 04:14:21 +0000
@@ -704,7 +704,7 @@
Settings().setValue('servicemanager/last file', file_path)
else:
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))
critical_error_message_box(
message=translate('OpenLP.ServiceManager',
=== modified file 'openlp/core/ui/settingsform.py'
--- openlp/core/ui/settingsform.py 2018-08-25 14:36:46 +0000
+++ openlp/core/ui/settingsform.py 2018-10-27 04:14:21 +0000
@@ -34,7 +34,7 @@
from openlp.core.ui.advancedtab import AdvancedTab
from openlp.core.ui.generaltab import GeneralTab
from openlp.core.ui.themestab import ThemesTab
-from openlp.core.ui.media import PlayerTab
+from openlp.core.ui.media.playertab import PlayerTab
from openlp.core.ui.settingsdialog import Ui_SettingsDialog
log = logging.getLogger(__name__)
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2018-08-25 14:36:46 +0000
+++ openlp/core/ui/slidecontroller.py 2018-10-27 04:14:21 +0000
@@ -36,7 +36,7 @@
from openlp.core.common.registry import Registry, RegistryBase
from openlp.core.common.settings import Settings
from openlp.core.display.screens import ScreenList
-from openlp.core.lib import ImageSource, ServiceItemAction, build_icon
+from openlp.core.lib import ImageSource, ServiceItemAction
from openlp.core.lib.htmlbuilder import build_html
from openlp.core.lib.serviceitem import ServiceItem, ItemCapabilities
from openlp.core.lib.ui import create_action
=== modified file 'openlp/core/version.py'
--- openlp/core/version.py 2018-06-28 20:40:54 +0000
+++ openlp/core/version.py 2018-10-27 04:14:21 +0000
@@ -24,11 +24,8 @@
"""
import logging
import platform
-import sys
-import time
from datetime import date
from distutils.version import LooseVersion
-from subprocess import Popen, PIPE
import requests
from PyQt5 import QtCore
=== modified file 'openlp/core/widgets/edits.py'
--- openlp/core/widgets/edits.py 2018-08-25 14:08:19 +0000
+++ openlp/core/widgets/edits.py 2018-10-27 04:14:21 +0000
@@ -31,7 +31,6 @@
from openlp.core.common.i18n import UiStrings, translate
from openlp.core.common.path import Path, path_to_str, str_to_path
from openlp.core.common.settings import Settings
-from openlp.core.lib import build_icon
from openlp.core.lib.formattingtags import FormattingTags
from openlp.core.lib.ui import create_widget_action, create_action
from openlp.core.ui.icons import UiIcons
=== modified file 'openlp/core/widgets/views.py'
--- openlp/core/widgets/views.py 2018-08-25 14:08:19 +0000
+++ openlp/core/widgets/views.py 2018-10-27 04:14:21 +0000
@@ -135,7 +135,7 @@
# Get and validate label widget containing slide & adjust max width
try:
self.cellWidget(row, 0).children()[1].setMaximumWidth(new_height * self.screen_ratio)
- except:
+ except Exception:
return
def screen_size_changed(self, screen_ratio):
=== modified file 'openlp/core/widgets/wizard.py'
--- openlp/core/widgets/wizard.py 2018-06-03 16:07:20 +0000
+++ openlp/core/widgets/wizard.py 2018-10-27 04:14:21 +0000
@@ -32,7 +32,6 @@
from openlp.core.common.mixins import RegistryProperties
from openlp.core.common.registry import Registry
from openlp.core.common.settings import Settings
-from openlp.core.lib import build_icon
from openlp.core.lib.ui import add_welcome_page
from openlp.core.widgets.dialogs import FileDialog
=== modified file 'openlp/plugins/alerts/alertsplugin.py'
--- openlp/plugins/alerts/alertsplugin.py 2018-08-25 14:08:19 +0000
+++ openlp/plugins/alerts/alertsplugin.py 2018-10-27 04:14:21 +0000
@@ -35,8 +35,9 @@
from openlp.core.ui import AlertLocation
from openlp.core.ui.icons import UiIcons
from openlp.plugins.alerts.endpoint import api_alerts_endpoint, alerts_endpoint
-from openlp.plugins.alerts.forms import AlertForm
-from openlp.plugins.alerts.lib import AlertsManager, AlertsTab
+from openlp.plugins.alerts.forms.alertform import AlertForm
+from openlp.plugins.alerts.lib.alertsmanager import AlertsManager
+from openlp.plugins.alerts.lib.alertstab import AlertsTab
from openlp.plugins.alerts.lib.db import init_schema
log = logging.getLogger(__name__)
=== modified file 'openlp/plugins/alerts/endpoint.py'
--- openlp/plugins/alerts/endpoint.py 2018-08-25 14:08:19 +0000
+++ openlp/plugins/alerts/endpoint.py 2018-10-27 04:14:21 +0000
@@ -22,7 +22,6 @@
import json
import logging
import urllib
-from urllib.parse import urlparse
from openlp.core.api.http import requires_auth
from openlp.core.api.http.endpoint import Endpoint
=== modified file 'openlp/plugins/alerts/forms/__init__.py'
--- openlp/plugins/alerts/forms/__init__.py 2017-12-29 09:15:48 +0000
+++ openlp/plugins/alerts/forms/__init__.py 2018-10-27 04:14:21 +0000
@@ -40,5 +40,3 @@
This allows OpenLP to use ``self.object`` for all the GUI elements while keeping them separate from the functionality,
so that it is easier to recreate the GUI from the .ui files later if necessary.
"""
-
-from .alertform import AlertForm
=== modified file 'openlp/plugins/alerts/lib/__init__.py'
--- openlp/plugins/alerts/lib/__init__.py 2017-12-29 09:15:48 +0000
+++ openlp/plugins/alerts/lib/__init__.py 2018-10-27 04:14:21 +0000
@@ -19,6 +19,3 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
-
-from .alertsmanager import AlertsManager
-from .alertstab import AlertsTab
=== modified file 'openlp/plugins/bibles/bibleplugin.py'
--- openlp/plugins/bibles/bibleplugin.py 2018-10-22 20:17:55 +0000
+++ openlp/plugins/bibles/bibleplugin.py 2018-10-27 04:14:21 +0000
@@ -26,13 +26,13 @@
from openlp.core.common.actions import ActionList
from openlp.core.common.i18n import UiStrings, translate
from openlp.core.ui.icons import UiIcons
-from openlp.core.lib import build_icon
from openlp.core.lib.plugin import Plugin, StringContent
from openlp.core.lib.ui import create_action
from openlp.plugins.bibles.endpoint import api_bibles_endpoint, bibles_endpoint
-from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem, LayoutStyle, DisplayStyle, \
- LanguageSelection
-from openlp.plugins.bibles.lib.mediaitem import BibleSearch
+from openlp.plugins.bibles.lib import LayoutStyle, DisplayStyle, LanguageSelection
+from openlp.plugins.bibles.lib.biblestab import BiblesTab
+from openlp.plugins.bibles.lib.manager import BibleManager
+from openlp.plugins.bibles.lib.mediaitem import BibleMediaItem, BibleSearch
log = logging.getLogger(__name__)
=== modified file 'openlp/plugins/bibles/forms/bibleimportform.py'
--- openlp/plugins/bibles/forms/bibleimportform.py 2018-10-22 20:17:55 +0000
+++ openlp/plugins/bibles/forms/bibleimportform.py 2018-10-27 04:14:21 +0000
@@ -31,7 +31,7 @@
try:
from pysword import modules
PYSWORD_AVAILABLE = True
-except:
+except ImportError:
PYSWORD_AVAILABLE = False
from openlp.core.common import trace_error_handler
@@ -583,7 +583,7 @@
(WebDownload.Bibleserver, BSExtract())):
try:
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'),
translate('BiblesPlugin.ImportWizardForm',
'An error occurred while downloading the list of bibles from %s.'))
@@ -613,7 +613,7 @@
self.sword_bible_combo_box.clear()
for key in bible_keys:
self.sword_bible_combo_box.addItem(self.pysword_folder_modules_json[key]['description'], key)
- except:
+ except Exception:
self.sword_bible_combo_box.clear()
def on_sword_zipfile_path_edit_path_changed(self, new_path):
@@ -628,7 +628,7 @@
self.sword_zipbible_combo_box.clear()
for key in bible_keys:
self.sword_zipbible_combo_box.addItem(self.pysword_zip_modules_json[key]['description'], key)
- except:
+ except Exception:
self.sword_zipbible_combo_box.clear()
def register_fields(self):
=== modified file 'openlp/plugins/bibles/lib/__init__.py'
--- openlp/plugins/bibles/lib/__init__.py 2018-07-04 20:42:55 +0000
+++ openlp/plugins/bibles/lib/__init__.py 2018-10-27 04:14:21 +0000
@@ -424,9 +424,3 @@
Returns whether or not the verse list contains verses.
"""
return len(self.verse_list) > 0
-
-
-from .versereferencelist import VerseReferenceList
-from .manager import BibleManager
-from .biblestab import BiblesTab
-from .mediaitem import BibleMediaItem
=== modified file 'openlp/plugins/bibles/lib/importers/csvbible.py'
--- openlp/plugins/bibles/lib/importers/csvbible.py 2017-12-29 09:15:48 +0000
+++ openlp/plugins/bibles/lib/importers/csvbible.py 2018-10-27 04:14:21 +0000
@@ -54,7 +54,6 @@
from openlp.core.common import get_file_encoding
from openlp.core.common.i18n import translate
-from openlp.core.common.path import Path
from openlp.core.lib.exceptions import ValidationError
from openlp.plugins.bibles.lib.bibleimport import BibleImport
=== modified file 'openlp/plugins/bibles/lib/importers/http.py'
--- openlp/plugins/bibles/lib/importers/http.py 2018-10-22 20:17:55 +0000
+++ openlp/plugins/bibles/lib/importers/http.py 2018-10-27 04:14:21 +0000
@@ -749,7 +749,7 @@
return None
try:
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)
page_source = None
if not page_source:
=== modified file 'openlp/plugins/bibles/lib/manager.py'
--- openlp/plugins/bibles/lib/manager.py 2018-10-22 20:17:55 +0000
+++ openlp/plugins/bibles/lib/manager.py 2018-10-27 04:14:21 +0000
@@ -38,7 +38,7 @@
try:
from .importers.sword import SwordBible
-except:
+except ImportError:
pass
log = logging.getLogger(__name__)
=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py 2018-08-25 14:08:19 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py 2018-10-27 04:14:21 +0000
@@ -38,8 +38,9 @@
from openlp.core.widgets.edits import SearchEdit
from openlp.plugins.bibles.forms.bibleimportform import BibleImportForm
from openlp.plugins.bibles.forms.editbibleform import EditBibleForm
-from openlp.plugins.bibles.lib import DisplayStyle, LayoutStyle, VerseReferenceList, \
- get_reference_match, get_reference_separator
+from openlp.plugins.bibles.lib import DisplayStyle, LayoutStyle, get_reference_match, \
+ get_reference_separator
+from openlp.plugins.bibles.lib.versereferencelist import VerseReferenceList
log = logging.getLogger(__name__)
=== modified file 'openlp/plugins/custom/customplugin.py'
--- openlp/plugins/custom/customplugin.py 2018-08-25 14:08:19 +0000
+++ openlp/plugins/custom/customplugin.py 2018-10-27 04:14:21 +0000
@@ -33,9 +33,9 @@
from openlp.core.lib.plugin import Plugin, StringContent
from openlp.core.lib.db import Manager
from openlp.plugins.custom.endpoint import api_custom_endpoint, custom_endpoint
-from openlp.plugins.custom.lib import CustomMediaItem, CustomTab
from openlp.plugins.custom.lib.db import CustomSlide, init_schema
-from openlp.plugins.custom.lib.mediaitem import CustomSearch
+from openlp.plugins.custom.lib.mediaitem import CustomMediaItem, CustomSearch
+from openlp.plugins.custom.lib.customtab import CustomTab
log = logging.getLogger(__name__)
=== modified file 'openlp/plugins/custom/forms/editcustomform.py'
--- openlp/plugins/custom/forms/editcustomform.py 2017-12-29 09:15:48 +0000
+++ openlp/plugins/custom/forms/editcustomform.py 2018-10-27 04:14:21 +0000
@@ -27,10 +27,10 @@
from openlp.core.common.i18n import translate
from openlp.core.common.registry import Registry
from openlp.core.lib.ui import critical_error_message_box, find_and_set_in_combo_box
-from openlp.plugins.custom.lib import CustomXMLBuilder, CustomXMLParser
+from openlp.plugins.custom.forms.editcustomdialog import Ui_CustomEditDialog
+from openlp.plugins.custom.forms.editcustomslideform import EditCustomSlideForm
+from openlp.plugins.custom.lib.customxmlhandler import CustomXMLBuilder, CustomXMLParser
from openlp.plugins.custom.lib.db import CustomSlide
-from .editcustomdialog import Ui_CustomEditDialog
-from .editcustomslideform import EditCustomSlideForm
log = logging.getLogger(__name__)
=== modified file 'openlp/plugins/custom/lib/__init__.py'
--- openlp/plugins/custom/lib/__init__.py 2017-12-29 09:15:48 +0000
+++ openlp/plugins/custom/lib/__init__.py 2018-10-27 04:14:21 +0000
@@ -19,7 +19,3 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
-
-from .customtab import CustomTab
-from .customxmlhandler import CustomXMLBuilder, CustomXMLParser
-from .mediaitem import CustomMediaItem
=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
--- openlp/plugins/custom/lib/mediaitem.py 2018-08-25 14:08:19 +0000
+++ openlp/plugins/custom/lib/mediaitem.py 2018-10-27 04:14:21 +0000
@@ -35,7 +35,7 @@
from openlp.core.lib.ui import create_widget_action
from openlp.core.ui.icons import UiIcons
from openlp.plugins.custom.forms.editcustomform import EditCustomForm
-from openlp.plugins.custom.lib import CustomXMLParser, CustomXMLBuilder
+from openlp.plugins.custom.lib.customxmlhandler import CustomXMLBuilder, CustomXMLParser
from openlp.plugins.custom.lib.db import CustomSlide
log = logging.getLogger(__name__)
=== modified file 'openlp/plugins/images/forms/__init__.py'
--- openlp/plugins/images/forms/__init__.py 2017-12-29 09:15:48 +0000
+++ openlp/plugins/images/forms/__init__.py 2018-10-27 04:14:21 +0000
@@ -40,6 +40,3 @@
This allows OpenLP to use ``self.object`` for all the GUI elements while keeping them separate from the functionality,
so that it is easier to recreate the GUI from the .ui files later if necessary.
"""
-
-from .addgroupform import AddGroupForm
-from .choosegroupform import ChooseGroupForm
=== modified file 'openlp/plugins/images/imageplugin.py'
--- openlp/plugins/images/imageplugin.py 2018-08-26 07:28:43 +0000
+++ openlp/plugins/images/imageplugin.py 2018-10-27 04:14:21 +0000
@@ -32,7 +32,9 @@
from openlp.core.lib.plugin import Plugin, StringContent
from openlp.core.lib.db import Manager
from openlp.plugins.images.endpoint import api_images_endpoint, images_endpoint
-from openlp.plugins.images.lib import ImageMediaItem, ImageTab, upgrade
+from openlp.plugins.images.lib import upgrade
+from openlp.plugins.images.lib.mediaitem import ImageMediaItem
+from openlp.plugins.images.lib.imagetab import ImageTab
from openlp.plugins.images.lib.db import init_schema
log = logging.getLogger(__name__)
=== modified file 'openlp/plugins/images/lib/__init__.py'
--- openlp/plugins/images/lib/__init__.py 2017-12-29 09:15:48 +0000
+++ openlp/plugins/images/lib/__init__.py 2018-10-27 04:14:21 +0000
@@ -19,6 +19,3 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
-
-from .imagetab import ImageTab
-from .mediaitem import ImageMediaItem
=== modified file 'openlp/plugins/images/lib/mediaitem.py'
--- openlp/plugins/images/lib/mediaitem.py 2018-08-30 03:11:30 +0000
+++ openlp/plugins/images/lib/mediaitem.py 2018-10-27 04:14:21 +0000
@@ -38,7 +38,8 @@
from openlp.core.lib.ui import create_widget_action, critical_error_message_box
from openlp.core.ui.icons import UiIcons
from openlp.core.widgets.views import TreeWidgetWithDnD
-from openlp.plugins.images.forms import AddGroupForm, ChooseGroupForm
+from openlp.plugins.images.forms.addgroupform import AddGroupForm
+from openlp.plugins.images.forms.choosegroupform import ChooseGroupForm
from openlp.plugins.images.lib.db import ImageFilenames, ImageGroups
log = logging.getLogger(__name__)
=== modified file 'openlp/plugins/media/lib/__init__.py'
--- openlp/plugins/media/lib/__init__.py 2017-12-29 09:15:48 +0000
+++ openlp/plugins/media/lib/__init__.py 2018-10-27 04:14:21 +0000
@@ -19,8 +19,3 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
-
-from .mediaitem import MediaMediaItem
-from .mediatab import MediaTab
-
-__all__ = ['MediaMediaItem']
=== modified file 'openlp/plugins/media/mediaplugin.py'
--- openlp/plugins/media/mediaplugin.py 2018-10-16 20:58:39 +0000
+++ openlp/plugins/media/mediaplugin.py 2018-10-27 04:14:21 +0000
@@ -36,7 +36,8 @@
from openlp.core.lib import build_icon
from openlp.core.lib.plugin import Plugin, StringContent
from openlp.plugins.media.endpoint import api_media_endpoint, media_endpoint
-from openlp.plugins.media.lib import MediaMediaItem, MediaTab
+from openlp.plugins.media.lib.mediaitem import MediaMediaItem
+from openlp.plugins.media.lib.mediatab import MediaTab
log = logging.getLogger(__name__)
=== modified file 'openlp/plugins/presentations/lib/__init__.py'
--- openlp/plugins/presentations/lib/__init__.py 2017-12-29 09:15:48 +0000
+++ openlp/plugins/presentations/lib/__init__.py 2018-10-27 04:14:21 +0000
@@ -19,8 +19,3 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
-
-from .presentationcontroller import PresentationController
-from .messagelistener import MessageListener
-from .mediaitem import PresentationMediaItem
-from .presentationtab import PresentationTab
=== modified file 'openlp/plugins/presentations/lib/impresscontroller.py'
--- openlp/plugins/presentations/lib/impresscontroller.py 2017-12-29 09:15:48 +0000
+++ openlp/plugins/presentations/lib/impresscontroller.py 2018-10-27 04:14:21 +0000
@@ -121,7 +121,7 @@
while uno_instance is None and loop < 3:
try:
uno_instance = get_uno_instance(resolver)
- except:
+ except Exception:
log.warning('Unable to find running instance ')
self.start_process()
loop += 1
@@ -130,7 +130,7 @@
log.debug('get UNO Desktop Openoffice - createInstanceWithContext - Desktop')
desktop = self.manager.createInstanceWithContext("com.sun.star.frame.Desktop", uno_instance)
return desktop
- except:
+ except Exception:
log.warning('Failed to get UNO desktop')
return None
@@ -172,7 +172,7 @@
desktop = self.get_uno_desktop()
else:
desktop = self.get_com_desktop()
- except:
+ except Exception:
log.warning('Failed to find an OpenOffice desktop to terminate')
if not desktop:
return
@@ -190,7 +190,7 @@
try:
desktop.terminate()
log.debug('OpenOffice killed')
- except:
+ except Exception:
log.warning('Failed to terminate OpenOffice')
@@ -235,7 +235,7 @@
properties = tuple(properties)
try:
self.document = desktop.loadComponentFromURL(url, '_blank', 0, properties)
- except:
+ except Exception:
log.warning('Failed to load presentation {url}'.format(url=url))
return False
self.presentation = self.document.getPresentation()
@@ -274,7 +274,7 @@
delete_file(path)
except ErrorCodeIOException as exception:
log.exception('ERROR! ErrorCodeIOException {error:d}'.format(error=exception.ErrCode))
- except:
+ except Exception:
log.exception('{path} - Unable to store openoffice preview'.format(path=path))
def create_property(self, name, value):
@@ -302,7 +302,7 @@
self.presentation.end()
self.presentation = None
self.document.dispose()
- except:
+ except Exception:
log.warning("Closing presentation failed")
self.document = None
self.controller.remove_doc(self)
@@ -319,7 +319,7 @@
if self.document.getPresentation() is None:
log.debug("getPresentation failed to find a presentation")
return False
- except:
+ except Exception:
log.warning("getPresentation failed to find a presentation")
return False
return True
=== modified file 'openlp/plugins/presentations/lib/mediaitem.py'
--- openlp/plugins/presentations/lib/mediaitem.py 2018-08-25 14:08:19 +0000
+++ openlp/plugins/presentations/lib/mediaitem.py 2018-10-27 04:14:21 +0000
@@ -21,7 +21,7 @@
###############################################################################
import logging
-from PyQt5 import QtCore, QtGui, QtWidgets
+from PyQt5 import QtCore, QtWidgets
from openlp.core.common.i18n import UiStrings, translate, get_natural_key
from openlp.core.common.path import path_to_str, str_to_path
@@ -33,7 +33,7 @@
from openlp.core.lib.serviceitem import ItemCapabilities
from openlp.core.lib.ui import critical_error_message_box, create_horizontal_adjusting_combo_box
from openlp.core.ui.icons import UiIcons
-from openlp.plugins.presentations.lib import MessageListener
+from openlp.plugins.presentations.lib.messagelistener import MessageListener
from openlp.plugins.presentations.lib.pdfcontroller import PDF_CONTROLLER_FILETYPES
log = logging.getLogger(__name__)
=== modified file 'openlp/plugins/presentations/lib/pdfcontroller.py'
--- openlp/plugins/presentations/lib/pdfcontroller.py 2017-12-29 09:15:48 +0000
+++ openlp/plugins/presentations/lib/pdfcontroller.py 2018-10-27 04:14:21 +0000
@@ -279,7 +279,7 @@
for image_path in created_files:
if image_path.is_file():
self.image_files.append(image_path)
- except Exception as e:
+ except Exception:
log.exception(runlog)
return False
self.num_pages = len(self.image_files)
=== modified file 'openlp/plugins/presentations/lib/presentationcontroller.py'
--- openlp/plugins/presentations/lib/presentationcontroller.py 2017-12-29 09:15:48 +0000
+++ openlp/plugins/presentations/lib/presentationcontroller.py 2018-10-27 04:14:21 +0000
@@ -326,14 +326,14 @@
titles_path = self.get_thumbnail_folder() / 'titles.txt'
try:
titles = titles_path.read_text().splitlines()
- except:
+ except Exception:
log.exception('Failed to open/read existing titles file')
titles = []
for slide_no, title in enumerate(titles, 1):
notes_path = self.get_thumbnail_folder() / 'slideNotes{number:d}.txt'.format(number=slide_no)
try:
note = notes_path.read_text()
- except:
+ except Exception:
log.exception('Failed to open/read notes file')
note = ''
notes.append(note)
=== modified file 'openlp/plugins/presentations/presentationplugin.py'
--- openlp/plugins/presentations/presentationplugin.py 2018-08-25 14:08:19 +0000
+++ openlp/plugins/presentations/presentationplugin.py 2018-10-27 04:14:21 +0000
@@ -36,7 +36,9 @@
from openlp.core.lib import build_icon
from openlp.core.lib.plugin import Plugin, StringContent
from openlp.plugins.presentations.endpoint import api_presentations_endpoint, presentations_endpoint
-from openlp.plugins.presentations.lib import PresentationController, PresentationMediaItem, PresentationTab
+from openlp.plugins.presentations.lib.presentationcontroller import PresentationController
+from openlp.plugins.presentations.lib.mediaitem import PresentationMediaItem
+from openlp.plugins.presentations.lib.presentationtab import PresentationTab
log = logging.getLogger(__name__)
=== modified file 'openlp/plugins/songs/forms/__init__.py'
--- openlp/plugins/songs/forms/__init__.py 2017-12-29 09:15:48 +0000
+++ openlp/plugins/songs/forms/__init__.py 2018-10-27 04:14:21 +0000
@@ -45,4 +45,3 @@
them separate from the functionality, so that it is easier to recreate the GUI
from the .ui files later if necessary.
"""
-from .editsongform import EditSongForm
=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py 2018-08-25 14:08:19 +0000
+++ openlp/plugins/songs/forms/editsongform.py 2018-10-27 04:14:21 +0000
@@ -319,7 +319,7 @@
for verse in multiple:
self.song.verse_order = re.sub(r'([' + verse.upper() + verse.lower() + r'])(\W|$)',
r'\g<1>1\2', self.song.verse_order)
- except:
+ except Exception:
log.exception('Problem processing song Lyrics \n{xml}'.format(xml=sxml.dump_xml()))
raise
@@ -1087,7 +1087,7 @@
if audio_path not in file_paths:
try:
audio_path.unlink()
- except:
+ except Exception:
log.exception('Could not remove file: {audio}'.format(audio=audio_path))
if not file_paths:
try:
=== modified file 'openlp/plugins/songs/lib/__init__.py'
--- openlp/plugins/songs/lib/__init__.py 2018-07-02 20:38:47 +0000
+++ openlp/plugins/songs/lib/__init__.py 2018-10-27 04:14:21 +0000
@@ -33,7 +33,7 @@
from openlp.core.common.i18n import translate
from openlp.core.common.settings import Settings
from openlp.core.lib import clean_tags
-from openlp.plugins.songs.lib.db import Author, MediaFile, Song, Topic
+from openlp.plugins.songs.lib.db import Author, MediaFile, Song
from openlp.plugins.songs.lib.ui import SongStrings
log = logging.getLogger(__name__)
=== modified file 'openlp/plugins/songs/lib/importers/cclifile.py'
--- openlp/plugins/songs/lib/importers/cclifile.py 2017-12-29 09:15:48 +0000
+++ openlp/plugins/songs/lib/importers/cclifile.py 2018-10-27 04:14:21 +0000
@@ -289,10 +289,8 @@
# verse type, so set flag
verse_type = VerseType.tags[VerseType.Other]
check_first_verse_line = True
- verse_number = verse_desc_parts[1]
else:
verse_type = VerseType.tags[VerseType.Other]
- verse_number = 1
verse_start = True
else:
# check first line for verse type
=== modified file 'openlp/plugins/songs/lib/importers/easyslides.py'
--- openlp/plugins/songs/lib/importers/easyslides.py 2018-07-02 20:38:47 +0000
+++ openlp/plugins/songs/lib/importers/easyslides.py 2018-10-27 04:14:21 +0000
@@ -107,7 +107,7 @@
def _add_authors(self, writer):
try:
self.parse_author(str(writer))
- except UnicodeDecodeError as e:
+ except UnicodeDecodeError:
log.exception('Unicode decode error while decoding Writer')
self._success = False
=== modified file 'openlp/plugins/songs/lib/importers/openoffice.py'
--- openlp/plugins/songs/lib/importers/openoffice.py 2017-12-29 09:15:48 +0000
+++ openlp/plugins/songs/lib/importers/openoffice.py 2018-10-27 04:14:21 +0000
@@ -134,7 +134,7 @@
process = QtCore.QProcess()
process.startDetached(cmd)
self.process_started = True
- except:
+ except Exception:
log.exception("start_ooo_process failed")
def open_ooo_file(self, file_path):
@@ -176,7 +176,7 @@
"""
try:
self.document.close(True)
- except:
+ except Exception:
log.exception('Exception in close_ooo_file - trying to ignore it.')
self.document = None
@@ -187,7 +187,7 @@
if self.process_started:
try:
self.desktop.terminate()
- except:
+ except Exception:
log.exception('Exception in close_ooo - trying to ignore it.')
def process_presentation(self):
=== modified file 'openlp/plugins/songs/lib/importers/songshowplus.py'
--- openlp/plugins/songs/lib/importers/songshowplus.py 2017-12-29 09:15:48 +0000
+++ openlp/plugins/songs/lib/importers/songshowplus.py 2018-10-27 04:14:21 +0000
@@ -223,5 +223,5 @@
try:
# Don't question this, it works...
return data.decode('utf-8').encode('cp1251').decode('cp1251')
- except:
+ except Exception:
return data.decode(retrieve_windows_encoding())
=== modified file 'openlp/plugins/songs/lib/importers/sundayplus.py'
--- openlp/plugins/songs/lib/importers/sundayplus.py 2017-12-29 09:15:48 +0000
+++ openlp/plugins/songs/lib/importers/sundayplus.py 2018-10-27 04:14:21 +0000
@@ -194,7 +194,7 @@
while True:
try:
return blob.decode(self.encoding)
- except Exception as e:
+ except Exception:
self.encoding = retrieve_windows_encoding()
def unescape(self, text):
=== modified file 'openlp/plugins/songs/lib/songselect.py'
--- openlp/plugins/songs/lib/songselect.py 2017-12-29 09:15:48 +0000
+++ openlp/plugins/songs/lib/songselect.py 2018-10-27 04:14:21 +0000
@@ -33,7 +33,8 @@
from bs4 import BeautifulSoup, NavigableString
-from openlp.plugins.songs.lib import Song, Author, Topic, VerseType, clean_song
+from openlp.plugins.songs.lib import VerseType, clean_song
+from openlp.plugins.songs.lib.db import Song, Author, Topic
from openlp.plugins.songs.lib.openlyricsxml import SongXML
USER_AGENTS = [
=== modified file 'openlp/plugins/songusage/forms/__init__.py'
--- openlp/plugins/songusage/forms/__init__.py 2017-12-29 09:15:48 +0000
+++ openlp/plugins/songusage/forms/__init__.py 2018-10-27 04:14:21 +0000
@@ -19,6 +19,3 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
-
-from .songusagedeleteform import SongUsageDeleteForm
-from .songusagedetailform import SongUsageDetailForm
=== modified file 'openlp/plugins/songusage/songusageplugin.py'
--- openlp/plugins/songusage/songusageplugin.py 2018-08-25 14:08:19 +0000
+++ openlp/plugins/songusage/songusageplugin.py 2018-10-27 04:14:21 +0000
@@ -33,7 +33,8 @@
from openlp.core.lib.db import Manager
from openlp.core.lib.ui import create_action
from openlp.core.ui.icons import UiIcons
-from openlp.plugins.songusage.forms import SongUsageDetailForm, SongUsageDeleteForm
+from openlp.plugins.songusage.forms.songusagedetailform import SongUsageDetailForm
+from openlp.plugins.songusage.forms.songusagedeleteform import SongUsageDeleteForm
from openlp.plugins.songusage.lib import upgrade
from openlp.plugins.songusage.lib.db import init_schema, SongUsageItem
=== modified file 'run_openlp.py'
--- run_openlp.py 2018-10-16 20:07:00 +0000
+++ run_openlp.py 2018-10-27 04:14:21 +0000
@@ -46,7 +46,6 @@
"""
Instantiate and run the application.
"""
- faulthandler.enable()
set_up_fault_handling()
# Add support for using multiprocessing from frozen Windows executable (built using PyInstaller),
# see https://docs.python.org/3/library/multiprocessing.html#multiprocessing.freeze_support
=== modified file 'scripts/translation_utils.py'
--- scripts/translation_utils.py 2017-12-29 09:15:48 +0000
+++ scripts/translation_utils.py 2018-10-27 04:14:21 +0000
@@ -58,7 +58,7 @@
import webbrowser
from PyQt5 import QtCore
-from lxml import etree, objectify
+from lxml import objectify
SERVER_URL = 'http://www.transifex.com/api/2/project/openlp/resource/openlp-26x/'
IGNORED_PATHS = ['scripts']
=== modified file 'setup.cfg'
--- setup.cfg 2018-07-02 20:38:47 +0000
+++ setup.cfg 2018-10-27 04:14:21 +0000
@@ -10,15 +10,13 @@
[flake8]
exclude=resources.py,vlc.py
max-line-length = 120
-ignore = E402
+ignore = E402,W503,W504,D
[pycodestyle]
exclude = resources.py,vlc.py
max-line-length = 120
# Ignoring:
# E402...
-# E722 do not use bare 'except'
# W503 line break before binary operator
# W504 line break after binary operator
-ignore = E402,E722,W503,W504
-
+ignore = E402,W503,W504
=== modified file 'tests/functional/openlp_core/api/http/test_wsgiapp.py'
--- tests/functional/openlp_core/api/http/test_wsgiapp.py 2017-12-29 09:15:48 +0000
+++ tests/functional/openlp_core/api/http/test_wsgiapp.py 2018-10-27 04:14:21 +0000
@@ -26,8 +26,9 @@
from unittest import TestCase
from unittest.mock import MagicMock
-from openlp.core.api.http import register_endpoint, application, NotFound
+from openlp.core.api.http import register_endpoint, application
from openlp.core.api.http.endpoint import Endpoint
+from openlp.core.api.http.errors import NotFound
ROOT_DIR = os.path.dirname(os.path.realpath(__file__))
=== modified file 'tests/functional/openlp_core/api/test_tab.py'
--- tests/functional/openlp_core/api/test_tab.py 2018-08-04 20:58:13 +0000
+++ tests/functional/openlp_core/api/test_tab.py 2018-10-27 04:14:21 +0000
@@ -24,7 +24,6 @@
"""
import re
from unittest import TestCase
-from unittest.mock import patch
from PyQt5 import QtWidgets
=== modified file 'tests/functional/openlp_core/common/test_db.py'
--- tests/functional/openlp_core/common/test_db.py 2017-12-29 09:15:48 +0000
+++ tests/functional/openlp_core/common/test_db.py 2018-10-27 04:14:21 +0000
@@ -63,7 +63,7 @@
if os.path.exists(self.tmp_folder):
shutil.rmtree(self.tmp_folder)
break
- except:
+ except Exception:
time.sleep(1)
retries += 1
=== modified file 'tests/functional/openlp_core/common/test_path.py'
--- tests/functional/openlp_core/common/test_path.py 2018-08-12 11:12:03 +0000
+++ tests/functional/openlp_core/common/test_path.py 2018-10-27 04:14:21 +0000
@@ -397,7 +397,7 @@
try:
create_paths(mocked_path)
assert False, 'create_paths should have thrown an exception'
- except:
+ except Exception:
# THEN: `create_paths` raises an exception
pass
=== modified file 'tests/functional/openlp_core/lib/test_lib.py'
--- tests/functional/openlp_core/lib/test_lib.py 2018-08-25 14:08:19 +0000
+++ tests/functional/openlp_core/lib/test_lib.py 2018-10-27 04:14:21 +0000
@@ -280,7 +280,7 @@
# last test.
try:
thumb_path.unlink()
- except:
+ except Exception:
pass
# Only continue when the thumb does not exist.
@@ -298,7 +298,7 @@
# Remove the thumb so that the test actually tests if the thumb will be created.
try:
thumb_path.unlink()
- except:
+ except Exception:
pass
def test_create_thumb_no_size(self):
@@ -314,7 +314,7 @@
# last test.
try:
thumb_path.unlink()
- except:
+ except Exception:
pass
# Only continue when the thumb does not exist.
@@ -332,7 +332,7 @@
# Remove the thumb so that the test actually tests if the thumb will be created.
try:
thumb_path.unlink()
- except:
+ except Exception:
pass
def test_create_thumb_invalid_size(self):
@@ -349,7 +349,7 @@
# last test.
try:
thumb_path.unlink()
- except:
+ except Exception:
pass
# Only continue when the thumb does not exist.
@@ -367,7 +367,7 @@
# Remove the thumb so that the test actually tests if the thumb will be created.
try:
thumb_path.unlink()
- except:
+ except Exception:
pass
def test_create_thumb_width_only(self):
@@ -384,7 +384,7 @@
# last test.
try:
thumb_path.unlink()
- except:
+ except Exception:
pass
# Only continue when the thumb does not exist.
@@ -402,7 +402,7 @@
# Remove the thumb so that the test actually tests if the thumb will be created.
try:
thumb_path.unlink()
- except:
+ except Exception:
pass
def test_create_thumb_height_only(self):
@@ -419,7 +419,7 @@
# last test.
try:
thumb_path.unlink()
- except:
+ except Exception:
pass
# Only continue when the thumb does not exist.
@@ -437,7 +437,7 @@
# Remove the thumb so that the test actually tests if the thumb will be created.
try:
thumb_path.unlink()
- except:
+ except Exception:
pass
def test_create_thumb_empty_img(self):
@@ -455,7 +455,7 @@
# last test.
try:
thumb_path.unlink()
- except:
+ except Exception:
pass
# Only continue when the thumb does not exist.
@@ -485,7 +485,7 @@
# Remove the thumb so that the test actually tests if the thumb will be created.
try:
thumb_path.unlink()
- except:
+ except Exception:
pass
def test_check_item_selected_true(self):
=== modified file 'tests/functional/openlp_core/ui/media/test_vlcplayer.py'
--- tests/functional/openlp_core/ui/media/test_vlcplayer.py 2017-12-29 09:15:48 +0000
+++ tests/functional/openlp_core/ui/media/test_vlcplayer.py 2018-10-27 04:14:21 +0000
@@ -412,7 +412,7 @@
# WHEN: An audio CD is loaded into VLC
with patch.object(vlc_player, 'volume') as mocked_volume, \
- patch.object(vlc_player, 'media_state_wait') as mocked_media_state_wait:
+ patch.object(vlc_player, 'media_state_wait'):
result = vlc_player.load(mocked_display)
# THEN: The video should be loaded
@@ -457,7 +457,7 @@
# WHEN: An audio CD is loaded into VLC
with patch.object(vlc_player, 'volume') as mocked_volume, \
- patch.object(vlc_player, 'media_state_wait') as mocked_media_state_wait:
+ patch.object(vlc_player, 'media_state_wait'):
result = vlc_player.load(mocked_display)
# THEN: The video should be loaded
@@ -501,8 +501,7 @@
vlc_player = VlcPlayer(None)
# WHEN: An audio CD is loaded into VLC
- with patch.object(vlc_player, 'volume') as mocked_volume, \
- patch.object(vlc_player, 'media_state_wait') as mocked_media_state_wait:
+ with patch.object(vlc_player, 'volume'), patch.object(vlc_player, 'media_state_wait'):
result = vlc_player.load(mocked_display)
# THEN: The video should be loaded
@@ -657,7 +656,7 @@
# WHEN: play() is called
with patch.object(vlc_player, 'media_state_wait') as mocked_media_state_wait, \
- patch.object(vlc_player, 'volume') as mocked_volume:
+ patch.object(vlc_player, 'volume'):
mocked_media_state_wait.return_value = False
result = vlc_player.play(mocked_display)
@@ -690,7 +689,7 @@
vlc_player.set_state(MediaState.Paused, mocked_display)
# WHEN: play() is called
- with patch.object(vlc_player, 'media_state_wait', return_value=True) as mocked_media_state_wait, \
+ with patch.object(vlc_player, 'media_state_wait', return_value=True), \
patch.object(vlc_player, 'volume') as mocked_volume, \
patch.object(vlc_player, 'get_live_state', return_value=MediaState.Loaded):
result = vlc_player.play(mocked_display)
=== modified file 'tests/functional/openlp_core/ui/test_icons.py'
--- tests/functional/openlp_core/ui/test_icons.py 2018-07-15 19:54:41 +0000
+++ tests/functional/openlp_core/ui/test_icons.py 2018-10-27 04:14:21 +0000
@@ -22,8 +22,8 @@
"""
Package to test the openlp.core.ui.icons package.
"""
-from unittest import TestCase, skipUnless
-from unittest.mock import MagicMock, patch
+from unittest import TestCase
+from unittest.mock import patch
from PyQt5 import QtGui
=== modified file 'tests/functional/openlp_core/ui/test_maindisplay.py'
--- tests/functional/openlp_core/ui/test_maindisplay.py 2018-08-25 14:36:46 +0000
+++ tests/functional/openlp_core/ui/test_maindisplay.py 2018-10-27 04:14:21 +0000
@@ -172,7 +172,7 @@
main_display = MainDisplay(display)
try:
nsview_pointer = main_display.winId().ascapsule()
- except:
+ except Exception:
nsview_pointer = voidptr(main_display.winId()).ascapsule()
pythonapi.PyCapsule_SetName.restype = c_void_p
pythonapi.PyCapsule_SetName.argtypes = [py_object, c_char_p]
=== modified file 'tests/functional/openlp_core/ui/test_servicemanager.py'
--- tests/functional/openlp_core/ui/test_servicemanager.py 2018-08-25 14:36:46 +0000
+++ tests/functional/openlp_core/ui/test_servicemanager.py 2018-10-27 04:14:21 +0000
@@ -22,7 +22,6 @@
"""
Package to test the openlp.core.ui.slidecontroller package.
"""
-import os
from unittest import TestCase
from unittest.mock import MagicMock, patch
=== modified file 'tests/functional/openlp_plugins/bibles/test_csvimport.py'
--- tests/functional/openlp_plugins/bibles/test_csvimport.py 2017-12-29 09:15:48 +0000
+++ tests/functional/openlp_plugins/bibles/test_csvimport.py 2018-10-27 04:14:21 +0000
@@ -25,7 +25,7 @@
import csv
from collections import namedtuple
from unittest import TestCase
-from unittest.mock import ANY, MagicMock, PropertyMock, call, patch
+from unittest.mock import MagicMock, PropertyMock, call, patch
from openlp.core.common.path import Path
from openlp.core.lib.exceptions import ValidationError
@@ -131,35 +131,40 @@
# GIVEN: A mocked csv.reader which returns an iterator with test data
test_data = [['1', 'Line 1', 'Data 1'], ['2', 'Line 2', 'Data 2'], ['3', 'Line 3', 'Data 3']]
TestTuple = namedtuple('TestTuple', 'line_no line_description line_data')
+ mocked_csv_file = MagicMock()
+ mocked_enter_file = MagicMock()
+ mocked_csv_file.open.return_value.__enter__.return_value = mocked_enter_file
with patch('openlp.plugins.bibles.lib.importers.csvbible.get_file_encoding',
- return_value={'encoding': 'utf-8', 'confidence': 0.99}),\
- patch('openlp.plugins.bibles.lib.importers.csvbible.Path.open', create=True) as mocked_open,\
+ return_value={'encoding': 'utf-8', 'confidence': 0.99}), \
patch('openlp.plugins.bibles.lib.importers.csvbible.csv.reader',
return_value=iter(test_data)) as mocked_reader:
# WHEN: Calling the CSVBible parse_csv_file method with a file name and TestTuple
- result = CSVBible.parse_csv_file(Path('file.csv'), TestTuple)
+ result = CSVBible.parse_csv_file(mocked_csv_file, TestTuple)
# THEN: A list of TestTuple instances with the parsed data should be returned
assert result == [TestTuple('1', 'Line 1', 'Data 1'), TestTuple('2', 'Line 2', 'Data 2'),
TestTuple('3', 'Line 3', 'Data 3')]
- mocked_open.assert_called_once_with('r', encoding='utf-8', newline='')
- mocked_reader.assert_called_once_with(ANY, delimiter=',', quotechar='"')
+ mocked_csv_file.open.assert_called_once_with('r', encoding='utf-8', newline='')
+ mocked_reader.assert_called_once_with(mocked_enter_file, delimiter=',', quotechar='"')
def test_parse_csv_file_oserror(self):
"""
Test the parse_csv_file() handles an OSError correctly
"""
# GIVEN: Mocked a mocked open object which raises an OSError
+ mocked_csv_file = MagicMock()
+ mocked_csv_file.__str__.return_value = 'file.csv'
+ mocked_csv_file.open.side_effect = OSError()
+
with patch('openlp.plugins.bibles.lib.importers.csvbible.get_file_encoding',
- return_value={'encoding': 'utf-8', 'confidence': 0.99}),\
- patch('openlp.plugins.bibles.lib.importers.csvbible.Path.open', side_effect=OSError, create=True):
+ return_value={'encoding': 'utf-8', 'confidence': 0.99}):
# WHEN: Calling CSVBible.parse_csv_file
# THEN: A ValidationError should be raised
with self.assertRaises(ValidationError) as context:
- CSVBible.parse_csv_file(Path('file.csv'), None)
+ CSVBible.parse_csv_file(mocked_csv_file, None)
assert context.exception.msg == 'Parsing "file.csv" failed'
def test_parse_csv_file_csverror(self):
@@ -167,15 +172,17 @@
Test the parse_csv_file() handles an csv.Error correctly
"""
# GIVEN: Mocked a csv.reader which raises an csv.Error
+ mocked_csv_file = MagicMock()
+ mocked_csv_file.__str__.return_value = 'file.csv'
+
with patch('openlp.plugins.bibles.lib.importers.csvbible.get_file_encoding',
return_value={'encoding': 'utf-8', 'confidence': 0.99}),\
- patch('openlp.plugins.bibles.lib.importers.csvbible.Path.open', create=True),\
patch('openlp.plugins.bibles.lib.importers.csvbible.csv.reader', side_effect=csv.Error):
# WHEN: Calling CSVBible.parse_csv_file
# THEN: A ValidationError should be raised
with self.assertRaises(ValidationError) as context:
- CSVBible.parse_csv_file(Path('file.csv'), None)
+ CSVBible.parse_csv_file(mocked_csv_file, None)
assert context.exception.msg == 'Parsing "file.csv" failed'
def test_process_books_stopped_import(self):
=== modified file 'tests/functional/openlp_plugins/bibles/test_lib.py'
--- tests/functional/openlp_plugins/bibles/test_lib.py 2017-12-29 09:15:48 +0000
+++ tests/functional/openlp_plugins/bibles/test_lib.py 2018-10-27 04:14:21 +0000
@@ -55,7 +55,7 @@
# WHEN: Calling get_reference_separator
for key, value in separators.items():
- _ = lib.get_reference_separator(key)
+ lib.get_reference_separator(key)
# THEN: get_reference_separator should return the correct separator
assert separators[key] == value
=== modified file 'tests/functional/openlp_plugins/bibles/test_mediaitem.py'
--- tests/functional/openlp_plugins/bibles/test_mediaitem.py 2018-08-25 14:08:19 +0000
+++ tests/functional/openlp_plugins/bibles/test_mediaitem.py 2018-10-27 04:14:21 +0000
@@ -756,7 +756,7 @@
# GIVEN: An instance of :class:`MediaManagerItem` and mocked media_item.settings and select_book_combo_box
self.media_item.version_combo_box = MagicMock(**{'currentData.return_value': None})
self.media_item.select_book_combo_box = MagicMock()
- with patch.object(self.media_item, 'initialise_advanced_bible') as mocked_initialise_advanced_bible:
+ with patch.object(self.media_item, 'initialise_advanced_bible'):
# WHEN: Calling on_version_combo_box_index_changed
self.media_item.on_version_combo_box_index_changed()
@@ -774,7 +774,7 @@
mocked_bible_db.name = 'ABC'
self.media_item.version_combo_box = MagicMock(**{'currentData.return_value': mocked_bible_db})
self.media_item.select_book_combo_box = MagicMock()
- with patch.object(self.media_item, 'initialise_advanced_bible') as mocked_initialise_advanced_bible:
+ with patch.object(self.media_item, 'initialise_advanced_bible'):
# WHEN: Calling on_version_combo_box_index_changed
self.media_item.on_version_combo_box_index_changed()
@@ -792,7 +792,7 @@
self.media_item.list_view = MagicMock(**{'count.return_value': 5})
self.media_item.style_combo_box = MagicMock()
self.media_item.select_book_combo_box = MagicMock()
- with patch.object(self.media_item, 'initialise_advanced_bible') as mocked_initialise_advanced_bible, \
+ with patch.object(self.media_item, 'initialise_advanced_bible'), \
patch('openlp.plugins.bibles.lib.mediaitem.critical_error_message_box') \
as mocked_critical_error_message_box:
@@ -815,7 +815,7 @@
self.media_item.list_view = MagicMock(**{'count.return_value': 5})
self.media_item.style_combo_box = MagicMock()
self.media_item.select_book_combo_box = MagicMock()
- with patch.object(self.media_item, 'initialise_advanced_bible') as mocked_initialise_advanced_bible, \
+ with patch.object(self.media_item, 'initialise_advanced_bible'), \
patch('openlp.plugins.bibles.lib.mediaitem.critical_error_message_box',
return_value=QtWidgets.QMessageBox.No) as mocked_critical_error_message_box:
=== modified file 'tests/functional/openlp_plugins/bibles/test_upgrade.py'
--- tests/functional/openlp_plugins/bibles/test_upgrade.py 2018-10-22 20:42:25 +0000
+++ tests/functional/openlp_plugins/bibles/test_upgrade.py 2018-10-27 04:14:21 +0000
@@ -22,14 +22,12 @@
"""
This module contains tests for the upgrade submodule of the Bibles plugin.
"""
-import os
import shutil
from pathlib import Path
from tempfile import mkdtemp
from unittest import TestCase
from unittest.mock import MagicMock, call, patch
-from PyQt5 import QtWidgets
from sqlalchemy import create_engine
from openlp.core.common.settings import ProxyMode
=== modified file 'tests/functional/openlp_plugins/custom/test_mediaitem.py'
--- tests/functional/openlp_plugins/custom/test_mediaitem.py 2018-08-25 14:08:19 +0000
+++ tests/functional/openlp_plugins/custom/test_mediaitem.py 2018-10-27 04:14:21 +0000
@@ -30,7 +30,7 @@
from openlp.core.common.registry import Registry
from openlp.core.lib.plugin import PluginStatus
from openlp.core.lib.serviceitem import ServiceItem
-from openlp.plugins.custom.lib import CustomMediaItem
+from openlp.plugins.custom.lib.mediaitem import CustomMediaItem
from tests.helpers.testmixin import TestMixin
FOOTER = ['Arky Arky (Unknown)', 'Public Domain', 'CCLI 123456']
=== modified file 'tests/functional/openlp_plugins/images/test_imagetab.py'
--- tests/functional/openlp_plugins/images/test_imagetab.py 2017-12-29 09:15:48 +0000
+++ tests/functional/openlp_plugins/images/test_imagetab.py 2018-10-27 04:14:21 +0000
@@ -29,7 +29,7 @@
from openlp.core.common.registry import Registry
from openlp.core.common.settings import Settings
-from openlp.plugins.images.lib import ImageTab
+from openlp.plugins.images.lib.imagetab import ImageTab
from tests.helpers.testmixin import TestMixin
__default_settings__ = {
=== modified file 'tests/functional/openlp_plugins/presentations/test_impresscontroller.py'
--- tests/functional/openlp_plugins/presentations/test_impresscontroller.py 2017-12-29 10:19:33 +0000
+++ tests/functional/openlp_plugins/presentations/test_impresscontroller.py 2018-10-27 04:14:21 +0000
@@ -27,7 +27,6 @@
from unittest import TestCase
from unittest.mock import MagicMock, patch
-from openlp.core.common.path import Path
from openlp.core.common.settings import Settings
from openlp.plugins.presentations.lib.impresscontroller import ImpressController, ImpressDocument, TextType
from openlp.plugins.presentations.presentationplugin import __default_settings__
=== modified file 'tests/functional/openlp_plugins/songs/test_lib.py'
--- tests/functional/openlp_plugins/songs/test_lib.py 2017-12-29 09:15:48 +0000
+++ tests/functional/openlp_plugins/songs/test_lib.py 2018-10-27 04:14:21 +0000
@@ -313,7 +313,7 @@
# WHEN: Transposing it 1 down
# THEN: An exception should be raised
with self.assertRaises(ValueError) as err:
- new_chord = transpose_chord(chord, -1, 'english')
+ transpose_chord(chord, -1, 'english')
assert err.exception.args[0] == '\'T\' is not in list', \
'ValueError exception should have been thrown for invalid chord'
=== modified file 'tests/functional/openlp_plugins/songs/test_mediashout.py'
--- tests/functional/openlp_plugins/songs/test_mediashout.py 2017-12-29 09:15:48 +0000
+++ tests/functional/openlp_plugins/songs/test_mediashout.py 2018-10-27 04:14:21 +0000
@@ -99,7 +99,7 @@
mocked_pyodbc.connect.return_value = mocked_connection
# WHEN: do_import is called
- with patch.object(importer, 'import_wizard') as mocked_import_wizard, \
+ with patch.object(importer, 'import_wizard'), \
patch.object(importer, 'process_song') as mocked_process_song:
importer.do_import()
@@ -133,7 +133,7 @@
mocked_pyodbc.connect.return_value = mocked_connection
# WHEN: do_import is called, but cancelled
- with patch.object(importer, 'import_wizard') as mocked_import_wizard, \
+ with patch.object(importer, 'import_wizard'), \
patch.object(importer, 'process_song') as mocked_process_song:
importer.stop_import_flag = True
importer.do_import()
=== modified file 'tests/interfaces/openlp_core/common/test_utils.py'
--- tests/interfaces/openlp_core/common/test_utils.py 2017-12-29 10:19:33 +0000
+++ tests/interfaces/openlp_core/common/test_utils.py 2018-10-27 04:14:21 +0000
@@ -25,7 +25,6 @@
from unittest import TestCase
from openlp.core.common import is_not_image_file
-from openlp.core.common.path import Path
from tests.utils.constants import RESOURCE_PATH
from tests.helpers.testmixin import TestMixin
=== modified file 'tests/interfaces/openlp_plugins/bibles/forms/test_bibleimportform.py'
--- tests/interfaces/openlp_plugins/bibles/forms/test_bibleimportform.py 2017-12-29 09:15:48 +0000
+++ tests/interfaces/openlp_plugins/bibles/forms/test_bibleimportform.py 2018-10-27 04:14:21 +0000
@@ -46,7 +46,6 @@
self.setup_application()
self.main_window = QtWidgets.QMainWindow()
Registry().register('main_window', self.main_window)
- PYSWORD_AVAILABLE = False
self.mocked_manager = MagicMock()
self.form = BibleImportForm(self.main_window, self.mocked_manager, MagicMock())
=== modified file 'tests/interfaces/openlp_plugins/bibles/test_lib_manager.py'
--- tests/interfaces/openlp_plugins/bibles/test_lib_manager.py 2017-12-29 09:15:48 +0000
+++ tests/interfaces/openlp_plugins/bibles/test_lib_manager.py 2018-10-27 04:14:21 +0000
@@ -27,7 +27,8 @@
from openlp.core.common.registry import Registry
from openlp.core.common.settings import Settings
-from openlp.plugins.bibles.lib import BibleManager, LanguageSelection
+from openlp.plugins.bibles.lib import LanguageSelection
+from openlp.plugins.bibles.lib.manager import BibleManager
from tests.helpers.testmixin import TestMixin
from tests.utils.constants import TEST_RESOURCES_PATH
=== modified file 'tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py'
--- tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py 2017-12-29 09:15:48 +0000
+++ tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py 2018-10-27 04:14:21 +0000
@@ -27,7 +27,8 @@
from openlp.core.common.registry import Registry
from openlp.core.common.settings import Settings
-from openlp.plugins.bibles.lib import BibleManager, parse_reference, LanguageSelection
+from openlp.plugins.bibles.lib import LanguageSelection, parse_reference
+from openlp.plugins.bibles.lib.manager import BibleManager
from tests.helpers.testmixin import TestMixin
from tests.utils.constants import TEST_RESOURCES_PATH
=== modified file 'tests/interfaces/openlp_plugins/custom/forms/test_customform.py'
--- tests/interfaces/openlp_plugins/custom/forms/test_customform.py 2017-12-29 09:15:48 +0000
+++ tests/interfaces/openlp_plugins/custom/forms/test_customform.py 2018-10-27 04:14:21 +0000
@@ -84,7 +84,7 @@
Test the on_add_button_clicked_test method / add_button button.
"""
# GIVEN: A mocked QDialog.exec() method
- with patch('PyQt5.QtWidgets.QDialog.exec') as mocked_exec:
+ with patch('PyQt5.QtWidgets.QDialog.exec'):
# WHEN: Add a new slide.
QtTest.QTest.mouseClick(self.form.add_button, QtCore.Qt.LeftButton)
=== modified file 'tests/interfaces/openlp_plugins/custom/forms/test_customslideform.py'
--- tests/interfaces/openlp_plugins/custom/forms/test_customslideform.py 2017-12-29 09:15:48 +0000
+++ tests/interfaces/openlp_plugins/custom/forms/test_customslideform.py 2018-10-27 04:14:21 +0000
@@ -58,7 +58,7 @@
Test if the dialog is correctly set up.
"""
# GIVEN: A mocked QDialog.exec() method
- with patch('PyQt5.QtWidgets.QDialog.exec') as mocked_exec:
+ with patch('PyQt5.QtWidgets.QDialog.exec'):
# WHEN: Show the dialog.
self.form.exec()
@@ -70,7 +70,7 @@
Test the set_text() method.
"""
# GIVEN: A mocked QDialog.exec() method
- with patch('PyQt5.QtWidgets.QDialog.exec') as mocked_exec:
+ with patch('PyQt5.QtWidgets.QDialog.exec'):
mocked_set_focus = MagicMock()
self.form.slide_text_edit.setFocus = mocked_set_focus
wanted_text = 'THIS TEXT SHOULD BE SHOWN.'
=== modified file 'tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py'
--- tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py 2017-12-29 09:15:48 +0000
+++ tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py 2018-10-27 04:14:21 +0000
@@ -79,7 +79,7 @@
Test if the dialog is correctly set up.
"""
# GIVEN: A mocked QDialog.exec() method
- with patch('PyQt5.QtWidgets.QDialog.exec') as mocked_exec:
+ with patch('PyQt5.QtWidgets.QDialog.exec'):
# WHEN: Show the dialog.
self.form.exec()
@@ -94,7 +94,7 @@
with patch('openlp.plugins.media.forms.mediaclipselectorform.critical_error_message_box') as \
mocked_critical_error_message_box,\
patch('openlp.plugins.media.forms.mediaclipselectorform.os.path.exists') as mocked_os_path_exists,\
- patch('PyQt5.QtWidgets.QDialog.exec') as mocked_exec:
+ patch('PyQt5.QtWidgets.QDialog.exec'):
self.form.exec()
# WHEN: The load button is clicked with no path set
@@ -132,7 +132,7 @@
Test the behavior when the title combobox is updated
"""
# GIVEN: Mocked methods and some entries in the title combobox.
- with patch('PyQt5.QtWidgets.QDialog.exec') as mocked_exec:
+ with patch('PyQt5.QtWidgets.QDialog.exec'):
self.form.exec()
self.form.vlc_media_player.get_length.return_value = 1000
self.form.audio_tracks_combobox.itemData = MagicMock()
@@ -161,7 +161,7 @@
# GIVEN: Mocked methods.
with patch('openlp.plugins.media.forms.mediaclipselectorform.critical_error_message_box') as \
mocked_critical_error_message_box,\
- patch('PyQt5.QtWidgets.QDialog.exec') as mocked_exec:
+ patch('PyQt5.QtWidgets.QDialog.exec'):
self.form.exec()
# WHEN: The save button is clicked with a NoneType in start_time_ms or end_time_ms
=== modified file 'tests/openlp_core/projectors/test_projector_sourceform.py'
--- tests/openlp_core/projectors/test_projector_sourceform.py 2018-04-20 06:04:43 +0000
+++ tests/openlp_core/projectors/test_projector_sourceform.py 2018-10-27 04:14:21 +0000
@@ -91,7 +91,7 @@
if os.path.exists(TEST_DB):
os.unlink(TEST_DB)
break
- except:
+ except Exception:
time.sleep(1)
retries += 1
self.destroy_settings()
Follow ups