diff --git a/openlp.py b/openlp.py index 5b4cef725..8ba77f92f 100755 --- a/openlp.py +++ b/openlp.py @@ -30,7 +30,7 @@ import sys from OpenGL import GL from openlp.core.app import main -from openlp.core.common import is_win, is_macosx +from openlp.core.common import is_macosx, is_win from openlp.core.common.applocation import AppLocation from openlp.core.common.path import create_paths diff --git a/openlp/core/api/deploy.py b/openlp/core/api/deploy.py index e336019d3..6bc2517a4 100644 --- a/openlp/core/api/deploy.py +++ b/openlp/core/api/deploy.py @@ -25,7 +25,7 @@ Download and "install" the remote web client from zipfile import ZipFile from openlp.core.common.applocation import AppLocation -from openlp.core.common.httputils import download_file, get_web_page, get_url_file_size +from openlp.core.common.httputils import download_file, get_url_file_size, get_web_page from openlp.core.common.registry import Registry diff --git a/openlp/core/api/endpoint/controller.py b/openlp/core/api/endpoint/controller.py index 7aa75b182..e59d207ae 100644 --- a/openlp/core/api/endpoint/controller.py +++ b/openlp/core/api/endpoint/controller.py @@ -34,6 +34,7 @@ from openlp.core.common.settings import Settings from openlp.core.lib import create_thumb from openlp.core.lib.serviceitem import ItemCapabilities + log = logging.getLogger(__name__) controller_endpoint = Endpoint('controller') diff --git a/openlp/core/api/endpoint/core.py b/openlp/core/api/endpoint/core.py index 43a2b8459..d7fee2817 100644 --- a/openlp/core/api/endpoint/core.py +++ b/openlp/core/api/endpoint/core.py @@ -30,8 +30,8 @@ from openlp.core.api.http.endpoint import Endpoint from openlp.core.common.i18n import UiStrings, translate from openlp.core.common.registry import Registry from openlp.core.lib import image_to_byte -from openlp.core.lib.plugin import StringContent -from openlp.core.lib.plugin import PluginStatus +from openlp.core.lib.plugin import PluginStatus, StringContent + template_dir = 'templates' static_dir = 'static' diff --git a/openlp/core/api/endpoint/remote.py b/openlp/core/api/endpoint/remote.py index 0e637339f..62b44f73b 100644 --- a/openlp/core/api/endpoint/remote.py +++ b/openlp/core/api/endpoint/remote.py @@ -24,6 +24,7 @@ import logging from openlp.core.api.endpoint.core import TRANSLATED_STRINGS from openlp.core.api.http.endpoint import Endpoint + log = logging.getLogger(__name__) remote_endpoint = Endpoint('remote', template_dir='remotes') diff --git a/openlp/core/api/endpoint/service.py b/openlp/core/api/endpoint/service.py index b642c3151..737fd7a7a 100644 --- a/openlp/core/api/endpoint/service.py +++ b/openlp/core/api/endpoint/service.py @@ -26,6 +26,7 @@ from openlp.core.api.http import requires_auth from openlp.core.api.http.endpoint import Endpoint from openlp.core.common.registry import Registry + log = logging.getLogger(__name__) service_endpoint = Endpoint('service') diff --git a/openlp/core/api/http/server.py b/openlp/core/api/http/server.py index 914ce2278..68a8e6781 100644 --- a/openlp/core/api/http/server.py +++ b/openlp/core/api/http/server.py @@ -30,22 +30,21 @@ from PyQt5 import QtCore, QtWidgets from waitress.server import create_server from openlp.core.api.deploy import download_and_check, download_sha256 -from openlp.core.api.endpoint.controller import controller_endpoint, api_controller_endpoint -from openlp.core.api.endpoint.core import chords_endpoint, stage_endpoint, blank_endpoint, main_endpoint +from openlp.core.api.endpoint.controller import api_controller_endpoint, controller_endpoint +from openlp.core.api.endpoint.core import blank_endpoint, chords_endpoint, main_endpoint, stage_endpoint from openlp.core.api.endpoint.remote import remote_endpoint -from openlp.core.api.endpoint.service import service_endpoint, api_service_endpoint -from openlp.core.api.http import application -from openlp.core.api.http import register_endpoint +from openlp.core.api.endpoint.service import api_service_endpoint, service_endpoint +from openlp.core.api.http import application, register_endpoint from openlp.core.api.poll import Poller from openlp.core.common.applocation import AppLocation -from openlp.core.common.i18n import UiStrings -from openlp.core.common.i18n import translate +from openlp.core.common.i18n import UiStrings, translate from openlp.core.common.mixins import LogMixin, RegistryProperties from openlp.core.common.path import create_paths from openlp.core.common.registry import Registry, RegistryBase from openlp.core.common.settings import Settings from openlp.core.threading import ThreadWorker, run_thread + log = logging.getLogger(__name__) diff --git a/openlp/core/api/http/wsgiapp.py b/openlp/core/api/http/wsgiapp.py index aa90a28aa..f8f0cdd20 100644 --- a/openlp/core/api/http/wsgiapp.py +++ b/openlp/core/api/http/wsgiapp.py @@ -33,6 +33,7 @@ from webob.static import DirectoryApp from openlp.core.api.http.errors import HttpError, NotFound, ServerError from openlp.core.common.applocation import AppLocation + ARGS_REGEX = re.compile(r'''\{(\w+)(?::([^}]+))?\}''', re.VERBOSE) log = logging.getLogger(__name__) diff --git a/openlp/core/api/tab.py b/openlp/core/api/tab.py index 83a8d76aa..ac8af9007 100644 --- a/openlp/core/api/tab.py +++ b/openlp/core/api/tab.py @@ -31,6 +31,7 @@ from openlp.core.common.settings import Settings from openlp.core.lib.settingstab import SettingsTab from openlp.core.ui.icons import UiIcons + ZERO_URL = '0.0.0.0' diff --git a/openlp/core/api/websockets.py b/openlp/core/api/websockets.py index 5528b4250..3dcaafea6 100644 --- a/openlp/core/api/websockets.py +++ b/openlp/core/api/websockets.py @@ -35,6 +35,7 @@ from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings from openlp.core.threading import ThreadWorker, run_thread + log = logging.getLogger(__name__) diff --git a/openlp/core/app.py b/openlp/core/app.py index b9479dc0c..ba125de3b 100644 --- a/openlp/core/app.py +++ b/openlp/core/app.py @@ -33,25 +33,26 @@ import time from datetime import datetime from traceback import format_exception -from PyQt5 import QtCore, QtWidgets, QtWebEngineWidgets # noqa +from PyQt5 import QtCore, QtWebEngineWidgets, QtWidgets # noqa from openlp.core.common import is_macosx, is_win from openlp.core.common.applocation import AppLocation from openlp.core.common.i18n import LanguageManager, UiStrings, translate -from openlp.core.common.path import create_paths, copytree +from openlp.core.common.path import copytree, create_paths from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings from openlp.core.display.screens import ScreenList from openlp.core.resources import qInitResources -from openlp.core.ui.splashscreen import SplashScreen +from openlp.core.server import Server from openlp.core.ui.exceptionform import ExceptionForm from openlp.core.ui.firsttimeform import FirstTimeForm from openlp.core.ui.firsttimelanguageform import FirstTimeLanguageForm from openlp.core.ui.mainwindow import MainWindow +from openlp.core.ui.splashscreen import SplashScreen from openlp.core.ui.style import get_application_stylesheet -from openlp.core.server import Server from openlp.core.version import check_for_update, get_version + __all__ = ['OpenLP', 'main'] diff --git a/openlp/core/common/actions.py b/openlp/core/common/actions.py index 0969f1f9b..31a44c7af 100644 --- a/openlp/core/common/actions.py +++ b/openlp/core/common/actions.py @@ -29,6 +29,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets from openlp.core.common.settings import Settings + log = logging.getLogger(__name__) diff --git a/openlp/core/common/applocation.py b/openlp/core/common/applocation.py index 14e6e4577..6c9f811e2 100644 --- a/openlp/core/common/applocation.py +++ b/openlp/core/common/applocation.py @@ -27,10 +27,11 @@ import os import sys import openlp -from openlp.core.common import get_frozen_path, is_win, is_macosx +from openlp.core.common import get_frozen_path, is_macosx, is_win from openlp.core.common.path import Path, create_paths from openlp.core.common.settings import Settings + if not is_win() and not is_macosx(): try: from xdg import BaseDirectory diff --git a/openlp/core/common/db.py b/openlp/core/common/db.py index ef5b7b2b7..b3e66aef7 100644 --- a/openlp/core/common/db.py +++ b/openlp/core/common/db.py @@ -27,6 +27,7 @@ from copy import deepcopy import sqlalchemy + log = logging.getLogger(__name__) diff --git a/openlp/core/common/httputils.py b/openlp/core/common/httputils.py index 54173a8d2..5eab07047 100644 --- a/openlp/core/common/httputils.py +++ b/openlp/core/common/httputils.py @@ -34,6 +34,7 @@ from openlp.core.common import trace_error_handler from openlp.core.common.registry import Registry from openlp.core.common.settings import ProxyMode, Settings + log = logging.getLogger(__name__ + '.__init__') USER_AGENTS = { diff --git a/openlp/core/common/i18n.py b/openlp/core/common/i18n.py index 56e6be724..73591f83e 100644 --- a/openlp/core/common/i18n.py +++ b/openlp/core/common/i18n.py @@ -30,10 +30,11 @@ from collections import namedtuple from PyQt5 import QtCore, QtWidgets -from openlp.core.common import is_win, is_macosx +from openlp.core.common import is_macosx, is_win from openlp.core.common.applocation import AppLocation from openlp.core.common.settings import Settings + log = logging.getLogger(__name__) diff --git a/openlp/core/common/mixins.py b/openlp/core/common/mixins.py index 4ff8f798d..9207479f2 100644 --- a/openlp/core/common/mixins.py +++ b/openlp/core/common/mixins.py @@ -28,6 +28,7 @@ import logging from openlp.core.common import is_win, trace_error_handler from openlp.core.common.registry import Registry + DO_NOT_TRACE_EVENTS = ['timerEvent', 'paintEvent', 'drag_enter_event', 'drop_event', 'on_controller_size_changed', 'preview_size_changed', 'resizeEvent'] diff --git a/openlp/core/common/path.py b/openlp/core/common/path.py index 64ec64a94..b3d96da71 100644 --- a/openlp/core/common/path.py +++ b/openlp/core/common/path.py @@ -25,6 +25,7 @@ from contextlib import suppress from openlp.core.common import is_win + if is_win(): from pathlib import WindowsPath as PathVariant # pragma: nocover else: diff --git a/openlp/core/common/registry.py b/openlp/core/common/registry.py index 938addf0b..dba378410 100644 --- a/openlp/core/common/registry.py +++ b/openlp/core/common/registry.py @@ -27,6 +27,7 @@ import sys from openlp.core.common import de_hump, trace_error_handler + log = logging.getLogger(__name__) diff --git a/openlp/core/common/settings.py b/openlp/core/common/settings.py index f9809fc67..6cd047a5a 100644 --- a/openlp/core/common/settings.py +++ b/openlp/core/common/settings.py @@ -33,7 +33,8 @@ from PyQt5 import QtCore, QtGui from openlp.core.common import SlideLimits, ThemeLevel, is_linux, is_win from openlp.core.common.json import OpenLPJsonDecoder, OpenLPJsonEncoder -from openlp.core.common.path import Path, str_to_path, files_to_paths +from openlp.core.common.path import Path, files_to_paths, str_to_path + log = logging.getLogger(__name__) diff --git a/openlp/core/display/canvas.py b/openlp/core/display/canvas.py index 09070d816..8e21838d9 100644 --- a/openlp/core/display/canvas.py +++ b/openlp/core/display/canvas.py @@ -32,7 +32,7 @@ import json import logging import os -from PyQt5 import QtCore, QtWidgets, QtGui, QtMultimedia, QtWebChannel, QtWebEngineWidgets +from PyQt5 import QtCore, QtGui, QtMultimedia, QtWebChannel, QtWebEngineWidgets, QtWidgets from openlp.core.common import is_macosx, is_win from openlp.core.common.applocation import AppLocation @@ -41,12 +41,13 @@ from openlp.core.common.mixins import LogMixin, RegistryProperties from openlp.core.common.path import path_to_str from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings +from openlp.core.display.screens import ScreenList from openlp.core.display.webengine import WebEngineView from openlp.core.display.window import MediaWatcher -from openlp.core.display.screens import ScreenList -from openlp.core.lib import ServiceItem, ImageSource, build_html, expand_tags, image_to_byte +from openlp.core.lib import ImageSource, ServiceItem, build_html, expand_tags, image_to_byte from openlp.core.lib.theme import BackgroundType -from openlp.core.ui import HideMode, AlertLocation, DisplayControllerType +from openlp.core.ui import AlertLocation, DisplayControllerType, HideMode + if is_macosx(): from ctypes import pythonapi, c_void_p, c_char_p, py_object diff --git a/openlp/core/display/render.py b/openlp/core/display/render.py index 696ddec47..f7bacf263 100644 --- a/openlp/core/display/render.py +++ b/openlp/core/display/render.py @@ -36,6 +36,7 @@ from openlp.core.display.window import DisplayWindow from openlp.core.display.screens import ScreenList from openlp.core.lib import ItemCapabilities + log = logging.getLogger(__name__) SLIM_CHARS = 'fiíIÍjlĺľrtť.,;/ ()|"\'!:\\' diff --git a/openlp/core/display/screens.py b/openlp/core/display/screens.py index 4cbfcbf25..60a72a6b2 100644 --- a/openlp/core/display/screens.py +++ b/openlp/core/display/screens.py @@ -32,6 +32,7 @@ from openlp.core.common.i18n import translate from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings + log = logging.getLogger(__name__) diff --git a/openlp/core/display/webengine.py b/openlp/core/display/webengine.py index c31f7ace2..2d5b1defa 100644 --- a/openlp/core/display/webengine.py +++ b/openlp/core/display/webengine.py @@ -25,7 +25,8 @@ Heavily inspired by https://stackoverflow.com/questions/33467776/qt-qwebengine-r """ import logging -from PyQt5 import QtCore, QtWidgets, QtWebEngineWidgets +from PyQt5 import QtCore, QtWebEngineWidgets, QtWidgets + LOG_LEVELS = { QtWebEngineWidgets.QWebEnginePage.InfoMessageLevel: logging.INFO, diff --git a/openlp/core/display/window.py b/openlp/core/display/window.py index caeed7fd4..e5411c1f6 100644 --- a/openlp/core/display/window.py +++ b/openlp/core/display/window.py @@ -22,14 +22,15 @@ """ The :mod:`~openlp.core.display.window` module contains the display window """ +import json import logging import os -import json -from PyQt5 import QtCore, QtWidgets, QtWebChannel +from PyQt5 import QtCore, QtWebChannel, QtWidgets from openlp.core.common.path import Path, path_to_str + log = logging.getLogger(__name__) DISPLAY_PATH = Path(__file__).parent / 'html' / 'display.html' diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index 6898e0469..69a385e30 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -31,10 +31,10 @@ from urllib.parse import quote_plus as urlquote from alembic.migration import MigrationContext from alembic.operations import Operations -from sqlalchemy import Table, MetaData, Column, UnicodeText, types, create_engine +from sqlalchemy import Column, MetaData, Table, UnicodeText, create_engine, types from sqlalchemy.engine.url import make_url -from sqlalchemy.exc import SQLAlchemyError, InvalidRequestError, DBAPIError, OperationalError, ProgrammingError -from sqlalchemy.orm import scoped_session, sessionmaker, mapper +from sqlalchemy.exc import DBAPIError, InvalidRequestError, OperationalError, ProgrammingError, SQLAlchemyError +from sqlalchemy.orm import mapper, scoped_session, sessionmaker from sqlalchemy.pool import NullPool from openlp.core.common import delete_file @@ -44,6 +44,7 @@ from openlp.core.common.json import OpenLPJsonDecoder, OpenLPJsonEncoder from openlp.core.common.settings import Settings from openlp.core.lib.ui import critical_error_message_box + log = logging.getLogger(__name__) diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index 2464a0c49..9c0e65fbb 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -408,10 +408,12 @@ is the function which has to be called from outside. The generated and returned """ import logging from string import Template + from PyQt5 import QtWebEngine from openlp.core.common.settings import Settings -from openlp.core.lib.theme import BackgroundType, BackgroundGradientType, VerticalType, HorizontalType +from openlp.core.lib.theme import BackgroundGradientType, BackgroundType, HorizontalType, VerticalType + log = logging.getLogger(__name__) diff --git a/openlp/core/lib/imagemanager.py b/openlp/core/lib/imagemanager.py index c72b3db6b..1f689ac95 100644 --- a/openlp/core/lib/imagemanager.py +++ b/openlp/core/lib/imagemanager.py @@ -34,9 +34,10 @@ from PyQt5 import QtCore from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings from openlp.core.display.screens import ScreenList -from openlp.core.lib import resize_image, image_to_byte +from openlp.core.lib import image_to_byte, resize_image from openlp.core.threading import ThreadWorker, run_thread + log = logging.getLogger(__name__) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 2136510db..4c5b4bdff 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -28,7 +28,6 @@ import re from PyQt5 import QtCore, QtWidgets from openlp.core.common.i18n import UiStrings, translate -from openlp.core.ui.icons import UiIcons from openlp.core.common.mixins import RegistryProperties from openlp.core.common.path import path_to_str, str_to_path from openlp.core.common.registry import Registry @@ -37,11 +36,13 @@ from openlp.core.lib import ServiceItemContext from openlp.core.lib.plugin import StringContent from openlp.core.lib.serviceitem import ServiceItem from openlp.core.lib.ui import create_widget_action, critical_error_message_box +from openlp.core.ui.icons import UiIcons from openlp.core.widgets.dialogs import FileDialog from openlp.core.widgets.edits import SearchEdit from openlp.core.widgets.toolbar import OpenLPToolbar from openlp.core.widgets.views import ListWidgetWithDnD + log = logging.getLogger(__name__) diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index acb874119..15aea4d61 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -32,6 +32,7 @@ from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings from openlp.core.version import get_version + log = logging.getLogger(__name__) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index de27e48b9..4ef26b6b1 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -35,12 +35,13 @@ from PyQt5 import QtGui from openlp.core.common import md5_hash from openlp.core.common.applocation import AppLocation from openlp.core.common.i18n import translate -from openlp.core.ui.icons import UiIcons from openlp.core.common.mixins import RegistryProperties from openlp.core.common.path import Path from openlp.core.common.settings import Settings from openlp.core.display.render import remove_tags, render_tags from openlp.core.lib import ImageSource, ItemCapabilities, build_icon +from openlp.core.ui.icons import UiIcons + log = logging.getLogger(__name__) diff --git a/openlp/core/lib/theme.py b/openlp/core/lib/theme.py index 53406cafd..b9a86f57c 100644 --- a/openlp/core/lib/theme.py +++ b/openlp/core/lib/theme.py @@ -32,7 +32,8 @@ from openlp.core.common.applocation import AppLocation from openlp.core.common.json import OpenLPJsonDecoder, OpenLPJsonEncoder from openlp.core.common.path import Path, str_to_path from openlp.core.display.screens import ScreenList -from openlp.core.lib import str_to_bool, get_text_file_string +from openlp.core.lib import get_text_file_string, str_to_bool + log = logging.getLogger(__name__) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 05e0a7286..20b1b66d5 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -33,6 +33,7 @@ from openlp.core.common.registry import Registry from openlp.core.lib import build_icon from openlp.core.ui.icons import UiIcons + log = logging.getLogger(__name__) diff --git a/openlp/core/projectors/constants.py b/openlp/core/projectors/constants.py index 6bacdac9d..d8587513a 100644 --- a/openlp/core/projectors/constants.py +++ b/openlp/core/projectors/constants.py @@ -26,6 +26,7 @@ import logging from openlp.core.common.i18n import translate + log = logging.getLogger(__name__) log.debug('projector_constants loaded') diff --git a/openlp/core/projectors/db.py b/openlp/core/projectors/db.py index f9297fae9..714e15e90 100644 --- a/openlp/core/projectors/db.py +++ b/openlp/core/projectors/db.py @@ -35,16 +35,20 @@ The Projector table keeps track of entries for controlled projectors. """ import logging -log = logging.getLogger(__name__) -log.debug('projector.lib.db module loaded') from sqlalchemy import Column, ForeignKey, Integer, MetaData, String, and_ from sqlalchemy.ext.declarative import declarative_base, declared_attr from sqlalchemy.orm import relationship from openlp.core.lib.db import Manager, init_db, init_url -from openlp.core.projectors.constants import PJLINK_DEFAULT_CODES from openlp.core.projectors import upgrade +from openlp.core.projectors.constants import PJLINK_DEFAULT_CODES + + +log = logging.getLogger(__name__) +log.debug('projector.lib.db module loaded') + + Base = declarative_base(MetaData()) diff --git a/openlp/core/projectors/editform.py b/openlp/core/projectors/editform.py index 2c0a9efc7..eaaef7107 100644 --- a/openlp/core/projectors/editform.py +++ b/openlp/core/projectors/editform.py @@ -29,9 +29,10 @@ from PyQt5 import QtCore, QtWidgets from openlp.core.common import verify_ip_address from openlp.core.common.i18n import translate -from openlp.core.ui.icons import UiIcons from openlp.core.projectors.constants import PJLINK_PORT from openlp.core.projectors.db import Projector +from openlp.core.ui.icons import UiIcons + log = logging.getLogger(__name__) log.debug('editform loaded') diff --git a/openlp/core/projectors/manager.py b/openlp/core/projectors/manager.py index c2575c60a..7b1d4d24b 100644 --- a/openlp/core/projectors/manager.py +++ b/openlp/core/projectors/manager.py @@ -30,22 +30,22 @@ import logging from PyQt5 import QtCore, QtGui, QtWidgets from openlp.core.common.i18n import translate -from openlp.core.ui.icons import UiIcons from openlp.core.common.mixins import LogMixin, RegistryProperties from openlp.core.common.registry import RegistryBase from openlp.core.common.settings import Settings from openlp.core.lib.ui import create_widget_action from openlp.core.projectors import DialogSourceStyle -from openlp.core.projectors.constants import E_AUTHENTICATION, E_ERROR, E_NETWORK, E_NOT_CONNECTED, \ - E_SOCKET_TIMEOUT, E_UNKNOWN_SOCKET_ERROR, S_CONNECTED, S_CONNECTING, S_COOLDOWN, S_INITIALIZE, \ - S_NOT_CONNECTED, S_OFF, S_ON, S_STANDBY, S_WARMUP, PJLINK_PORT, STATUS_CODE, STATUS_MSG, QSOCKET_STATE - +from openlp.core.projectors.constants import E_AUTHENTICATION, E_ERROR, E_NETWORK, E_NOT_CONNECTED, E_SOCKET_TIMEOUT, \ + E_UNKNOWN_SOCKET_ERROR, PJLINK_PORT, QSOCKET_STATE, S_CONNECTED, S_CONNECTING, S_COOLDOWN, S_INITIALIZE, \ + S_NOT_CONNECTED, S_OFF, S_ON, S_STANDBY, S_WARMUP, STATUS_CODE, STATUS_MSG from openlp.core.projectors.db import ProjectorDB from openlp.core.projectors.editform import ProjectorEditForm from openlp.core.projectors.pjlink import PJLink, PJLinkUDP -from openlp.core.projectors.sourceselectform import SourceSelectTabs, SourceSelectSingle +from openlp.core.projectors.sourceselectform import SourceSelectSingle, SourceSelectTabs +from openlp.core.ui.icons import UiIcons from openlp.core.widgets.toolbar import OpenLPToolbar + log = logging.getLogger(__name__) log.debug('projectormanager loaded') diff --git a/openlp/core/projectors/pjlink.py b/openlp/core/projectors/pjlink.py index 3ea1bb414..8703a1afb 100644 --- a/openlp/core/projectors/pjlink.py +++ b/openlp/core/projectors/pjlink.py @@ -55,11 +55,12 @@ from PyQt5 import QtCore, QtNetwork from openlp.core.common import qmd5_hash from openlp.core.common.i18n import translate from openlp.core.common.settings import Settings -from openlp.core.projectors.constants import CONNECTION_ERRORS, PJLINK_CLASS, PJLINK_DEFAULT_CODES, PJLINK_ERRORS, \ - PJLINK_ERST_DATA, PJLINK_ERST_STATUS, PJLINK_MAX_PACKET, PJLINK_PREFIX, PJLINK_PORT, PJLINK_POWR_STATUS, \ - PJLINK_SUFFIX, PJLINK_VALID_CMD, PROJECTOR_STATE, STATUS_CODE, STATUS_MSG, QSOCKET_STATE, \ - E_AUTHENTICATION, E_CONNECTION_REFUSED, E_GENERAL, E_NETWORK, E_NOT_CONNECTED, E_SOCKET_TIMEOUT, \ - S_CONNECTED, S_CONNECTING, S_NOT_CONNECTED, S_OFF, S_OK, S_ON, S_STANDBY +from openlp.core.projectors.constants import CONNECTION_ERRORS, E_AUTHENTICATION, E_CONNECTION_REFUSED, E_GENERAL, \ + E_NETWORK, E_NOT_CONNECTED, E_SOCKET_TIMEOUT, PJLINK_CLASS, PJLINK_DEFAULT_CODES, PJLINK_ERRORS, PJLINK_ERST_DATA, \ + PJLINK_ERST_STATUS, PJLINK_MAX_PACKET, PJLINK_PORT, PJLINK_POWR_STATUS, PJLINK_PREFIX, PJLINK_SUFFIX, \ + PJLINK_VALID_CMD, PROJECTOR_STATE, QSOCKET_STATE, S_CONNECTED, S_CONNECTING, S_NOT_CONNECTED, S_OFF, S_OK, S_ON, \ + S_STANDBY, STATUS_CODE, STATUS_MSG + log = logging.getLogger(__name__) log.debug('pjlink loaded') diff --git a/openlp/core/projectors/sourceselectform.py b/openlp/core/projectors/sourceselectform.py index b9c3501a4..8cd77edfc 100644 --- a/openlp/core/projectors/sourceselectform.py +++ b/openlp/core/projectors/sourceselectform.py @@ -31,9 +31,10 @@ from PyQt5 import QtCore, QtWidgets from openlp.core.common import is_macosx from openlp.core.common.i18n import translate from openlp.core.lib import build_icon -from openlp.core.projectors.constants import PJLINK_DEFAULT_SOURCES, PJLINK_DEFAULT_CODES +from openlp.core.projectors.constants import PJLINK_DEFAULT_CODES, PJLINK_DEFAULT_SOURCES from openlp.core.projectors.db import ProjectorSource + log = logging.getLogger(__name__) diff --git a/openlp/core/projectors/tab.py b/openlp/core/projectors/tab.py index b9fb38d83..3ceba17f4 100644 --- a/openlp/core/projectors/tab.py +++ b/openlp/core/projectors/tab.py @@ -29,8 +29,9 @@ from PyQt5 import QtWidgets from openlp.core.common.i18n import UiStrings, translate from openlp.core.common.settings import Settings from openlp.core.lib.settingstab import SettingsTab -from openlp.core.ui.icons import UiIcons from openlp.core.projectors import DialogSourceStyle +from openlp.core.ui.icons import UiIcons + log = logging.getLogger(__name__) log.debug('projectortab module loaded') diff --git a/openlp/core/projectors/upgrade.py b/openlp/core/projectors/upgrade.py index d3837eda0..573232049 100644 --- a/openlp/core/projectors/upgrade.py +++ b/openlp/core/projectors/upgrade.py @@ -25,11 +25,12 @@ backend for the projector setup. """ import logging -from sqlalchemy import Table, Column, types +from sqlalchemy import Column, Table, types from sqlalchemy.sql.expression import null from openlp.core.lib.db import get_upgrade_op + log = logging.getLogger(__name__) # Initial projector DB was unversioned diff --git a/openlp/core/server.py b/openlp/core/server.py index fc4ec64b6..da02b587b 100644 --- a/openlp/core/server.py +++ b/openlp/core/server.py @@ -21,8 +21,8 @@ ############################################################################### from PyQt5 import QtCore, QtNetwork -from openlp.core.common.registry import Registry from openlp.core.common.mixins import LogMixin +from openlp.core.common.registry import Registry class Server(QtCore.QObject, LogMixin): diff --git a/openlp/core/ui/aboutform.py b/openlp/core/ui/aboutform.py index 5967108d5..0e8bc4c97 100644 --- a/openlp/core/ui/aboutform.py +++ b/openlp/core/ui/aboutform.py @@ -28,6 +28,7 @@ from PyQt5 import QtCore, QtWidgets from openlp.core.common.i18n import translate from openlp.core.version import get_version + from .aboutdialog import UiAboutDialog diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 90c56d9da..d5d944642 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -32,12 +32,13 @@ from openlp.core.common.applocation import AppLocation from openlp.core.common.i18n import UiStrings, format_time, translate from openlp.core.common.settings import Settings from openlp.core.lib.settingstab import SettingsTab -from openlp.core.ui.style import HAS_DARK_STYLE from openlp.core.ui.icons import UiIcons +from openlp.core.ui.style import HAS_DARK_STYLE from openlp.core.widgets.edits import PathEdit from openlp.core.widgets.enums import PathEditType from openlp.core.widgets.widgets import ProxyWidget + log = logging.getLogger(__name__) diff --git a/openlp/core/ui/exceptiondialog.py b/openlp/core/ui/exceptiondialog.py index 5772aace6..6abc741bc 100644 --- a/openlp/core/ui/exceptiondialog.py +++ b/openlp/core/ui/exceptiondialog.py @@ -26,8 +26,8 @@ The GUI widgets of the exception dialog. from PyQt5 import QtGui, QtWidgets from openlp.core.common.i18n import translate -from openlp.core.ui.icons import UiIcons from openlp.core.lib.ui import create_button, create_button_box +from openlp.core.ui.icons import UiIcons class Ui_ExceptionDialog(object): diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 2a8a1beb8..f2234091e 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -34,7 +34,7 @@ from openlp.core.common.i18n import UiStrings, translate from openlp.core.common.mixins import RegistryProperties from openlp.core.common.settings import Settings from openlp.core.ui.exceptiondialog import Ui_ExceptionDialog -from openlp.core.version import get_version, get_library_versions +from openlp.core.version import get_library_versions, get_version from openlp.core.widgets.dialogs import FileDialog diff --git a/openlp/core/ui/firsttimeform.py b/openlp/core/ui/firsttimeform.py index fce6749e4..8d9092dc0 100644 --- a/openlp/core/ui/firsttimeform.py +++ b/openlp/core/ui/firsttimeform.py @@ -34,7 +34,7 @@ from PyQt5 import QtCore, QtWidgets from openlp.core.common import clean_button_text, trace_error_handler from openlp.core.common.applocation import AppLocation -from openlp.core.common.httputils import get_web_page, get_url_file_size, download_file +from openlp.core.common.httputils import download_file, get_url_file_size, get_web_page from openlp.core.common.i18n import translate from openlp.core.common.mixins import RegistryProperties from openlp.core.common.path import Path, create_paths @@ -43,8 +43,9 @@ from openlp.core.common.settings import Settings from openlp.core.lib import build_icon from openlp.core.lib.plugin import PluginStatus from openlp.core.lib.ui import critical_error_message_box -from openlp.core.threading import ThreadWorker, run_thread, get_thread_worker, is_thread_finished -from openlp.core.ui.firsttimewizard import UiFirstTimeWizard, FirstTimePage +from openlp.core.threading import ThreadWorker, get_thread_worker, is_thread_finished, run_thread +from openlp.core.ui.firsttimewizard import FirstTimePage, UiFirstTimeWizard + log = logging.getLogger(__name__) diff --git a/openlp/core/ui/firsttimelanguageform.py b/openlp/core/ui/firsttimelanguageform.py index 9caea14c9..8e8c81df2 100644 --- a/openlp/core/ui/firsttimelanguageform.py +++ b/openlp/core/ui/firsttimelanguageform.py @@ -26,6 +26,7 @@ from PyQt5 import QtCore, QtWidgets from openlp.core.common.i18n import LanguageManager from openlp.core.lib.ui import create_action + from .firsttimelanguagedialog import Ui_FirstTimeLanguageDialog diff --git a/openlp/core/ui/firsttimewizard.py b/openlp/core/ui/firsttimewizard.py index 75611c722..b8e939787 100644 --- a/openlp/core/ui/firsttimewizard.py +++ b/openlp/core/ui/firsttimewizard.py @@ -24,7 +24,7 @@ The UI widgets for the first time wizard. """ from PyQt5 import QtCore, QtGui, QtWidgets -from openlp.core.common import is_macosx, clean_button_text +from openlp.core.common import clean_button_text, is_macosx from openlp.core.common.i18n import translate from openlp.core.common.settings import Settings from openlp.core.lib.ui import add_welcome_page diff --git a/openlp/core/ui/formattingtagdialog.py b/openlp/core/ui/formattingtagdialog.py index 4e884e141..5984baaf8 100644 --- a/openlp/core/ui/formattingtagdialog.py +++ b/openlp/core/ui/formattingtagdialog.py @@ -25,8 +25,8 @@ The UI widgets for the formatting tags window. from PyQt5 import QtCore, QtWidgets from openlp.core.common.i18n import UiStrings, translate -from openlp.core.ui.icons import UiIcons from openlp.core.lib.ui import create_button_box +from openlp.core.ui.icons import UiIcons class Ui_FormattingTagDialog(object): diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index 4eb7ddadd..90d053535 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -35,6 +35,7 @@ from openlp.core.lib.settingstab import SettingsTab from openlp.core.widgets.buttons import ColorButton from openlp.core.widgets.edits import PathEdit + log = logging.getLogger(__name__) diff --git a/openlp/core/ui/icons.py b/openlp/core/ui/icons.py index 9d4102579..08d97da02 100644 --- a/openlp/core/ui/icons.py +++ b/openlp/core/ui/icons.py @@ -23,13 +23,14 @@ The :mod:`languages` module provides a list of icons. """ import logging -import qtawesome as qta +import qtawesome as qta from PyQt5 import QtGui, QtWidgets from openlp.core.common.applocation import AppLocation from openlp.core.lib import build_icon + log = logging.getLogger(__name__) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 266b7f28f..af821444c 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -32,11 +32,10 @@ from PyQt5 import QtCore, QtGui, QtWidgets from openlp.core.api import websockets from openlp.core.api.http import server -from openlp.core.common import is_win, is_macosx, add_actions +from openlp.core.common import add_actions, is_macosx, is_win from openlp.core.common.actions import ActionList, CategoryOrder from openlp.core.common.applocation import AppLocation from openlp.core.common.i18n import LanguageManager, UiStrings, translate -from openlp.core.ui.icons import UiIcons from openlp.core.common.mixins import LogMixin, RegistryProperties from openlp.core.common.path import Path, copyfile, create_paths from openlp.core.common.registry import Registry @@ -48,21 +47,22 @@ from openlp.core.lib.plugin import PluginStatus from openlp.core.lib.pluginmanager import PluginManager from openlp.core.lib.ui import create_action from openlp.core.projectors.manager import ProjectorManager -from openlp.core.ui.shortcutlistform import ShortcutListForm -from openlp.core.ui.formattingtagform import FormattingTagForm -from openlp.core.ui.thememanager import ThemeManager -from openlp.core.ui.servicemanager import ServiceManager from openlp.core.ui.aboutform import AboutForm -from openlp.core.ui.pluginform import PluginForm -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.formattingtagform import FormattingTagForm +from openlp.core.ui.icons import UiIcons from openlp.core.ui.media import MediaController +from openlp.core.ui.pluginform import PluginForm from openlp.core.ui.printserviceform import PrintServiceForm +from openlp.core.ui.servicemanager import ServiceManager +from openlp.core.ui.settingsform import SettingsForm +from openlp.core.ui.shortcutlistform import ShortcutListForm +from openlp.core.ui.slidecontroller import LiveController, PreviewController from openlp.core.ui.style import PROGRESSBAR_STYLE, get_library_stylesheet +from openlp.core.ui.thememanager import ThemeManager from openlp.core.version import get_version from openlp.core.widgets.dialogs import FileDialog -from openlp.core.widgets.docks import OpenLPDockWidget, MediaDockManager +from openlp.core.widgets.docks import MediaDockManager, OpenLPDockWidget class Ui_MainWindow(object): diff --git a/openlp/core/ui/media/endpoint.py b/openlp/core/ui/media/endpoint.py index dce41de8d..2d8cbb52e 100644 --- a/openlp/core/ui/media/endpoint.py +++ b/openlp/core/ui/media/endpoint.py @@ -28,6 +28,7 @@ from openlp.core.api.http import requires_auth from openlp.core.api.http.endpoint import Endpoint from openlp.core.common.registry import Registry + log = logging.getLogger(__name__) media_endpoint = Endpoint('media') diff --git a/openlp/core/ui/media/mediacontroller.py b/openlp/core/ui/media/mediacontroller.py index 4af015c06..54c59f862 100644 --- a/openlp/core/ui/media/mediacontroller.py +++ b/openlp/core/ui/media/mediacontroller.py @@ -39,13 +39,14 @@ from openlp.core.lib.serviceitem import ItemCapabilities from openlp.core.lib.ui import critical_error_message_box from openlp.core.ui import DisplayControllerType from openlp.core.ui.icons import UiIcons -from openlp.core.ui.media import MediaState, MediaInfo, MediaType, get_media_players, set_media_players, \ - parse_optical_path +from openlp.core.ui.media import MediaInfo, MediaState, MediaType, get_media_players, parse_optical_path, \ + set_media_players from openlp.core.ui.media.endpoint import media_endpoint from openlp.core.ui.media.mediaplayer import MediaPlayer from openlp.core.ui.media.vendor.mediainfoWrapper import MediaInfoWrapper from openlp.core.widgets.toolbar import OpenLPToolbar + log = logging.getLogger(__name__) TICK_TIME = 200 diff --git a/openlp/core/ui/media/systemplayer.py b/openlp/core/ui/media/systemplayer.py index 063c9acea..79da5e2de 100644 --- a/openlp/core/ui/media/systemplayer.py +++ b/openlp/core/ui/media/systemplayer.py @@ -29,9 +29,10 @@ import mimetypes from PyQt5 import QtCore, QtMultimedia, QtMultimediaWidgets from openlp.core.common.i18n import translate +from openlp.core.threading import ThreadWorker, is_thread_finished, run_thread from openlp.core.ui.media import MediaState from openlp.core.ui.media.mediaplayer import MediaPlayer -from openlp.core.threading import ThreadWorker, run_thread, is_thread_finished + log = logging.getLogger(__name__) diff --git a/openlp/core/ui/media/vendor/mediainfoWrapper.py b/openlp/core/ui/media/vendor/mediainfoWrapper.py index d28fe1395..3ef7ae6e8 100644 --- a/openlp/core/ui/media/vendor/mediainfoWrapper.py +++ b/openlp/core/ui/media/vendor/mediainfoWrapper.py @@ -29,6 +29,7 @@ from subprocess import check_output from bs4 import BeautifulSoup, NavigableString + ENV_DICT = os.environ diff --git a/openlp/core/ui/media/vendor/vlc.py b/openlp/core/ui/media/vendor/vlc.py index b7c7cfdce..b26965baa 100644 --- a/openlp/core/ui/media/vendor/vlc.py +++ b/openlp/core/ui/media/vendor/vlc.py @@ -47,6 +47,7 @@ from ctypes.util import find_library # Used by EventManager in override.py from inspect import getargspec + __version__ = "N/A" build_date = "Mon Jan 25 19:40:05 2016" diff --git a/openlp/core/ui/media/vlcplayer.py b/openlp/core/ui/media/vlcplayer.py index 13888e28d..6931c7d04 100644 --- a/openlp/core/ui/media/vlcplayer.py +++ b/openlp/core/ui/media/vlcplayer.py @@ -32,12 +32,13 @@ from distutils.version import LooseVersion from PyQt5 import QtWidgets -from openlp.core.common import is_win, is_macosx, is_linux +from openlp.core.common import is_linux, is_macosx, is_win from openlp.core.common.i18n import translate from openlp.core.common.settings import Settings from openlp.core.ui.media import MediaState, MediaType from openlp.core.ui.media.mediaplayer import MediaPlayer + log = logging.getLogger(__name__) # Audio and video extensions copied from 'include/vlc_interface.h' from vlc 2.2.0 source diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index 717a96d0b..4f3e0eda9 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.py @@ -31,6 +31,7 @@ from openlp.core.common.mixins import RegistryProperties from openlp.core.lib.plugin import PluginStatus from openlp.core.ui.plugindialog import Ui_PluginViewDialog + log = logging.getLogger(__name__) diff --git a/openlp/core/ui/printservicedialog.py b/openlp/core/ui/printservicedialog.py index 5d58308e4..ef1c3cf59 100644 --- a/openlp/core/ui/printservicedialog.py +++ b/openlp/core/ui/printservicedialog.py @@ -22,7 +22,7 @@ """ The UI widgets of the print service dialog. """ -from PyQt5 import QtCore, QtWidgets, QtPrintSupport +from PyQt5 import QtCore, QtPrintSupport, QtWidgets from openlp.core.common.i18n import UiStrings, translate from openlp.core.ui.icons import UiIcons diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 7cca69ebc..30eee1700 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -26,7 +26,7 @@ import datetime import html import lxml.html -from PyQt5 import QtCore, QtGui, QtWidgets, QtPrintSupport +from PyQt5 import QtCore, QtGui, QtPrintSupport, QtWidgets from openlp.core.common.applocation import AppLocation from openlp.core.common.i18n import UiStrings, translate @@ -36,6 +36,7 @@ from openlp.core.common.settings import Settings from openlp.core.lib import get_text_file_string, image_to_byte from openlp.core.ui.printservicedialog import Ui_PrintServiceDialog, ZoomSize + DEFAULT_CSS = """/* Edit this file to customize the service order print. Note, that not all CSS properties are supported. See: diff --git a/openlp/core/ui/screenstab.py b/openlp/core/ui/screenstab.py index 309996aa8..b61d00a09 100644 --- a/openlp/core/ui/screenstab.py +++ b/openlp/core/ui/screenstab.py @@ -32,6 +32,7 @@ from openlp.core.display.screens import ScreenList from openlp.core.lib.settingstab import SettingsTab from openlp.core.ui.icons import UiIcons + SCREENS_LAYOUT_STYLE = """ #screen_frame { background-color: palette(base); diff --git a/openlp/core/ui/serviceitemeditdialog.py b/openlp/core/ui/serviceitemeditdialog.py index db87db3d3..e7fc7d499 100644 --- a/openlp/core/ui/serviceitemeditdialog.py +++ b/openlp/core/ui/serviceitemeditdialog.py @@ -25,7 +25,7 @@ The UI widgets for the service item edit dialog from PyQt5 import QtWidgets from openlp.core.common.i18n import translate -from openlp.core.lib.ui import create_button_box, create_button +from openlp.core.lib.ui import create_button, create_button_box from openlp.core.ui.icons import UiIcons diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 9658bd1e4..d42a5cdd5 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -37,17 +37,17 @@ from openlp.core.common import ThemeLevel, delete_file from openlp.core.common.actions import ActionList, CategoryOrder from openlp.core.common.applocation import AppLocation from openlp.core.common.i18n import UiStrings, format_time, translate -from openlp.core.ui.icons import UiIcons from openlp.core.common.json import OpenLPJsonDecoder, OpenLPJsonEncoder from openlp.core.common.mixins import LogMixin, RegistryProperties from openlp.core.common.path import Path, str_to_path from openlp.core.common.registry import Registry, RegistryBase from openlp.core.common.settings import Settings from openlp.core.lib import build_icon -from openlp.core.lib.plugin import PluginStatus -from openlp.core.lib.serviceitem import ServiceItem, ItemCapabilities from openlp.core.lib.exceptions import ValidationError -from openlp.core.lib.ui import critical_error_message_box, create_widget_action, find_and_set_in_combo_box +from openlp.core.lib.plugin import PluginStatus +from openlp.core.lib.serviceitem import ItemCapabilities, ServiceItem +from openlp.core.lib.ui import create_widget_action, critical_error_message_box, find_and_set_in_combo_box +from openlp.core.ui.icons import UiIcons from openlp.core.ui.serviceitemeditform import ServiceItemEditForm from openlp.core.ui.servicenoteform import ServiceNoteForm from openlp.core.ui.starttimeform import StartTimeForm diff --git a/openlp/core/ui/settingsform.py b/openlp/core/ui/settingsform.py index 19f0fa929..fc70449c5 100644 --- a/openlp/core/ui/settingsform.py +++ b/openlp/core/ui/settingsform.py @@ -33,10 +33,11 @@ from openlp.core.lib import build_icon from openlp.core.projectors.tab import ProjectorTab from openlp.core.ui.advancedtab import AdvancedTab from openlp.core.ui.generaltab import GeneralTab -from openlp.core.ui.screenstab import ScreensTab -from openlp.core.ui.themestab import ThemesTab from openlp.core.ui.media import PlayerTab +from openlp.core.ui.screenstab import ScreensTab from openlp.core.ui.settingsdialog import Ui_SettingsDialog +from openlp.core.ui.themestab import ThemesTab + log = logging.getLogger(__name__) diff --git a/openlp/core/ui/shortcutlistform.py b/openlp/core/ui/shortcutlistform.py index d09103a8f..59f3190c8 100644 --- a/openlp/core/ui/shortcutlistform.py +++ b/openlp/core/ui/shortcutlistform.py @@ -33,6 +33,7 @@ from openlp.core.common.mixins import RegistryProperties from openlp.core.common.settings import Settings from openlp.core.ui.shortcutlistdialog import Ui_ShortcutListDialog + REMOVE_AMPERSAND = re.compile(r'&{1}') log = logging.getLogger(__name__) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 5ade96f32..45057878f 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -35,16 +35,17 @@ from openlp.core.common.mixins import LogMixin, RegistryProperties 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.display.window import DisplayWindow from openlp.core.lib import ImageSource, ServiceItemAction from openlp.core.lib.serviceitem import ItemCapabilities from openlp.core.lib.ui import create_action -from openlp.core.ui import HideMode, DisplayControllerType +from openlp.core.ui import DisplayControllerType, HideMode from openlp.core.ui.icons import UiIcons -from openlp.core.display.window import DisplayWindow from openlp.core.widgets.layouts import AspectRatioLayout from openlp.core.widgets.toolbar import OpenLPToolbar from openlp.core.widgets.views import ListPreviewWidget + # Threshold which has to be trespassed to toggle. HIDE_MENU_THRESHOLD = 27 AUDIO_TIME_LABEL_STYLESHEET = 'background-color: palette(background); ' \ diff --git a/openlp/core/ui/style.py b/openlp/core/ui/style.py index 23f22c540..238bcf5e0 100644 --- a/openlp/core/ui/style.py +++ b/openlp/core/ui/style.py @@ -28,6 +28,7 @@ from openlp.core.common import is_win from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings + try: import qdarkstyle HAS_DARK_STYLE = True diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index a0d0ab9ad..b920ce6ac 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -30,12 +30,13 @@ from openlp.core.common import get_images_filter, is_not_image_file from openlp.core.common.i18n import UiStrings, translate from openlp.core.common.mixins import RegistryProperties from openlp.core.common.registry import Registry -from openlp.core.lib.theme import BackgroundType, BackgroundGradientType +from openlp.core.lib.theme import BackgroundGradientType, BackgroundType from openlp.core.lib.ui import critical_error_message_box -from openlp.core.ui.themelayoutform import ThemeLayoutForm -from openlp.core.ui.themewizard import Ui_ThemeWizard # TODO: Fix this. Use a "get_video_extensions" method which uses the current media player from openlp.core.ui.media.vlcplayer import VIDEO_EXT +from openlp.core.ui.themelayoutform import ThemeLayoutForm +from openlp.core.ui.themewizard import Ui_ThemeWizard + log = logging.getLogger(__name__) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index fe6267dfa..4c14f4ad0 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -24,24 +24,24 @@ The Theme Manager manages adding, deleteing and modifying of themes. """ import os import zipfile -from xml.etree.ElementTree import ElementTree, XML +from xml.etree.ElementTree import XML, ElementTree from PyQt5 import QtCore, QtGui, QtWidgets from openlp.core.common import delete_file from openlp.core.common.applocation import AppLocation -from openlp.core.common.i18n import UiStrings, translate, get_locale_key -from openlp.core.ui.icons import UiIcons +from openlp.core.common.i18n import UiStrings, get_locale_key, translate from openlp.core.common.mixins import LogMixin, RegistryProperties from openlp.core.common.path import Path, copyfile, create_paths, path_to_str from openlp.core.common.registry import Registry, RegistryBase from openlp.core.common.settings import Settings -from openlp.core.lib import ImageSource, get_text_file_string, build_icon, \ - check_item_selected, create_thumb, validate_thumb +from openlp.core.lib import ImageSource, build_icon, check_item_selected, create_thumb, get_text_file_string, \ + validate_thumb from openlp.core.lib.exceptions import ValidationError -from openlp.core.lib.theme import Theme, BackgroundType -from openlp.core.lib.ui import critical_error_message_box, create_widget_action +from openlp.core.lib.theme import BackgroundType, Theme +from openlp.core.lib.ui import create_widget_action, critical_error_message_box from openlp.core.ui.filerenameform import FileRenameForm +from openlp.core.ui.icons import UiIcons from openlp.core.ui.themeform import ThemeForm from openlp.core.widgets.dialogs import FileDialog from openlp.core.widgets.toolbar import OpenLPToolbar diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index 171f5419c..75df467f3 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -26,7 +26,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets from openlp.core.common import is_macosx from openlp.core.common.i18n import UiStrings, translate -from openlp.core.lib.theme import HorizontalType, BackgroundType, BackgroundGradientType +from openlp.core.lib.theme import BackgroundGradientType, BackgroundType, HorizontalType from openlp.core.lib.ui import add_welcome_page, create_valign_selection_widgets from openlp.core.ui.icons import UiIcons from openlp.core.widgets.buttons import ColorButton diff --git a/openlp/core/version.py b/openlp/core/version.py index 6636716ba..b19cac2d2 100644 --- a/openlp/core/version.py +++ b/openlp/core/version.py @@ -29,7 +29,7 @@ import time from collections import OrderedDict from datetime import date from distutils.version import LooseVersion -from subprocess import Popen, PIPE +from subprocess import PIPE, Popen import requests from PyQt5 import QtCore @@ -38,6 +38,7 @@ from openlp.core.common.applocation import AppLocation from openlp.core.common.settings import Settings from openlp.core.threading import ThreadWorker, run_thread + log = logging.getLogger(__name__) APPLICATION_VERSION = {} diff --git a/openlp/core/widgets/docks.py b/openlp/core/widgets/docks.py index 5d2858ae6..daa62be11 100644 --- a/openlp/core/widgets/docks.py +++ b/openlp/core/widgets/docks.py @@ -30,6 +30,7 @@ from openlp.core.display.screens import ScreenList from openlp.core.lib import build_icon from openlp.core.lib.plugin import StringContent + log = logging.getLogger(__name__) diff --git a/openlp/core/widgets/edits.py b/openlp/core/widgets/edits.py index 3333df633..c0a4e8072 100644 --- a/openlp/core/widgets/edits.py +++ b/openlp/core/widgets/edits.py @@ -33,11 +33,12 @@ 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.lib.ui import create_action, create_widget_action from openlp.core.ui.icons import UiIcons from openlp.core.widgets.dialogs import FileDialog from openlp.core.widgets.enums import PathEditType + try: import enchant from enchant import DictNotFoundError diff --git a/openlp/core/widgets/toolbar.py b/openlp/core/widgets/toolbar.py index e0ba4e301..8f2fd3843 100644 --- a/openlp/core/widgets/toolbar.py +++ b/openlp/core/widgets/toolbar.py @@ -28,6 +28,7 @@ from PyQt5 import QtCore, QtWidgets from openlp.core.lib.ui import create_widget_action + log = logging.getLogger(__name__) diff --git a/openlp/core/widgets/wizard.py b/openlp/core/widgets/wizard.py index 738818469..b4063549f 100644 --- a/openlp/core/widgets/wizard.py +++ b/openlp/core/widgets/wizard.py @@ -28,14 +28,15 @@ from PyQt5 import QtCore, QtGui, QtWidgets from openlp.core.common import is_macosx from openlp.core.common.i18n import UiStrings, translate -from openlp.core.ui.icons import UiIcons 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.ui.icons import UiIcons from openlp.core.widgets.dialogs import FileDialog + log = logging.getLogger(__name__) diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index f613c30c7..a24775a8d 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -28,17 +28,18 @@ from openlp.core.api.http import register_endpoint from openlp.core.common.actions import ActionList from openlp.core.common.i18n import UiStrings, translate from openlp.core.common.settings import Settings -from openlp.core.lib.plugin import Plugin, StringContent from openlp.core.lib.db import Manager +from openlp.core.lib.plugin import Plugin, StringContent from openlp.core.lib.theme import VerticalType from openlp.core.lib.ui import create_action 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.endpoint import alerts_endpoint, api_alerts_endpoint from openlp.plugins.alerts.forms import AlertForm from openlp.plugins.alerts.lib import AlertsManager, AlertsTab from openlp.plugins.alerts.lib.db import init_schema + log = logging.getLogger(__name__) JAVASCRIPT = """ diff --git a/openlp/plugins/alerts/endpoint.py b/openlp/plugins/alerts/endpoint.py index 542d5ef37..a002ca435 100644 --- a/openlp/plugins/alerts/endpoint.py +++ b/openlp/plugins/alerts/endpoint.py @@ -29,6 +29,7 @@ from openlp.core.api.http.endpoint import Endpoint from openlp.core.common.registry import Registry from openlp.core.lib.plugin import PluginStatus + log = logging.getLogger(__name__) alerts_endpoint = Endpoint('alert') diff --git a/openlp/plugins/alerts/forms/alertdialog.py b/openlp/plugins/alerts/forms/alertdialog.py index 1feac882c..bc929e7f1 100644 --- a/openlp/plugins/alerts/forms/alertdialog.py +++ b/openlp/plugins/alerts/forms/alertdialog.py @@ -23,8 +23,8 @@ from PyQt5 import QtWidgets from openlp.core.common.i18n import translate -from openlp.core.ui.icons import UiIcons from openlp.core.lib.ui import create_button, create_button_box +from openlp.core.ui.icons import UiIcons class Ui_AlertDialog(object): diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index 32da0353a..d1e53b3d2 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -25,6 +25,7 @@ from PyQt5 import QtCore, QtWidgets from openlp.core.common.i18n import translate from openlp.core.common.registry import Registry from openlp.plugins.alerts.lib.db import AlertItem + from .alertdialog import Ui_AlertDialog diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index 1b507e97f..79875c8dd 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -25,15 +25,16 @@ import logging from openlp.core.api.http import register_endpoint 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.core.ui.icons import UiIcons 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 import BibleManager, BibleMediaItem, BiblesTab, DisplayStyle, LanguageSelection, \ + LayoutStyle from openlp.plugins.bibles.lib.mediaitem import BibleSearch + log = logging.getLogger(__name__) diff --git a/openlp/plugins/bibles/endpoint.py b/openlp/plugins/bibles/endpoint.py index b3177b146..d1059df22 100644 --- a/openlp/plugins/bibles/endpoint.py +++ b/openlp/plugins/bibles/endpoint.py @@ -21,11 +21,12 @@ ############################################################################### import logging -from openlp.core.api.endpoint.pluginhelpers import search, live, service +from openlp.core.api.endpoint.pluginhelpers import live, search, service from openlp.core.api.http import requires_auth from openlp.core.api.http.endpoint import Endpoint from openlp.core.api.http.errors import NotFound + log = logging.getLogger(__name__) bibles_endpoint = Endpoint('bibles') diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 6b9744386..9905aca56 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -25,18 +25,12 @@ The bible import functions for OpenLP import logging import urllib.error -from PyQt5 import QtWidgets from lxml import etree - -try: - from pysword import modules - PYSWORD_AVAILABLE = True -except: - PYSWORD_AVAILABLE = False +from PyQt5 import QtWidgets from openlp.core.common import trace_error_handler from openlp.core.common.applocation import AppLocation -from openlp.core.common.i18n import UiStrings, translate, get_locale_key +from openlp.core.common.i18n import UiStrings, get_locale_key, translate from openlp.core.common.settings import Settings from openlp.core.lib.db import delete_database from openlp.core.lib.exceptions import ValidationError @@ -44,9 +38,17 @@ from openlp.core.lib.ui import critical_error_message_box from openlp.core.widgets.edits import PathEdit from openlp.core.widgets.wizard import OpenLPWizard, WizardStrings from openlp.plugins.bibles.lib.db import clean_filename -from openlp.plugins.bibles.lib.importers.http import CWExtract, BGExtract, BSExtract +from openlp.plugins.bibles.lib.importers.http import BGExtract, BSExtract, CWExtract from openlp.plugins.bibles.lib.manager import BibleFormat + +try: + from pysword import modules + PYSWORD_AVAILABLE = True +except: + PYSWORD_AVAILABLE = False + + log = logging.getLogger(__name__) diff --git a/openlp/plugins/bibles/forms/booknameform.py b/openlp/plugins/bibles/forms/booknameform.py index b8499c1d5..5dfac1a8e 100644 --- a/openlp/plugins/bibles/forms/booknameform.py +++ b/openlp/plugins/bibles/forms/booknameform.py @@ -35,6 +35,7 @@ from openlp.plugins.bibles.forms.booknamedialog import Ui_BookNameDialog from openlp.plugins.bibles.lib import BibleStrings from openlp.plugins.bibles.lib.db import BiblesResourcesDB + log = logging.getLogger(__name__) diff --git a/openlp/plugins/bibles/forms/editbibledialog.py b/openlp/plugins/bibles/forms/editbibledialog.py index caa28a85c..ee7519116 100644 --- a/openlp/plugins/bibles/forms/editbibledialog.py +++ b/openlp/plugins/bibles/forms/editbibledialog.py @@ -24,9 +24,9 @@ from PyQt5 import QtCore, QtWidgets from openlp.core.common.i18n import translate from openlp.core.lib.ui import create_button_box -from openlp.plugins.bibles.lib import LanguageSelection, BibleStrings -from openlp.plugins.bibles.lib.db import BiblesResourcesDB from openlp.core.ui.icons import UiIcons +from openlp.plugins.bibles.lib import BibleStrings, LanguageSelection +from openlp.plugins.bibles.lib.db import BiblesResourcesDB class Ui_EditBibleDialog(object): diff --git a/openlp/plugins/bibles/forms/editbibleform.py b/openlp/plugins/bibles/forms/editbibleform.py index f59e55153..f8f74cb14 100644 --- a/openlp/plugins/bibles/forms/editbibleform.py +++ b/openlp/plugins/bibles/forms/editbibleform.py @@ -30,8 +30,10 @@ from openlp.core.common.mixins import RegistryProperties from openlp.core.lib.ui import critical_error_message_box from openlp.plugins.bibles.lib import BibleStrings from openlp.plugins.bibles.lib.db import BiblesResourcesDB + from .editbibledialog import Ui_EditBibleDialog + log = logging.getLogger(__name__) diff --git a/openlp/plugins/bibles/forms/languageform.py b/openlp/plugins/bibles/forms/languageform.py index b80bbf854..90c598569 100644 --- a/openlp/plugins/bibles/forms/languageform.py +++ b/openlp/plugins/bibles/forms/languageform.py @@ -32,6 +32,7 @@ from openlp.core.common.i18n import LANGUAGES, translate from openlp.core.lib.ui import critical_error_message_box from openlp.plugins.bibles.forms.languagedialog import Ui_LanguageDialog + log = logging.getLogger(__name__) diff --git a/openlp/plugins/bibles/lib/biblestab.py b/openlp/plugins/bibles/lib/biblestab.py index f20340c72..f60283114 100644 --- a/openlp/plugins/bibles/lib/biblestab.py +++ b/openlp/plugins/bibles/lib/biblestab.py @@ -29,8 +29,9 @@ from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings from openlp.core.lib.settingstab import SettingsTab from openlp.core.lib.ui import find_and_set_in_combo_box -from openlp.plugins.bibles.lib import LayoutStyle, DisplayStyle, update_reference_separators, \ - get_reference_separator, LanguageSelection +from openlp.plugins.bibles.lib import DisplayStyle, LanguageSelection, LayoutStyle, get_reference_separator, \ + update_reference_separators + log = logging.getLogger(__name__) diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index 040115d56..89286387e 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -20,14 +20,14 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -import chardet import logging import re import sqlite3 import time +import chardet from PyQt5 import QtCore -from sqlalchemy import Column, ForeignKey, Table, or_, types, func +from sqlalchemy import Column, ForeignKey, Table, func, or_, types from sqlalchemy.exc import OperationalError from sqlalchemy.orm import class_mapper, mapper, relation from sqlalchemy.orm.exc import UnmappedClassError @@ -36,10 +36,11 @@ from openlp.core.common import clean_filename from openlp.core.common.applocation import AppLocation from openlp.core.common.i18n import translate from openlp.core.common.path import Path -from openlp.core.lib.db import BaseModel, init_db, Manager +from openlp.core.lib.db import BaseModel, Manager, init_db from openlp.core.lib.ui import critical_error_message_box from openlp.plugins.bibles.lib import BibleStrings, LanguageSelection, upgrade + log = logging.getLogger(__name__) RESERVED_CHARACTERS = '\\.^$*+?{}[]()' diff --git a/openlp/plugins/bibles/lib/importers/csvbible.py b/openlp/plugins/bibles/lib/importers/csvbible.py index 29d22ff7d..2edfc14e8 100644 --- a/openlp/plugins/bibles/lib/importers/csvbible.py +++ b/openlp/plugins/bibles/lib/importers/csvbible.py @@ -58,6 +58,7 @@ from openlp.core.common.path import Path from openlp.core.lib.exceptions import ValidationError from openlp.plugins.bibles.lib.bibleimport import BibleImport + Book = namedtuple('Book', 'id, testament_id, name, abbreviation') Verse = namedtuple('Verse', 'book_id_name, chapter_number, number, text') diff --git a/openlp/plugins/bibles/lib/importers/http.py b/openlp/plugins/bibles/lib/importers/http.py index 4eee26256..f63cdd4e6 100644 --- a/openlp/plugins/bibles/lib/importers/http.py +++ b/openlp/plugins/bibles/lib/importers/http.py @@ -39,6 +39,7 @@ from openlp.plugins.bibles.lib import SearchResults from openlp.plugins.bibles.lib.bibleimport import BibleImport from openlp.plugins.bibles.lib.db import BibleDB, BiblesResourcesDB, Book + CLEANER_REGEX = re.compile(r' |
|\'\+\'') FIX_PUNKCTUATION_REGEX = re.compile(r'[ ]+([.,;])') REDUCE_SPACES_REGEX = re.compile(r'[ ]{2,}') diff --git a/openlp/plugins/bibles/lib/importers/osis.py b/openlp/plugins/bibles/lib/importers/osis.py index b18a1bea3..304dfbd8e 100644 --- a/openlp/plugins/bibles/lib/importers/osis.py +++ b/openlp/plugins/bibles/lib/importers/osis.py @@ -24,6 +24,7 @@ from lxml import etree from openlp.plugins.bibles.lib.bibleimport import BibleImport + NS = {'ns': 'http://www.bibletechnologies.net/2003/OSIS/namespace'} # Tags we don't use and can remove the content REMOVABLE_ELEMENTS = ( diff --git a/openlp/plugins/bibles/lib/importers/sword.py b/openlp/plugins/bibles/lib/importers/sword.py index 08ffaaccc..837daed2b 100644 --- a/openlp/plugins/bibles/lib/importers/sword.py +++ b/openlp/plugins/bibles/lib/importers/sword.py @@ -29,6 +29,7 @@ from openlp.core.lib.ui import critical_error_message_box from openlp.plugins.bibles.lib.bibleimport import BibleImport from openlp.plugins.bibles.lib.db import BiblesResourcesDB + log = logging.getLogger(__name__) diff --git a/openlp/plugins/bibles/lib/importers/wordproject.py b/openlp/plugins/bibles/lib/importers/wordproject.py index 95a957c80..c4110b4f9 100644 --- a/openlp/plugins/bibles/lib/importers/wordproject.py +++ b/openlp/plugins/bibles/lib/importers/wordproject.py @@ -24,11 +24,12 @@ import re from tempfile import TemporaryDirectory from zipfile import ZipFile -from bs4 import BeautifulSoup, Tag, NavigableString +from bs4 import BeautifulSoup, NavigableString, Tag from openlp.core.common.path import Path from openlp.plugins.bibles.lib.bibleimport import BibleImport + BOOK_NUMBER_PATTERN = re.compile(r'\[(\d+)\]') REPLACE_SPACES = re.compile(r'\s{2,}') diff --git a/openlp/plugins/bibles/lib/importers/zefania.py b/openlp/plugins/bibles/lib/importers/zefania.py index e8904d56c..61c8cf6e8 100644 --- a/openlp/plugins/bibles/lib/importers/zefania.py +++ b/openlp/plugins/bibles/lib/importers/zefania.py @@ -27,6 +27,7 @@ from openlp.core.lib.ui import critical_error_message_box from openlp.plugins.bibles.lib.bibleimport import BibleImport from openlp.plugins.bibles.lib.db import BiblesResourcesDB + log = logging.getLogger(__name__) # Tags we don't use and can remove the content diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index 1e1b4243d..55664a8ff 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -29,6 +29,7 @@ from openlp.core.common.path import Path from openlp.core.common.settings import Settings from openlp.plugins.bibles.lib import LanguageSelection, parse_reference from openlp.plugins.bibles.lib.db import BibleDB, BibleMeta + from .importers.csvbible import CSVBible from .importers.http import HTTPBible from .importers.opensong import OpenSongBible @@ -36,6 +37,7 @@ from .importers.osis import OSISBible from .importers.wordproject import WordProjectBible from .importers.zefania import ZefaniaBible + try: from .importers.sword import SwordBible except: diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 3a9eb1635..9f229dd7f 100755 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -26,20 +26,21 @@ from enum import IntEnum, unique from PyQt5 import QtCore, QtWidgets -from openlp.core.common.i18n import UiStrings, translate, get_locale_key +from openlp.core.common.i18n import UiStrings, get_locale_key, translate from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings from openlp.core.lib import ServiceItemContext from openlp.core.lib.mediamanageritem import MediaManagerItem from openlp.core.lib.serviceitem import ItemCapabilities -from openlp.core.lib.ui import set_case_insensitive_completer, create_horizontal_adjusting_combo_box, \ - critical_error_message_box, find_and_set_in_combo_box +from openlp.core.lib.ui import create_horizontal_adjusting_combo_box, critical_error_message_box, \ + find_and_set_in_combo_box, set_case_insensitive_completer from openlp.core.ui.icons import UiIcons 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, VerseReferenceList, get_reference_match, \ + get_reference_separator + log = logging.getLogger(__name__) diff --git a/openlp/plugins/bibles/lib/upgrade.py b/openlp/plugins/bibles/lib/upgrade.py index c53f9d324..b0d23069b 100644 --- a/openlp/plugins/bibles/lib/upgrade.py +++ b/openlp/plugins/bibles/lib/upgrade.py @@ -24,6 +24,7 @@ The :mod:`upgrade` module provides a way for the database and schema that is the """ import logging + log = logging.getLogger(__name__) __version__ = 1 diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index 194553bfd..0fd87ac26 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -28,15 +28,16 @@ import logging from openlp.core.api.http import register_endpoint from openlp.core.common.i18n import 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.db import Manager +from openlp.core.lib.plugin import Plugin, StringContent +from openlp.core.ui.icons import UiIcons 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 + log = logging.getLogger(__name__) __default_settings__ = { diff --git a/openlp/plugins/custom/endpoint.py b/openlp/plugins/custom/endpoint.py index eb07683c8..b42e3b4f3 100644 --- a/openlp/plugins/custom/endpoint.py +++ b/openlp/plugins/custom/endpoint.py @@ -21,11 +21,12 @@ ############################################################################### import logging -from openlp.core.api.endpoint.pluginhelpers import search, live, service +from openlp.core.api.endpoint.pluginhelpers import live, search, service from openlp.core.api.http import requires_auth from openlp.core.api.http.endpoint import Endpoint from openlp.core.api.http.errors import NotFound + log = logging.getLogger(__name__) custom_endpoint = Endpoint('custom') diff --git a/openlp/plugins/custom/forms/editcustomdialog.py b/openlp/plugins/custom/forms/editcustomdialog.py index fbcfdb746..6ce6bf456 100644 --- a/openlp/plugins/custom/forms/editcustomdialog.py +++ b/openlp/plugins/custom/forms/editcustomdialog.py @@ -22,7 +22,7 @@ from PyQt5 import QtWidgets from openlp.core.common.i18n import UiStrings, translate -from openlp.core.lib.ui import create_button_box, create_button +from openlp.core.lib.ui import create_button, create_button_box from openlp.core.ui.icons import UiIcons diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index d3be07f91..8209660cc 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -29,9 +29,11 @@ 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.lib.db import CustomSlide + from .editcustomdialog import Ui_CustomEditDialog from .editcustomslideform import EditCustomSlideForm + log = logging.getLogger(__name__) diff --git a/openlp/plugins/custom/forms/editcustomslideform.py b/openlp/plugins/custom/forms/editcustomslideform.py index eb0b14364..012a38d94 100644 --- a/openlp/plugins/custom/forms/editcustomslideform.py +++ b/openlp/plugins/custom/forms/editcustomslideform.py @@ -26,6 +26,7 @@ from PyQt5 import QtCore, QtWidgets from .editcustomslidedialog import Ui_CustomSlideEditDialog + log = logging.getLogger(__name__) diff --git a/openlp/plugins/custom/lib/customxmlhandler.py b/openlp/plugins/custom/lib/customxmlhandler.py index 399d31def..77b1e36f7 100644 --- a/openlp/plugins/custom/lib/customxmlhandler.py +++ b/openlp/plugins/custom/lib/customxmlhandler.py @@ -41,6 +41,7 @@ from xml.etree.ElementTree import dump from lxml import etree, objectify + log = logging.getLogger(__name__) diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index 9f46e62cd..956601ee3 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -23,21 +23,22 @@ import logging from PyQt5 import QtCore, QtWidgets -from sqlalchemy.sql import or_, func, and_ +from sqlalchemy.sql import and_, func, or_ from openlp.core.common.i18n import UiStrings, translate from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings from openlp.core.lib import ServiceItemContext, check_item_selected from openlp.core.lib.mediamanageritem import MediaManagerItem -from openlp.core.lib.serviceitem import ItemCapabilities from openlp.core.lib.plugin import PluginStatus +from openlp.core.lib.serviceitem import ItemCapabilities 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 import CustomXMLBuilder, CustomXMLParser from openlp.plugins.custom.lib.db import CustomSlide + log = logging.getLogger(__name__) diff --git a/openlp/plugins/images/endpoint.py b/openlp/plugins/images/endpoint.py index 710cc07a8..a2ec967b0 100644 --- a/openlp/plugins/images/endpoint.py +++ b/openlp/plugins/images/endpoint.py @@ -21,11 +21,12 @@ ############################################################################### import logging -from openlp.core.api.endpoint.pluginhelpers import search, live, service, display_thumbnails +from openlp.core.api.endpoint.pluginhelpers import display_thumbnails, live, search, service from openlp.core.api.http import requires_auth from openlp.core.api.http.endpoint import Endpoint from openlp.core.api.http.errors import NotFound + log = logging.getLogger(__name__) images_endpoint = Endpoint('images') diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index cb6f91741..00a0ba98f 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -26,15 +26,16 @@ from PyQt5 import QtGui from openlp.core.api.http import register_endpoint from openlp.core.common.i18n import translate -from openlp.core.ui.icons import UiIcons from openlp.core.common.settings import Settings from openlp.core.lib import ImageSource, build_icon -from openlp.core.lib.plugin import Plugin, StringContent from openlp.core.lib.db import Manager +from openlp.core.lib.plugin import Plugin, StringContent +from openlp.core.ui.icons import UiIcons 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.db import init_schema + log = logging.getLogger(__name__) __default_settings__ = { diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 3c064a8ca..7634f30e1 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -26,21 +26,21 @@ from PyQt5 import QtCore, QtGui, QtWidgets from openlp.core.common import delete_file, get_images_filter from openlp.core.common.applocation import AppLocation -from openlp.core.common.i18n import UiStrings, translate, get_natural_key +from openlp.core.common.i18n import UiStrings, get_natural_key, translate from openlp.core.common.path import Path, create_paths from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings -from openlp.core.lib import ServiceItemContext, build_icon, check_item_selected, \ - create_thumb, validate_thumb +from openlp.core.lib import ServiceItemContext, build_icon, check_item_selected, create_thumb, validate_thumb from openlp.core.lib.mediamanageritem import MediaManagerItem -from openlp.core.lib.serviceitem import ItemCapabilities from openlp.core.lib.plugin import StringContent +from openlp.core.lib.serviceitem import ItemCapabilities 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.lib.db import ImageFilenames, ImageGroups + log = logging.getLogger(__name__) diff --git a/openlp/plugins/images/lib/upgrade.py b/openlp/plugins/images/lib/upgrade.py index b2452db89..6f0090cae 100644 --- a/openlp/plugins/images/lib/upgrade.py +++ b/openlp/plugins/images/lib/upgrade.py @@ -33,6 +33,7 @@ from openlp.core.common.json import OpenLPJsonEncoder from openlp.core.common.path import Path from openlp.core.lib.db import PathType, get_upgrade_op + log = logging.getLogger(__name__) __version__ = 2 diff --git a/openlp/plugins/media/endpoint.py b/openlp/plugins/media/endpoint.py index 443401b7a..51d011c42 100644 --- a/openlp/plugins/media/endpoint.py +++ b/openlp/plugins/media/endpoint.py @@ -21,11 +21,12 @@ ############################################################################### import logging -from openlp.core.api.endpoint.pluginhelpers import search, live, service +from openlp.core.api.endpoint.pluginhelpers import live, search, service from openlp.core.api.http import requires_auth from openlp.core.api.http.endpoint import Endpoint from openlp.core.api.http.errors import NotFound + log = logging.getLogger(__name__) media_endpoint = Endpoint('media') diff --git a/openlp/plugins/media/forms/mediaclipselectorform.py b/openlp/plugins/media/forms/mediaclipselectorform.py index b2a2a5afd..870fa39f6 100644 --- a/openlp/plugins/media/forms/mediaclipselectorform.py +++ b/openlp/plugins/media/forms/mediaclipselectorform.py @@ -27,7 +27,7 @@ from time import sleep from PyQt5 import QtCore, QtWidgets -from openlp.core.common import is_win, is_linux, is_macosx +from openlp.core.common import is_linux, is_macosx, is_win from openlp.core.common.i18n import translate from openlp.core.common.mixins import RegistryProperties from openlp.core.common.path import Path @@ -36,6 +36,7 @@ from openlp.core.ui.icons import UiIcons from openlp.core.ui.media.vlcplayer import get_vlc from openlp.plugins.media.forms.mediaclipselectordialog import Ui_MediaClipSelector + if is_win(): from win32com.client import Dispatch diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index e1eb0b026..bcc071480 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -26,20 +26,21 @@ import os from PyQt5 import QtCore, QtWidgets from openlp.core.common.applocation import AppLocation -from openlp.core.common.i18n import UiStrings, translate, get_natural_key +from openlp.core.common.i18n import UiStrings, get_natural_key, translate from openlp.core.common.mixins import RegistryProperties -from openlp.core.common.path import Path, path_to_str, create_paths +from openlp.core.common.path import Path, create_paths, path_to_str from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings from openlp.core.lib import MediaType, ServiceItemContext, check_item_selected from openlp.core.lib.mediamanageritem import MediaManagerItem from openlp.core.lib.serviceitem import ItemCapabilities, ServiceItem -from openlp.core.lib.ui import create_widget_action, critical_error_message_box, create_horizontal_adjusting_combo_box +from openlp.core.lib.ui import create_horizontal_adjusting_combo_box, create_widget_action, critical_error_message_box from openlp.core.ui import DisplayControllerType from openlp.core.ui.icons import UiIcons -from openlp.core.ui.media import get_media_players, set_media_players, parse_optical_path, format_milliseconds +from openlp.core.ui.media import format_milliseconds, get_media_players, parse_optical_path, set_media_players from openlp.core.ui.media.vlcplayer import get_vlc + if get_vlc() is not None: from openlp.plugins.media.forms.mediaclipselectorform import MediaClipSelectorForm diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 1b3130705..70e68dffd 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -31,13 +31,14 @@ from openlp.core.api.http import register_endpoint from openlp.core.common import check_binary_exists from openlp.core.common.applocation import AppLocation from openlp.core.common.i18n import translate -from openlp.core.ui.icons import UiIcons from openlp.core.common.path import Path from openlp.core.lib import build_icon from openlp.core.lib.plugin import Plugin, StringContent +from openlp.core.ui.icons import UiIcons from openlp.plugins.media.endpoint import api_media_endpoint, media_endpoint from openlp.plugins.media.lib import MediaMediaItem, MediaTab + log = logging.getLogger(__name__) diff --git a/openlp/plugins/presentations/endpoint.py b/openlp/plugins/presentations/endpoint.py index b5839283b..55109358d 100644 --- a/openlp/plugins/presentations/endpoint.py +++ b/openlp/plugins/presentations/endpoint.py @@ -21,11 +21,12 @@ ############################################################################### import logging -from openlp.core.api.endpoint.pluginhelpers import search, live, service, display_thumbnails +from openlp.core.api.endpoint.pluginhelpers import display_thumbnails, live, search, service from openlp.core.api.http import requires_auth from openlp.core.api.http.endpoint import Endpoint from openlp.core.api.http.errors import NotFound + log = logging.getLogger(__name__) presentations_endpoint = Endpoint('presentations') diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index 6bd05e2b1..c9aaa9661 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -42,6 +42,7 @@ from openlp.core.display.screens import ScreenList from openlp.plugins.presentations.lib.presentationcontroller import PresentationController, PresentationDocument, \ TextType + if is_win(): from win32com.client import Dispatch import pywintypes diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index d0c4d46b3..0d5997ff3 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -23,19 +23,19 @@ import logging from PyQt5 import QtCore, QtGui, QtWidgets -from openlp.core.common.i18n import UiStrings, translate, get_natural_key +from openlp.core.common.i18n import UiStrings, get_natural_key, translate from openlp.core.common.path import path_to_str, str_to_path from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings -from openlp.core.lib import ServiceItemContext, build_icon, check_item_selected, \ - create_thumb, validate_thumb +from openlp.core.lib import ServiceItemContext, build_icon, check_item_selected, create_thumb, validate_thumb from openlp.core.lib.mediamanageritem import MediaManagerItem 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.lib.ui import create_horizontal_adjusting_combo_box, critical_error_message_box from openlp.core.ui.icons import UiIcons from openlp.plugins.presentations.lib import MessageListener from openlp.plugins.presentations.lib.pdfcontroller import PDF_CONTROLLER_FILETYPES + log = logging.getLogger(__name__) diff --git a/openlp/plugins/presentations/lib/messagelistener.py b/openlp/plugins/presentations/lib/messagelistener.py index 675233807..34bcee577 100644 --- a/openlp/plugins/presentations/lib/messagelistener.py +++ b/openlp/plugins/presentations/lib/messagelistener.py @@ -31,6 +31,7 @@ from openlp.core.lib import ServiceItemContext from openlp.core.ui import HideMode from openlp.plugins.presentations.lib.pdfcontroller import PDF_CONTROLLER_FILETYPES + log = logging.getLogger(__name__) diff --git a/openlp/plugins/presentations/lib/pdfcontroller.py b/openlp/plugins/presentations/lib/pdfcontroller.py index b4cd68a0a..552e57575 100644 --- a/openlp/plugins/presentations/lib/pdfcontroller.py +++ b/openlp/plugins/presentations/lib/pdfcontroller.py @@ -21,7 +21,7 @@ ############################################################################### import logging import re -from subprocess import check_output, CalledProcessError +from subprocess import CalledProcessError, check_output from openlp.core.common import check_binary_exists, is_win from openlp.core.common.applocation import AppLocation @@ -30,6 +30,7 @@ from openlp.core.common.settings import Settings from openlp.core.display.screens import ScreenList from openlp.plugins.presentations.lib.presentationcontroller import PresentationController, PresentationDocument + if is_win(): from subprocess import STARTUPINFO, STARTF_USESHOWWINDOW diff --git a/openlp/plugins/presentations/lib/powerpointcontroller.py b/openlp/plugins/presentations/lib/powerpointcontroller.py index 582afa69f..d53a9a325 100644 --- a/openlp/plugins/presentations/lib/powerpointcontroller.py +++ b/openlp/plugins/presentations/lib/powerpointcontroller.py @@ -35,6 +35,7 @@ from openlp.core.display.screens import ScreenList from openlp.core.lib.ui import critical_error_message_box, translate from openlp.plugins.presentations.lib.presentationcontroller import PresentationController, PresentationDocument + if is_win(): from win32com.client import Dispatch import win32con diff --git a/openlp/plugins/presentations/lib/presentationcontroller.py b/openlp/plugins/presentations/lib/presentationcontroller.py index a7b9a7d7d..5933b053f 100644 --- a/openlp/plugins/presentations/lib/presentationcontroller.py +++ b/openlp/plugins/presentations/lib/presentationcontroller.py @@ -30,6 +30,7 @@ from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings from openlp.core.lib import create_thumb, validate_thumb + log = logging.getLogger(__name__) diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index c64df5cde..0fb347687 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -31,13 +31,14 @@ from PyQt5 import QtCore from openlp.core.api.http import register_endpoint from openlp.core.common import extension_loader from openlp.core.common.i18n import translate -from openlp.core.ui.icons import UiIcons from openlp.core.common.settings import Settings from openlp.core.lib import build_icon from openlp.core.lib.plugin import Plugin, StringContent +from openlp.core.ui.icons import UiIcons from openlp.plugins.presentations.endpoint import api_presentations_endpoint, presentations_endpoint from openlp.plugins.presentations.lib import PresentationController, PresentationMediaItem, PresentationTab + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/endpoint.py b/openlp/plugins/songs/endpoint.py index c56c78826..78379b7b6 100644 --- a/openlp/plugins/songs/endpoint.py +++ b/openlp/plugins/songs/endpoint.py @@ -21,11 +21,12 @@ ############################################################################### import logging -from openlp.core.api.endpoint.pluginhelpers import search, live, service +from openlp.core.api.endpoint.pluginhelpers import live, search, service from openlp.core.api.http import requires_auth from openlp.core.api.http.endpoint import Endpoint from openlp.core.api.http.errors import NotFound + log = logging.getLogger(__name__) songs_endpoint = Endpoint('songs') diff --git a/openlp/plugins/songs/forms/duplicatesongremovalform.py b/openlp/plugins/songs/forms/duplicatesongremovalform.py index 7ed37ad2d..1ec722048 100644 --- a/openlp/plugins/songs/forms/duplicatesongremovalform.py +++ b/openlp/plugins/songs/forms/duplicatesongremovalform.py @@ -37,6 +37,7 @@ from openlp.plugins.songs.lib import delete_song from openlp.plugins.songs.lib.db import Song from openlp.plugins.songs.lib.songcompare import songs_probably_equal + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/forms/editsongdialog.py b/openlp/plugins/songs/forms/editsongdialog.py index 5eb83bce4..120edc379 100644 --- a/openlp/plugins/songs/forms/editsongdialog.py +++ b/openlp/plugins/songs/forms/editsongdialog.py @@ -23,7 +23,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets from openlp.core.common.i18n import UiStrings, translate -from openlp.core.lib.ui import create_button_box, create_button +from openlp.core.lib.ui import create_button, create_button_box from openlp.core.ui import SingleColumnTableWidget from openlp.core.ui.icons import UiIcons from openlp.plugins.songs.lib.ui import SongStrings diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 6e25fd032..fe8815e96 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -29,22 +29,23 @@ import re from PyQt5 import QtCore, QtWidgets from openlp.core.common.applocation import AppLocation -from openlp.core.common.i18n import UiStrings, translate, get_natural_key +from openlp.core.common.i18n import UiStrings, get_natural_key, translate from openlp.core.common.mixins import RegistryProperties -from openlp.core.common.path import create_paths, copyfile +from openlp.core.common.path import copyfile, create_paths from openlp.core.common.registry import Registry from openlp.core.lib import MediaType, create_separated_list from openlp.core.lib.plugin import PluginStatus -from openlp.core.lib.ui import set_case_insensitive_completer, critical_error_message_box, find_and_set_in_combo_box +from openlp.core.lib.ui import critical_error_message_box, find_and_set_in_combo_box, set_case_insensitive_completer from openlp.core.widgets.dialogs import FileDialog from openlp.plugins.songs.forms.editsongdialog import Ui_EditSongDialog from openlp.plugins.songs.forms.editverseform import EditVerseForm from openlp.plugins.songs.forms.mediafilesform import MediaFilesForm from openlp.plugins.songs.lib import VerseType, clean_song -from openlp.plugins.songs.lib.db import Book, Song, Author, AuthorType, Topic, MediaFile, SongBookEntry +from openlp.plugins.songs.lib.db import Author, AuthorType, Book, MediaFile, Song, SongBookEntry, Topic from openlp.plugins.songs.lib.openlyricsxml import SongXML from openlp.plugins.songs.lib.ui import SongStrings + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index dcf9d7d63..f2c721d0e 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -31,6 +31,7 @@ from openlp.core.lib.ui import critical_error_message_box from openlp.plugins.songs.forms.editversedialog import Ui_EditVerseDialog from openlp.plugins.songs.lib import VerseType, transpose_lyrics + log = logging.getLogger(__name__) VERSE_REGEX = re.compile(r'---\[(.+):\D*(\d*)\D*.*\]---') diff --git a/openlp/plugins/songs/forms/mediafilesform.py b/openlp/plugins/songs/forms/mediafilesform.py index e6644f4db..4657d703b 100644 --- a/openlp/plugins/songs/forms/mediafilesform.py +++ b/openlp/plugins/songs/forms/mediafilesform.py @@ -26,6 +26,7 @@ from PyQt5 import QtCore, QtWidgets from .mediafilesdialog import Ui_MediaFilesDialog + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index ee948b7ee..4e701a354 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -38,6 +38,7 @@ from openlp.core.widgets.wizard import OpenLPWizard, WizardStrings from openlp.plugins.songs.lib.db import Song from openlp.plugins.songs.lib.openlyricsexport import OpenLyricsExport + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index a235996ab..f5a472f67 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -36,6 +36,7 @@ from openlp.core.widgets.enums import PathEditType from openlp.core.widgets.wizard import OpenLPWizard, WizardStrings from openlp.plugins.songs.lib.importer import SongFormat, SongFormatSelect + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index 69e22353d..02b9cbc84 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -24,16 +24,18 @@ import logging from PyQt5 import QtCore, QtWidgets from sqlalchemy.sql import and_ -from openlp.core.common.i18n import UiStrings, translate, get_natural_key +from openlp.core.common.i18n import UiStrings, get_natural_key, translate from openlp.core.common.mixins import RegistryProperties from openlp.core.common.registry import Registry from openlp.core.lib.ui import critical_error_message_box from openlp.plugins.songs.forms.authorsform import AuthorsForm from openlp.plugins.songs.forms.songbookform import SongBookForm from openlp.plugins.songs.forms.topicsform import TopicsForm -from openlp.plugins.songs.lib.db import Author, Book, Topic, Song +from openlp.plugins.songs.lib.db import Author, Book, Song, Topic + from .songmaintenancedialog import Ui_SongMaintenanceDialog + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/forms/songselectform.py b/openlp/plugins/songs/forms/songselectform.py index 4c37bf390..0e10b0b95 100644 --- a/openlp/plugins/songs/forms/songselectform.py +++ b/openlp/plugins/songs/forms/songselectform.py @@ -34,6 +34,7 @@ from openlp.core.threading import ThreadWorker, run_thread from openlp.plugins.songs.forms.songselectdialog import Ui_SongSelectDialog from openlp.plugins.songs.lib.songselect import SongSelectImport + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/db.py b/openlp/plugins/songs/lib/db.py index fef160010..724f7c029 100644 --- a/openlp/plugins/songs/lib/db.py +++ b/openlp/plugins/songs/lib/db.py @@ -24,10 +24,10 @@ The :mod:`db` module provides the database and schema that is the backend for the Songs plugin """ from sqlalchemy import Column, ForeignKey, Table, types -from sqlalchemy.orm import mapper, relation, reconstructor +from sqlalchemy.orm import mapper, reconstructor, relation from sqlalchemy.sql.expression import func, text -from openlp.core.common.i18n import translate, get_natural_key +from openlp.core.common.i18n import get_natural_key, translate from openlp.core.lib.db import BaseModel, PathType, init_db diff --git a/openlp/plugins/songs/lib/importer.py b/openlp/plugins/songs/lib/importer.py index 43628a87b..d42a9873f 100644 --- a/openlp/plugins/songs/lib/importer.py +++ b/openlp/plugins/songs/lib/importer.py @@ -27,6 +27,7 @@ import logging from openlp.core.common import is_win from openlp.core.common.i18n import UiStrings, translate from openlp.core.widgets.wizard import WizardStrings + from .importers.cclifile import CCLIFileImport from .importers.chordpro import ChordProImport from .importers.dreambeam import DreamBeamImport @@ -50,6 +51,7 @@ from .importers.wordsofworship import WordsOfWorshipImport from .importers.worshipassistant import WorshipAssistantImport from .importers.zionworx import ZionWorxImport + log = logging.getLogger(__name__) # Imports that might fail diff --git a/openlp/plugins/songs/lib/importers/cclifile.py b/openlp/plugins/songs/lib/importers/cclifile.py index 1389918c1..5c390d6ac 100644 --- a/openlp/plugins/songs/lib/importers/cclifile.py +++ b/openlp/plugins/songs/lib/importers/cclifile.py @@ -26,8 +26,10 @@ import chardet from openlp.core.common.i18n import translate from openlp.plugins.songs.lib import VerseType + from .songimport import SongImport + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/importers/chordpro.py b/openlp/plugins/songs/lib/importers/chordpro.py index 0d4c4d4f2..a50f2bb5b 100644 --- a/openlp/plugins/songs/lib/importers/chordpro.py +++ b/openlp/plugins/songs/lib/importers/chordpro.py @@ -29,6 +29,7 @@ import re from openlp.core.common.settings import Settings from openlp.plugins.songs.lib.importers.songimport import SongImport + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/importers/dreambeam.py b/openlp/plugins/songs/lib/importers/dreambeam.py index 71e233eed..3e3960087 100644 --- a/openlp/plugins/songs/lib/importers/dreambeam.py +++ b/openlp/plugins/songs/lib/importers/dreambeam.py @@ -30,6 +30,7 @@ from openlp.core.common.i18n import translate from openlp.plugins.songs.lib.importers.songimport import SongImport from openlp.plugins.songs.lib.ui import SongStrings + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/importers/easyslides.py b/openlp/plugins/songs/lib/importers/easyslides.py index 4a6fc5bf8..169cd32f7 100644 --- a/openlp/plugins/songs/lib/importers/easyslides.py +++ b/openlp/plugins/songs/lib/importers/easyslides.py @@ -29,6 +29,7 @@ from openlp.core.common import normalize_str from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib.importers.songimport import SongImport + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/importers/easyworship.py b/openlp/plugins/songs/lib/importers/easyworship.py index b2c216de2..fe3f39fca 100644 --- a/openlp/plugins/songs/lib/importers/easyworship.py +++ b/openlp/plugins/songs/lib/importers/easyworship.py @@ -31,10 +31,11 @@ import zlib from openlp.core.common.i18n import translate from openlp.core.common.path import Path -from openlp.plugins.songs.lib import VerseType -from openlp.plugins.songs.lib import retrieve_windows_encoding, strip_rtf +from openlp.plugins.songs.lib import VerseType, retrieve_windows_encoding, strip_rtf + from .songimport import SongImport + # regex: at least two newlines, can have spaces between them SLIDE_BREAK_REGEX = re.compile(r'\n *?\n[\n ]*') NUMBER_REGEX = re.compile(r'[0-9]+') diff --git a/openlp/plugins/songs/lib/importers/foilpresenter.py b/openlp/plugins/songs/lib/importers/foilpresenter.py index 5458b1fad..a58a787c3 100644 --- a/openlp/plugins/songs/lib/importers/foilpresenter.py +++ b/openlp/plugins/songs/lib/importers/foilpresenter.py @@ -89,12 +89,13 @@ from lxml import etree, objectify from openlp.core.common.i18n import translate from openlp.core.widgets.wizard import WizardStrings -from openlp.plugins.songs.lib import clean_song, VerseType +from openlp.plugins.songs.lib import VerseType, clean_song from openlp.plugins.songs.lib.db import Author, Book, Song, Topic from openlp.plugins.songs.lib.importers.songimport import SongImport from openlp.plugins.songs.lib.openlyricsxml import SongXML from openlp.plugins.songs.lib.ui import SongStrings + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/importers/lyrix.py b/openlp/plugins/songs/lib/importers/lyrix.py index e987b2502..92700718e 100644 --- a/openlp/plugins/songs/lib/importers/lyrix.py +++ b/openlp/plugins/songs/lib/importers/lyrix.py @@ -29,6 +29,7 @@ import re from openlp.core.common.i18n import translate from openlp.plugins.songs.lib.importers.songimport import SongImport + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/importers/mediashout.py b/openlp/plugins/songs/lib/importers/mediashout.py index 5ecd53bd3..779b72342 100644 --- a/openlp/plugins/songs/lib/importers/mediashout.py +++ b/openlp/plugins/songs/lib/importers/mediashout.py @@ -34,6 +34,7 @@ import pyodbc from openlp.core.common.i18n import translate from openlp.plugins.songs.lib.importers.songimport import SongImport + VERSE_TAGS = ['V', 'C', 'B', 'O', 'P', 'I', 'E'] log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/importers/openlp.py b/openlp/plugins/songs/lib/importers/openlp.py index 8800f568d..299c4822c 100644 --- a/openlp/plugins/songs/lib/importers/openlp.py +++ b/openlp/plugins/songs/lib/importers/openlp.py @@ -25,7 +25,7 @@ song databases into the current installation database. """ import logging -from sqlalchemy import create_engine, MetaData, Table +from sqlalchemy import MetaData, Table, create_engine from sqlalchemy.orm import class_mapper, mapper, relation, scoped_session, sessionmaker from sqlalchemy.orm.exc import UnmappedClassError @@ -33,9 +33,11 @@ from openlp.core.common.i18n import translate from openlp.core.lib.db import BaseModel from openlp.core.widgets.wizard import WizardStrings from openlp.plugins.songs.lib import clean_song -from openlp.plugins.songs.lib.db import Author, Book, Song, Topic, MediaFile +from openlp.plugins.songs.lib.db import Author, Book, MediaFile, Song, Topic + from .songimport import SongImport + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/importers/openlyrics.py b/openlp/plugins/songs/lib/importers/openlyrics.py index 62bb91414..81088a309 100644 --- a/openlp/plugins/songs/lib/importers/openlyrics.py +++ b/openlp/plugins/songs/lib/importers/openlyrics.py @@ -32,6 +32,7 @@ from openlp.plugins.songs.lib.importers.songimport import SongImport from openlp.plugins.songs.lib.openlyricsxml import OpenLyrics, OpenLyricsError from openlp.plugins.songs.lib.ui import SongStrings + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/importers/openoffice.py b/openlp/plugins/songs/lib/importers/openoffice.py index e1862c936..ef6a39f10 100644 --- a/openlp/plugins/songs/lib/importers/openoffice.py +++ b/openlp/plugins/songs/lib/importers/openoffice.py @@ -26,8 +26,10 @@ from PyQt5 import QtCore from openlp.core.common import get_uno_command, get_uno_instance, is_win, normalize_str from openlp.core.common.i18n import translate + from .songimport import SongImport + log = logging.getLogger(__name__) if is_win(): diff --git a/openlp/plugins/songs/lib/importers/opensong.py b/openlp/plugins/songs/lib/importers/opensong.py index 470330b3b..d6781c0ea 100644 --- a/openlp/plugins/songs/lib/importers/opensong.py +++ b/openlp/plugins/songs/lib/importers/opensong.py @@ -32,6 +32,7 @@ from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib.importers.songimport import SongImport from openlp.plugins.songs.lib.ui import SongStrings + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/importers/opspro.py b/openlp/plugins/songs/lib/importers/opspro.py index c21bab2d2..2071c7005 100644 --- a/openlp/plugins/songs/lib/importers/opspro.py +++ b/openlp/plugins/songs/lib/importers/opspro.py @@ -36,6 +36,7 @@ import pyodbc from openlp.core.common.i18n import translate from openlp.plugins.songs.lib.importers.songimport import SongImport + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/importers/powersong.py b/openlp/plugins/songs/lib/importers/powersong.py index c21586166..1a27af841 100644 --- a/openlp/plugins/songs/lib/importers/powersong.py +++ b/openlp/plugins/songs/lib/importers/powersong.py @@ -29,6 +29,7 @@ from openlp.core.common.i18n import translate from openlp.core.common.path import Path from openlp.plugins.songs.lib.importers.songimport import SongImport + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/importers/presentationmanager.py b/openlp/plugins/songs/lib/importers/presentationmanager.py index 49cd9e220..41a16f247 100644 --- a/openlp/plugins/songs/lib/importers/presentationmanager.py +++ b/openlp/plugins/songs/lib/importers/presentationmanager.py @@ -25,7 +25,7 @@ Presentationmanager song files into the current database. """ import re -from lxml import objectify, etree +from lxml import etree, objectify from openlp.core.common import get_file_encoding from openlp.core.common.i18n import translate diff --git a/openlp/plugins/songs/lib/importers/propresenter.py b/openlp/plugins/songs/lib/importers/propresenter.py index f5e0058db..298bce1db 100644 --- a/openlp/plugins/songs/lib/importers/propresenter.py +++ b/openlp/plugins/songs/lib/importers/propresenter.py @@ -32,6 +32,7 @@ from openlp.core.widgets.wizard import WizardStrings from openlp.plugins.songs.lib import strip_rtf from openlp.plugins.songs.lib.importers.songimport import SongImport + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/importers/songbeamer.py b/openlp/plugins/songs/lib/importers/songbeamer.py index e4276dd20..2c22f2b15 100644 --- a/openlp/plugins/songs/lib/importers/songbeamer.py +++ b/openlp/plugins/songs/lib/importers/songbeamer.py @@ -28,12 +28,13 @@ import math import os import re -from openlp.core.common import is_win, is_macosx, get_file_encoding +from openlp.core.common import get_file_encoding, is_macosx, is_win from openlp.core.common.path import Path from openlp.core.common.settings import Settings from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib.importers.songimport import SongImport + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/importers/songimport.py b/openlp/plugins/songs/lib/importers/songimport.py index aab98e00d..fd8d36ae8 100644 --- a/openlp/plugins/songs/lib/importers/songimport.py +++ b/openlp/plugins/songs/lib/importers/songimport.py @@ -31,11 +31,12 @@ from openlp.core.common.i18n import translate from openlp.core.common.path import copyfile, create_paths from openlp.core.common.registry import Registry from openlp.core.widgets.wizard import WizardStrings -from openlp.plugins.songs.lib import clean_song, VerseType -from openlp.plugins.songs.lib.db import Song, Author, Topic, Book, MediaFile +from openlp.plugins.songs.lib import VerseType, clean_song +from openlp.plugins.songs.lib.db import Author, Book, MediaFile, Song, Topic from openlp.plugins.songs.lib.openlyricsxml import SongXML from openlp.plugins.songs.lib.ui import SongStrings + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/importers/songshowplus.py b/openlp/plugins/songs/lib/importers/songshowplus.py index ceadbdf8f..d1f04411d 100644 --- a/openlp/plugins/songs/lib/importers/songshowplus.py +++ b/openlp/plugins/songs/lib/importers/songshowplus.py @@ -31,6 +31,7 @@ from openlp.core.widgets.wizard import WizardStrings from openlp.plugins.songs.lib import VerseType, retrieve_windows_encoding from openlp.plugins.songs.lib.importers.songimport import SongImport + TITLE = 1 AUTHOR = 2 COPYRIGHT = 3 diff --git a/openlp/plugins/songs/lib/importers/songsoffellowship.py b/openlp/plugins/songs/lib/importers/songsoffellowship.py index a5d254252..c5222703b 100644 --- a/openlp/plugins/songs/lib/importers/songsoffellowship.py +++ b/openlp/plugins/songs/lib/importers/songsoffellowship.py @@ -30,8 +30,10 @@ import logging import re from openlp.core.common import is_win + from .openoffice import OpenOfficeImport + log = logging.getLogger(__name__) if is_win(): diff --git a/openlp/plugins/songs/lib/importers/sundayplus.py b/openlp/plugins/songs/lib/importers/sundayplus.py index 180c76e19..8cdcf6919 100644 --- a/openlp/plugins/songs/lib/importers/sundayplus.py +++ b/openlp/plugins/songs/lib/importers/sundayplus.py @@ -21,10 +21,10 @@ ############################################################################### import re -from openlp.plugins.songs.lib import VerseType, retrieve_windows_encoding -from openlp.plugins.songs.lib import strip_rtf +from openlp.plugins.songs.lib import VerseType, retrieve_windows_encoding, strip_rtf from openlp.plugins.songs.lib.importers.songimport import SongImport + HOTKEY_TO_VERSE_TYPE = { '1': 'v1', '2': 'v2', diff --git a/openlp/plugins/songs/lib/importers/videopsalm.py b/openlp/plugins/songs/lib/importers/videopsalm.py index 156d98f69..cd09eb921 100644 --- a/openlp/plugins/songs/lib/importers/videopsalm.py +++ b/openlp/plugins/songs/lib/importers/videopsalm.py @@ -32,6 +32,7 @@ from openlp.core.common.settings import Settings from openlp.plugins.songs.lib.db import AuthorType from openlp.plugins.songs.lib.importers.songimport import SongImport + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/importers/wordsofworship.py b/openlp/plugins/songs/lib/importers/wordsofworship.py index dff14efe4..7906a8a37 100644 --- a/openlp/plugins/songs/lib/importers/wordsofworship.py +++ b/openlp/plugins/songs/lib/importers/wordsofworship.py @@ -29,6 +29,7 @@ import os from openlp.core.common.i18n import translate from openlp.plugins.songs.lib.importers.songimport import SongImport + BLOCK_TYPES = ('V', 'C', 'B') log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/importers/worshipassistant.py b/openlp/plugins/songs/lib/importers/worshipassistant.py index 6f372876e..c8c0e7104 100644 --- a/openlp/plugins/songs/lib/importers/worshipassistant.py +++ b/openlp/plugins/songs/lib/importers/worshipassistant.py @@ -32,6 +32,7 @@ from openlp.core.common.i18n import translate from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib.importers.songimport import SongImport + log = logging.getLogger(__name__) EMPTY_STR = 'NULL' diff --git a/openlp/plugins/songs/lib/importers/worshipcenterpro.py b/openlp/plugins/songs/lib/importers/worshipcenterpro.py index 6ae24f7bc..2f1b5f169 100644 --- a/openlp/plugins/songs/lib/importers/worshipcenterpro.py +++ b/openlp/plugins/songs/lib/importers/worshipcenterpro.py @@ -31,6 +31,7 @@ import pyodbc from openlp.core.common.i18n import translate from openlp.plugins.songs.lib.importers.songimport import SongImport + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/importers/zionworx.py b/openlp/plugins/songs/lib/importers/zionworx.py index 345f3ac44..74087f91e 100644 --- a/openlp/plugins/songs/lib/importers/zionworx.py +++ b/openlp/plugins/songs/lib/importers/zionworx.py @@ -28,6 +28,7 @@ import logging from openlp.core.common.i18n import translate from openlp.plugins.songs.lib.importers.songimport import SongImport + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 3e5737944..4ec765eb5 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -26,8 +26,7 @@ from PyQt5 import QtCore, QtWidgets from sqlalchemy.sql import and_, or_ from openlp.core.common.applocation import AppLocation -from openlp.core.common.i18n import UiStrings, translate, get_natural_key -from openlp.core.ui.icons import UiIcons +from openlp.core.common.i18n import UiStrings, get_natural_key, translate from openlp.core.common.path import copyfile, create_paths from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings @@ -36,15 +35,17 @@ from openlp.core.lib.mediamanageritem import MediaManagerItem from openlp.core.lib.plugin import PluginStatus from openlp.core.lib.serviceitem import ItemCapabilities from openlp.core.lib.ui import create_widget_action +from openlp.core.ui.icons import UiIcons from openlp.plugins.songs.forms.editsongform import EditSongForm from openlp.plugins.songs.forms.songexportform import SongExportForm from openlp.plugins.songs.forms.songimportform import SongImportForm from openlp.plugins.songs.forms.songmaintenanceform import SongMaintenanceForm from openlp.plugins.songs.lib import VerseType, clean_string, delete_song -from openlp.plugins.songs.lib.db import Author, AuthorType, Song, Book, MediaFile, SongBookEntry, Topic +from openlp.plugins.songs.lib.db import Author, AuthorType, Book, MediaFile, Song, SongBookEntry, Topic from openlp.plugins.songs.lib.openlyricsxml import OpenLyrics, SongXML from openlp.plugins.songs.lib.ui import SongStrings + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/openlyricsexport.py b/openlp/plugins/songs/lib/openlyricsexport.py index ff3e4fe3e..84f3e869b 100644 --- a/openlp/plugins/songs/lib/openlyricsexport.py +++ b/openlp/plugins/songs/lib/openlyricsexport.py @@ -33,6 +33,7 @@ from openlp.core.common.mixins import RegistryProperties from openlp.core.common.path import create_paths from openlp.plugins.songs.lib.openlyricsxml import OpenLyrics + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/openlyricsxml.py b/openlp/plugins/songs/lib/openlyricsxml.py index d5aecc178..3eba7c800 100644 --- a/openlp/plugins/songs/lib/openlyricsxml.py +++ b/openlp/plugins/songs/lib/openlyricsxml.py @@ -68,6 +68,7 @@ from openlp.core.version import get_version from openlp.plugins.songs.lib import VerseType, clean_song from openlp.plugins.songs.lib.db import Author, AuthorType, Book, Song, Topic + log = logging.getLogger(__name__) NAMESPACE = 'http://openlyrics.info/namespace/2009/song' diff --git a/openlp/plugins/songs/lib/songselect.py b/openlp/plugins/songs/lib/songselect.py index 35f01888b..7df22e465 100644 --- a/openlp/plugins/songs/lib/songselect.py +++ b/openlp/plugins/songs/lib/songselect.py @@ -34,9 +34,10 @@ from urllib.request import HTTPCookieProcessor, URLError, build_opener from bs4 import BeautifulSoup, NavigableString from openlp.plugins.songs.lib import VerseType, clean_song -from openlp.plugins.songs.lib.db import Song, Author, Topic +from openlp.plugins.songs.lib.db import Author, Song, Topic from openlp.plugins.songs.lib.openlyricsxml import SongXML + USER_AGENTS = [ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) ' 'Chrome/52.0.2743.116 Safari/537.36', diff --git a/openlp/plugins/songs/lib/upgrade.py b/openlp/plugins/songs/lib/upgrade.py index cfa7f2730..bd0516bce 100644 --- a/openlp/plugins/songs/lib/upgrade.py +++ b/openlp/plugins/songs/lib/upgrade.py @@ -26,8 +26,8 @@ backend for the Songs plugin import json import logging -from sqlalchemy import Table, Column, ForeignKey, types -from sqlalchemy.sql.expression import func, false, null, text +from sqlalchemy import Column, ForeignKey, Table, types +from sqlalchemy.sql.expression import false, func, null, text from openlp.core.common.applocation import AppLocation from openlp.core.common.db import drop_columns @@ -35,6 +35,7 @@ from openlp.core.common.json import OpenLPJsonEncoder from openlp.core.common.path import Path from openlp.core.lib.db import PathType, get_upgrade_op + log = logging.getLogger(__name__) __version__ = 7 diff --git a/openlp/plugins/songs/reporting.py b/openlp/plugins/songs/reporting.py index afbb2559d..b9db82979 100644 --- a/openlp/plugins/songs/reporting.py +++ b/openlp/plugins/songs/reporting.py @@ -32,6 +32,7 @@ from openlp.core.lib.ui import critical_error_message_box from openlp.core.widgets.dialogs import FileDialog from openlp.plugins.songs.lib.db import Song + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index e810dab3e..502359e15 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -34,24 +34,24 @@ from PyQt5 import QtCore, QtWidgets from openlp.core.api.http import register_endpoint 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.common.registry import Registry from openlp.core.lib import build_icon -from openlp.core.lib.plugin import Plugin, StringContent from openlp.core.lib.db import Manager +from openlp.core.lib.plugin import Plugin, StringContent from openlp.core.lib.ui import create_action +from openlp.core.ui.icons import UiIcons from openlp.plugins.songs import reporting from openlp.plugins.songs.endpoint import api_songs_endpoint, songs_endpoint from openlp.plugins.songs.forms.duplicatesongremovalform import DuplicateSongRemovalForm from openlp.plugins.songs.forms.songselectform import SongSelectForm from openlp.plugins.songs.lib import clean_song, upgrade -from openlp.plugins.songs.lib.db import init_schema, Song +from openlp.plugins.songs.lib.db import Song, init_schema from openlp.plugins.songs.lib.importer import SongFormat from openlp.plugins.songs.lib.importers.openlp import OpenLPSongImport -from openlp.plugins.songs.lib.mediaitem import SongMediaItem -from openlp.plugins.songs.lib.mediaitem import SongSearch +from openlp.plugins.songs.lib.mediaitem import SongMediaItem, SongSearch from openlp.plugins.songs.lib.songstab import SongsTab + log = logging.getLogger(__name__) __default_settings__ = { 'songs/db type': 'sqlite', diff --git a/openlp/plugins/songusage/forms/songusagedetailform.py b/openlp/plugins/songusage/forms/songusagedetailform.py index 78e2fdf37..e41d69dda 100644 --- a/openlp/plugins/songusage/forms/songusagedetailform.py +++ b/openlp/plugins/songusage/forms/songusagedetailform.py @@ -30,8 +30,10 @@ from openlp.core.common.path import create_paths from openlp.core.common.settings import Settings from openlp.core.lib.ui import critical_error_message_box from openlp.plugins.songusage.lib.db import SongUsageItem + from .songusagedetaildialog import Ui_SongUsageDetailDialog + log = logging.getLogger(__name__) diff --git a/openlp/plugins/songusage/lib/upgrade.py b/openlp/plugins/songusage/lib/upgrade.py index 8f30d986a..39ecaa9ce 100644 --- a/openlp/plugins/songusage/lib/upgrade.py +++ b/openlp/plugins/songusage/lib/upgrade.py @@ -25,10 +25,11 @@ backend for the SongsUsage plugin """ import logging -from sqlalchemy import Table, Column, types +from sqlalchemy import Column, Table, types from openlp.core.lib.db import get_upgrade_op + log = logging.getLogger(__name__) __version__ = 2 diff --git a/openlp/plugins/songusage/songusageplugin.py b/openlp/plugins/songusage/songusageplugin.py index a0dcff54f..dec1988c4 100644 --- a/openlp/plugins/songusage/songusageplugin.py +++ b/openlp/plugins/songusage/songusageplugin.py @@ -29,13 +29,14 @@ from openlp.core.common.actions import ActionList from openlp.core.common.i18n import translate from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings -from openlp.core.lib.plugin import Plugin, StringContent from openlp.core.lib.db import Manager +from openlp.core.lib.plugin import Plugin, StringContent 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 import SongUsageDeleteForm, SongUsageDetailForm from openlp.plugins.songusage.lib import upgrade -from openlp.plugins.songusage.lib.db import init_schema, SongUsageItem +from openlp.plugins.songusage.lib.db import SongUsageItem, init_schema + log = logging.getLogger(__name__) diff --git a/scripts/appveyor-webhook.py b/scripts/appveyor-webhook.py index ce02b7aee..24d926b29 100755 --- a/scripts/appveyor-webhook.py +++ b/scripts/appveyor-webhook.py @@ -27,13 +27,14 @@ on github the normal triggering mechanisms can't be use. The project is registered as subversion repository. A webhook is used to trigger new builds. The appveyor.yml used for the build is send to appveyor when calling the hook. """ -import json -import urllib -import urllib.request import datetime +import json import sys import time -from subprocess import Popen, PIPE +import urllib +import urllib.request +from subprocess import PIPE, Popen + appveyor_build_url = 'https://ci.appveyor.com/project/OpenLP/{project}/build' appveyor_api_url = 'https://ci.appveyor.com/api/projects/OpenLP/{project}' diff --git a/scripts/check_dependencies.py b/scripts/check_dependencies.py index 04e129137..ec764fd6a 100755 --- a/scripts/check_dependencies.py +++ b/scripts/check_dependencies.py @@ -33,6 +33,7 @@ import os import sys from distutils.version import LooseVersion + # If we try to import uno before nose this will create a warning. Just try to import nose first to suppress the warning. try: import nose diff --git a/scripts/clean_up_resources.py b/scripts/clean_up_resources.py index baad3e1f6..85a0e9844 100755 --- a/scripts/clean_up_resources.py +++ b/scripts/clean_up_resources.py @@ -26,6 +26,7 @@ import os from lxml import etree + resource_path = os.path.join('..', 'resources', 'images') resource_file_path = os.path.join(resource_path, 'openlp-2.qrc') src_directory = os.path.join('..', 'openlp') diff --git a/scripts/jenkins_script.py b/scripts/jenkins_script.py index 61c35c551..3284d38ed 100755 --- a/scripts/jenkins_script.py +++ b/scripts/jenkins_script.py @@ -44,10 +44,11 @@ import os import re import time from argparse import ArgumentParser -from subprocess import Popen, PIPE +from subprocess import PIPE, Popen from jenkins import Jenkins + JENKINS_URL = 'https://ci.openlp.io/' REPO_REGEX = r'(.*/+)(~.*)' diff --git a/scripts/lp-merge.py b/scripts/lp-merge.py index c10e9e0d2..29d0efb90 100755 --- a/scripts/lp-merge.py +++ b/scripts/lp-merge.py @@ -49,12 +49,13 @@ wish to change it, you can chose to run 'qcommit', an bzr GUI. Note that you'll have to install qbzr for this to work. If you choose to run qcommit the script will print the detected bugs + author for easy copying into the GUI. """ -import subprocess -import re import os -from urllib.request import urlopen -from urllib.error import HTTPError +import re +import subprocess from argparse import ArgumentParser +from urllib.error import HTTPError +from urllib.request import urlopen + from bs4 import BeautifulSoup diff --git a/scripts/mp_update.py b/scripts/mp_update.py index 303913f9a..523a5dff0 100644 --- a/scripts/mp_update.py +++ b/scripts/mp_update.py @@ -1,10 +1,12 @@ #!/usr/bin/env python2 -import sys import os +import sys from argparse import ArgumentParser + from launchpadlib.credentials import UnencryptedFileCredentialStore from launchpadlib.launchpad import Launchpad + HERE = os.path.dirname(os.path.abspath(__file__)) diff --git a/scripts/translation_utils.py b/scripts/translation_utils.py index 44f2476f5..3cc698cc1 100755 --- a/scripts/translation_utils.py +++ b/scripts/translation_utils.py @@ -45,8 +45,6 @@ This is done easily via the ``-d``, ``-p`` and ``-u`` options:: @:~$ ./translation_utils.py -dpu """ -from argparse import ArgumentParser -from getpass import getpass import base64 import glob import json @@ -56,9 +54,12 @@ import urllib.error import urllib.parse import urllib.request import webbrowser +from argparse import ArgumentParser +from getpass import getpass -from PyQt5 import QtCore from lxml import etree, objectify +from PyQt5 import QtCore + SERVER_URL = 'http://www.transifex.com/api/2/project/openlp/resource/openlp-26x/' IGNORED_PATHS = ['scripts'] diff --git a/scripts/websocket_client.py b/scripts/websocket_client.py index 753825edf..ee6b588c8 100755 --- a/scripts/websocket_client.py +++ b/scripts/websocket_client.py @@ -22,9 +22,10 @@ ############################################################################### import asyncio -import websockets import random +import websockets + async def tester(): async with websockets.connect('ws://localhost:4317/poll') as websocket: diff --git a/setup.py b/setup.py index a28fa0300..4ca82a092 100755 --- a/setup.py +++ b/setup.py @@ -21,8 +21,9 @@ ############################################################################### import re -from setuptools import setup, find_packages -from subprocess import Popen, PIPE +from subprocess import PIPE, Popen + +from setuptools import find_packages, setup VERSION_FILE = 'openlp/.version' diff --git a/tests/functional/openlp_core/api/endpoint/test_controller.py b/tests/functional/openlp_core/api/endpoint/test_controller.py index 2d9bf3307..242699184 100644 --- a/tests/functional/openlp_core/api/endpoint/test_controller.py +++ b/tests/functional/openlp_core/api/endpoint/test_controller.py @@ -15,24 +15,26 @@ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # # more details. # # # -# You should have received a copy of the GNU General Public License along # -# with this program; if not, write to the Free Software Foundation, Inc., 59 # + + # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### from unittest import TestCase +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # from unittest.mock import MagicMock from PyQt5 import QtCore +from openlp.core.api.endpoint.controller import controller_direction, controller_text from openlp.core.common.registry import Registry -from openlp.core.api.endpoint.controller import controller_text, controller_direction from openlp.core.display.renderer import Renderer from openlp.core.display.screens import ScreenList from openlp.core.lib.serviceitem import ServiceItem - from tests.utils import convert_file_service_item from tests.utils.constants import RESOURCE_PATH + TEST_PATH = str(RESOURCE_PATH / 'service') SCREEN = { diff --git a/tests/functional/openlp_core/api/endpoint/test_remote.py b/tests/functional/openlp_core/api/endpoint/test_remote.py index c330f64d6..1e56bc856 100644 --- a/tests/functional/openlp_core/api/endpoint/test_remote.py +++ b/tests/functional/openlp_core/api/endpoint/test_remote.py @@ -24,8 +24,8 @@ Functional tests to test the remote index """ from unittest.mock import MagicMock, patch -from openlp.core.api.endpoint.remote import index from openlp.core.api.endpoint.core import TRANSLATED_STRINGS +from openlp.core.api.endpoint.remote import index @patch('openlp.core.api.endpoint.remote.remote_endpoint') diff --git a/tests/functional/openlp_core/api/http/test_init.py b/tests/functional/openlp_core/api/http/test_init.py index e82daa0f2..c1ac3044b 100644 --- a/tests/functional/openlp_core/api/http/test_init.py +++ b/tests/functional/openlp_core/api/http/test_init.py @@ -25,10 +25,9 @@ Functional tests to test the Http init. from unittest import TestCase from unittest.mock import MagicMock -from openlp.core.api.http import check_auth, requires_auth, authenticate +from openlp.core.api.http import authenticate, check_auth, requires_auth from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings - from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_core/api/http/test_wsgiapp.py b/tests/functional/openlp_core/api/http/test_wsgiapp.py index a7cf331b5..fd84e0a6d 100644 --- a/tests/functional/openlp_core/api/http/test_wsgiapp.py +++ b/tests/functional/openlp_core/api/http/test_wsgiapp.py @@ -26,9 +26,10 @@ import os 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 NotFound, application, register_endpoint from openlp.core.api.http.endpoint import Endpoint + ROOT_DIR = os.path.dirname(os.path.realpath(__file__)) test_endpoint = Endpoint('test', template_dir=ROOT_DIR, static_dir=ROOT_DIR) diff --git a/tests/functional/openlp_core/api/test_deploy.py b/tests/functional/openlp_core/api/test_deploy.py index d46ac8d43..204deb014 100644 --- a/tests/functional/openlp_core/api/test_deploy.py +++ b/tests/functional/openlp_core/api/test_deploy.py @@ -15,17 +15,20 @@ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # # more details. # # # -# You should have received a copy of the GNU General Public License along # -# with this program; if not, write to the Free Software Foundation, Inc., 59 # + + # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### from tempfile import mkdtemp +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # from unittest import TestCase from unittest.mock import MagicMock, patch -from openlp.core.api.deploy import deploy_zipfile, download_sha256, download_and_check +from openlp.core.api.deploy import deploy_zipfile, download_and_check, download_sha256 from openlp.core.common.path import Path + CONFIG_FILE = '2c266badff1e3d140664c50fd1460a2b332b24d5ad8c267fa62e506b5eb6d894 deploy/site.zip\n2017_06_27' diff --git a/tests/functional/openlp_core/api/test_tab.py b/tests/functional/openlp_core/api/test_tab.py index 1f61673f4..983046877 100644 --- a/tests/functional/openlp_core/api/test_tab.py +++ b/tests/functional/openlp_core/api/test_tab.py @@ -34,6 +34,7 @@ from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings from tests.helpers.testmixin import TestMixin + __default_settings__ = { 'api/twelve hour': True, 'api/port': 4316, diff --git a/tests/functional/openlp_core/api/test_websockets.py b/tests/functional/openlp_core/api/test_websockets.py index 3d9bcf682..f3f72435c 100644 --- a/tests/functional/openlp_core/api/test_websockets.py +++ b/tests/functional/openlp_core/api/test_websockets.py @@ -31,6 +31,7 @@ from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings from tests.helpers.testmixin import TestMixin + __default_settings__ = { 'api/twelve hour': True, 'api/port': 4316, diff --git a/tests/functional/openlp_core/common/test_actions.py b/tests/functional/openlp_core/common/test_actions.py index c46e1a630..cf67957a9 100644 --- a/tests/functional/openlp_core/common/test_actions.py +++ b/tests/functional/openlp_core/common/test_actions.py @@ -25,10 +25,10 @@ Package to test the openlp.core.common.actions package. from unittest import TestCase from unittest.mock import MagicMock, call, patch -from PyQt5 import QtGui, QtCore, QtWidgets +from PyQt5 import QtCore, QtGui, QtWidgets import openlp.core.common.actions -from openlp.core.common.actions import CategoryActionList, ActionList +from openlp.core.common.actions import ActionList, CategoryActionList from openlp.core.common.settings import Settings from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_core/common/test_applocation.py b/tests/functional/openlp_core/common/test_applocation.py index 5d54deba3..a46c3cf07 100644 --- a/tests/functional/openlp_core/common/test_applocation.py +++ b/tests/functional/openlp_core/common/test_applocation.py @@ -29,6 +29,7 @@ from openlp.core.common import get_frozen_path from openlp.core.common.applocation import AppLocation from openlp.core.common.path import Path + FILE_LIST = ['file1', 'file2', 'file3.txt', 'file4.txt', 'file5.mp3', 'file6.mp3'] diff --git a/tests/functional/openlp_core/common/test_common.py b/tests/functional/openlp_core/common/test_common.py index dca32bd57..7a314b8e8 100644 --- a/tests/functional/openlp_core/common/test_common.py +++ b/tests/functional/openlp_core/common/test_common.py @@ -25,8 +25,8 @@ Functional tests to test the AppLocation class and related methods. from unittest import TestCase from unittest.mock import MagicMock, call, patch -from openlp.core.common import clean_button_text, de_hump, extension_loader, is_macosx, is_linux, \ - is_win, normalize_str, path_to_module, trace_error_handler +from openlp.core.common import clean_button_text, de_hump, extension_loader, is_linux, is_macosx, is_win, \ + normalize_str, path_to_module, trace_error_handler from openlp.core.common.path import Path diff --git a/tests/functional/openlp_core/common/test_db.py b/tests/functional/openlp_core/common/test_db.py index 7fe59b35f..4f9b228ba 100644 --- a/tests/functional/openlp_core/common/test_db.py +++ b/tests/functional/openlp_core/common/test_db.py @@ -32,7 +32,7 @@ from unittest import TestCase import sqlalchemy from openlp.core.common.db import drop_column, drop_columns -from openlp.core.lib.db import init_db, get_upgrade_op +from openlp.core.lib.db import get_upgrade_op, init_db from tests.utils.constants import TEST_RESOURCES_PATH diff --git a/tests/functional/openlp_core/common/test_i18n.py b/tests/functional/openlp_core/common/test_i18n.py index 7dadcb976..54a282929 100644 --- a/tests/functional/openlp_core/common/test_i18n.py +++ b/tests/functional/openlp_core/common/test_i18n.py @@ -26,8 +26,8 @@ from unittest import skipIf from unittest.mock import MagicMock, patch from openlp.core.common import is_macosx -from openlp.core.common.i18n import LANGUAGES, Language, UiStrings, get_language, get_locale_key, get_natural_key, \ - translate, LanguageManager +from openlp.core.common.i18n import LANGUAGES, Language, LanguageManager, UiStrings, get_language, get_locale_key, \ + get_natural_key, translate from openlp.core.common.settings import Settings diff --git a/tests/functional/openlp_core/common/test_network_interfaces.py b/tests/functional/openlp_core/common/test_network_interfaces.py index d1547bd0a..9127e8039 100644 --- a/tests/functional/openlp_core/common/test_network_interfaces.py +++ b/tests/functional/openlp_core/common/test_network_interfaces.py @@ -27,9 +27,9 @@ from unittest.mock import MagicMock, call, patch import openlp.core.common from openlp.core.common import get_local_ip4 - from tests.helpers.testmixin import TestMixin + lo_address_attrs = {'isValid.return_value': True, 'flags.return_value': True, 'InterfaceFlags.return_value': True, diff --git a/tests/functional/openlp_core/common/test_path.py b/tests/functional/openlp_core/common/test_path.py index 8581d9b49..b65eaa2cc 100644 --- a/tests/functional/openlp_core/common/test_path.py +++ b/tests/functional/openlp_core/common/test_path.py @@ -26,8 +26,8 @@ import os from unittest import TestCase from unittest.mock import ANY, MagicMock, patch -from openlp.core.common.path import Path, copy, copyfile, copytree, create_paths, path_to_str, replace_params, \ - str_to_path, which, files_to_paths +from openlp.core.common.path import Path, copy, copyfile, copytree, create_paths, files_to_paths, path_to_str, \ + replace_params, str_to_path, which class TestShutil(TestCase): diff --git a/tests/functional/openlp_core/display/test_render.py b/tests/functional/openlp_core/display/test_render.py index d73f00a1b..3326dcffe 100644 --- a/tests/functional/openlp_core/display/test_render.py +++ b/tests/functional/openlp_core/display/test_render.py @@ -24,8 +24,8 @@ Test the :mod:`~openlp.core.display.render` package. """ from unittest.mock import patch -from openlp.core.display.render import remove_tags, render_tags, render_chords, compare_chord_lyric_width, \ - render_chords_for_printing, find_formatting_tags +from openlp.core.display.render import compare_chord_lyric_width, find_formatting_tags, remove_tags, render_chords, \ + render_chords_for_printing, render_tags from openlp.core.lib.formattingtags import FormattingTags diff --git a/tests/functional/openlp_core/display/test_screens.py b/tests/functional/openlp_core/display/test_screens.py index 1bba2c44c..14fca38f1 100644 --- a/tests/functional/openlp_core/display/test_screens.py +++ b/tests/functional/openlp_core/display/test_screens.py @@ -28,7 +28,8 @@ from unittest.mock import MagicMock from PyQt5 import QtCore, QtWidgets from openlp.core.common.registry import Registry -from openlp.core.display.screens import ScreenList, Screen +from openlp.core.display.screens import Screen, ScreenList + SCREEN = { 'primary': False, diff --git a/tests/functional/openlp_core/lib/test_db.py b/tests/functional/openlp_core/lib/test_db.py index cc928ac56..11b21be1f 100644 --- a/tests/functional/openlp_core/lib/test_db.py +++ b/tests/functional/openlp_core/lib/test_db.py @@ -25,14 +25,14 @@ Package to test the openlp.core.lib package. import shutil from tempfile import mkdtemp from unittest import TestCase -from unittest.mock import patch, MagicMock +from unittest.mock import MagicMock, patch from sqlalchemy import MetaData from sqlalchemy.orm.scoping import ScopedSession from sqlalchemy.pool import NullPool from openlp.core.common.path import Path -from openlp.core.lib.db import init_db, get_upgrade_op, delete_database, upgrade_db +from openlp.core.lib.db import delete_database, get_upgrade_op, init_db, upgrade_db class TestDB(TestCase): diff --git a/tests/functional/openlp_core/lib/test_formattingtags.py b/tests/functional/openlp_core/lib/test_formattingtags.py index 151611496..0f640df10 100644 --- a/tests/functional/openlp_core/lib/test_formattingtags.py +++ b/tests/functional/openlp_core/lib/test_formattingtags.py @@ -28,6 +28,7 @@ from unittest.mock import patch from openlp.core.lib.formattingtags import FormattingTags + TAG = { 'end tag': '{/aa}', 'start html': '', diff --git a/tests/functional/openlp_core/lib/test_htmlbuilder.py b/tests/functional/openlp_core/lib/test_htmlbuilder.py index 608cdf70b..656be583f 100644 --- a/tests/functional/openlp_core/lib/test_htmlbuilder.py +++ b/tests/functional/openlp_core/lib/test_htmlbuilder.py @@ -7,11 +7,12 @@ from unittest.mock import MagicMock, patch from PyQt5 import QtCore from openlp.core.common.settings import Settings -from openlp.core.lib.htmlbuilder import build_html, build_background_css, build_lyrics_css, build_lyrics_outline_css, \ - build_lyrics_format_css, build_footer_css, build_chords_css +from openlp.core.lib.htmlbuilder import build_background_css, build_chords_css, build_footer_css, build_html, \ + build_lyrics_css, build_lyrics_format_css, build_lyrics_outline_css from openlp.core.lib.theme import HorizontalType, VerticalType from tests.helpers.testmixin import TestMixin + HTML = r""" diff --git a/tests/functional/openlp_core/lib/test_image_manager.py b/tests/functional/openlp_core/lib/test_image_manager.py index 9cee73739..c424b49a7 100644 --- a/tests/functional/openlp_core/lib/test_image_manager.py +++ b/tests/functional/openlp_core/lib/test_image_manager.py @@ -32,10 +32,11 @@ from PyQt5 import QtGui from openlp.core.common.registry import Registry from openlp.core.display.screens import ScreenList -from openlp.core.lib.imagemanager import ImageWorker, ImageManager, Priority, PriorityQueue +from openlp.core.lib.imagemanager import ImageManager, ImageWorker, Priority, PriorityQueue from tests.helpers.testmixin import TestMixin from tests.utils.constants import RESOURCE_PATH + TEST_PATH = str(RESOURCE_PATH) diff --git a/tests/functional/openlp_core/lib/test_serviceitem.py b/tests/functional/openlp_core/lib/test_serviceitem.py index b860ea790..d62d7b36b 100644 --- a/tests/functional/openlp_core/lib/test_serviceitem.py +++ b/tests/functional/openlp_core/lib/test_serviceitem.py @@ -36,6 +36,7 @@ from tests.helpers.testmixin import TestMixin from tests.utils import assert_length, convert_file_service_item from tests.utils.constants import RESOURCE_PATH + VERSE = 'The Lord said to {r}Noah{/r}: \n'\ 'There\'s gonna be a {su}floody{/su}, {sb}floody{/sb}\n'\ 'The Lord said to {g}Noah{/g}:\n'\ diff --git a/tests/functional/openlp_core/lib/test_ui.py b/tests/functional/openlp_core/lib/test_ui.py index 42fab0191..a5ee2ff0e 100644 --- a/tests/functional/openlp_core/lib/test_ui.py +++ b/tests/functional/openlp_core/lib/test_ui.py @@ -23,14 +23,14 @@ Package to test the openlp.core.lib.ui package. """ from unittest import TestCase -from unittest.mock import MagicMock, patch, call +from unittest.mock import MagicMock, call, patch from PyQt5 import QtCore, QtGui, QtWidgets from openlp.core.common.i18n import UiStrings, translate -from openlp.core.lib.ui import add_welcome_page, create_button_box, create_horizontal_adjusting_combo_box, \ - create_button, create_action, create_valign_selection_widgets, find_and_set_in_combo_box, create_widget_action, \ - set_case_insensitive_completer, critical_error_message_box +from openlp.core.lib.ui import add_welcome_page, create_action, create_button, create_button_box, \ + create_horizontal_adjusting_combo_box, create_valign_selection_widgets, create_widget_action, \ + critical_error_message_box, find_and_set_in_combo_box, set_case_insensitive_completer class TestUi(TestCase): diff --git a/tests/functional/openlp_core/test_server.py b/tests/functional/openlp_core/test_server.py index aa181cb49..0af89b7ea 100644 --- a/tests/functional/openlp_core/test_server.py +++ b/tests/functional/openlp_core/test_server.py @@ -15,16 +15,17 @@ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # # more details. # # # -# You should have received a copy of the GNU General Public License along # -# with this program; if not, write to the Free Software Foundation, Inc., 59 # + + # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### from unittest import TestCase +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # from unittest.mock import MagicMock, patch -from openlp.core.server import Server from openlp.core.common.registry import Registry - +from openlp.core.server import Server from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_core/test_threading.py b/tests/functional/openlp_core/test_threading.py index 177f4bf99..6e9aab90a 100644 --- a/tests/functional/openlp_core/test_threading.py +++ b/tests/functional/openlp_core/test_threading.py @@ -25,7 +25,7 @@ Package to test the openlp.core.threading package. from inspect import isfunction from unittest.mock import MagicMock, call, patch -from openlp.core.threading import ThreadWorker, run_thread, get_thread_worker, is_thread_finished, make_remove_thread +from openlp.core.threading import ThreadWorker, get_thread_worker, is_thread_finished, make_remove_thread, run_thread def test_run_thread_no_name(): diff --git a/tests/functional/openlp_core/ui/media/test_systemplayer.py b/tests/functional/openlp_core/ui/media/test_systemplayer.py index 1726f7e2e..728eb2ee4 100644 --- a/tests/functional/openlp_core/ui/media/test_systemplayer.py +++ b/tests/functional/openlp_core/ui/media/test_systemplayer.py @@ -29,7 +29,7 @@ from PyQt5 import QtCore, QtMultimedia from openlp.core.common.registry import Registry from openlp.core.ui.media import MediaState -from openlp.core.ui.media.systemplayer import SystemPlayer, CheckMediaWorker, ADDITIONAL_EXT +from openlp.core.ui.media.systemplayer import ADDITIONAL_EXT, CheckMediaWorker, SystemPlayer class TestSystemPlayer(TestCase): diff --git a/tests/functional/openlp_core/ui/media/test_vlcplayer.py b/tests/functional/openlp_core/ui/media/test_vlcplayer.py index 24c929563..5cbcf4392 100644 --- a/tests/functional/openlp_core/ui/media/test_vlcplayer.py +++ b/tests/functional/openlp_core/ui/media/test_vlcplayer.py @@ -26,7 +26,7 @@ import os import sys from datetime import timedelta from unittest import TestCase, skip -from unittest.mock import MagicMock, patch, call +from unittest.mock import MagicMock, call, patch from openlp.core.common.registry import Registry from openlp.core.ui.media import MediaState, MediaType diff --git a/tests/functional/openlp_core/ui/test_exceptionform.py b/tests/functional/openlp_core/ui/test_exceptionform.py index b98f25db9..13f0042e5 100644 --- a/tests/functional/openlp_core/ui/test_exceptionform.py +++ b/tests/functional/openlp_core/ui/test_exceptionform.py @@ -33,6 +33,7 @@ from openlp.core.common.registry import Registry from openlp.core.ui import exceptionform from tests.helpers.testmixin import TestMixin + exceptionform.WEBKIT_VERSION = 'Webkit Test' exceptionform.MIGRATE_VERSION = 'Migrate Test' exceptionform.CHARDET_VERSION = 'CHARDET Test' diff --git a/tests/functional/openlp_core/ui/test_firsttimeform.py b/tests/functional/openlp_core/ui/test_firsttimeform.py index 76f1be051..04bef00bf 100644 --- a/tests/functional/openlp_core/ui/test_firsttimeform.py +++ b/tests/functional/openlp_core/ui/test_firsttimeform.py @@ -32,6 +32,7 @@ from openlp.core.common.registry import Registry from openlp.core.ui.firsttimeform import FirstTimeForm from tests.helpers.testmixin import TestMixin + FAKE_CONFIG = """ [general] base url = http://example.com/frw/ diff --git a/tests/functional/openlp_core/ui/test_formattingtagsform.py b/tests/functional/openlp_core/ui/test_formattingtagsform.py index e45f94855..2687ec3c1 100644 --- a/tests/functional/openlp_core/ui/test_formattingtagsform.py +++ b/tests/functional/openlp_core/ui/test_formattingtagsform.py @@ -23,7 +23,7 @@ Package to test the openlp.core.ui.formattingtagsform package. """ from unittest import TestCase -from unittest.mock import MagicMock, patch, call +from unittest.mock import MagicMock, call, patch from openlp.core.ui.formattingtagform import FormattingTagForm diff --git a/tests/functional/openlp_core/ui/test_icons.py b/tests/functional/openlp_core/ui/test_icons.py index cea393311..19e99f31e 100644 --- a/tests/functional/openlp_core/ui/test_icons.py +++ b/tests/functional/openlp_core/ui/test_icons.py @@ -28,7 +28,6 @@ from unittest.mock import MagicMock, patch from PyQt5 import QtGui from openlp.core.ui.icons import UiIcons - from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_core/ui/test_servicemanager.py b/tests/functional/openlp_core/ui/test_servicemanager.py index 89080f835..c698f8ea2 100644 --- a/tests/functional/openlp_core/ui/test_servicemanager.py +++ b/tests/functional/openlp_core/ui/test_servicemanager.py @@ -30,7 +30,7 @@ import PyQt5 from openlp.core.common import ThemeLevel from openlp.core.common.registry import Registry -from openlp.core.lib.serviceitem import ServiceItem, ServiceItemType, ItemCapabilities +from openlp.core.lib.serviceitem import ItemCapabilities, ServiceItem, ServiceItemType from openlp.core.ui.servicemanager import ServiceManager from openlp.core.widgets.toolbar import OpenLPToolbar diff --git a/tests/functional/openlp_core/ui/test_slidecontroller.py b/tests/functional/openlp_core/ui/test_slidecontroller.py index 68b14bf26..4e52be576 100644 --- a/tests/functional/openlp_core/ui/test_slidecontroller.py +++ b/tests/functional/openlp_core/ui/test_slidecontroller.py @@ -29,8 +29,8 @@ from PyQt5 import QtCore, QtGui from openlp.core.common.registry import Registry from openlp.core.lib import ServiceItemAction -from openlp.core.ui.slidecontroller import WIDE_MENU, NON_TEXT_MENU, InfoLabel, SlideController, LiveController, \ - PreviewController +from openlp.core.ui.slidecontroller import NON_TEXT_MENU, WIDE_MENU, InfoLabel, LiveController, PreviewController, \ + SlideController class TestSlideController(TestCase): diff --git a/tests/functional/openlp_core/widgets/test_views.py b/tests/functional/openlp_core/widgets/test_views.py index a0bbb4437..39db99614 100644 --- a/tests/functional/openlp_core/widgets/test_views.py +++ b/tests/functional/openlp_core/widgets/test_views.py @@ -25,7 +25,7 @@ Package to test the openlp.core.widgets.views package. import os from types import GeneratorType from unittest import TestCase -from unittest.mock import MagicMock, patch, call +from unittest.mock import MagicMock, call, patch from PyQt5 import QtGui diff --git a/tests/functional/openlp_plugins/bibles/test_bibleimport.py b/tests/functional/openlp_plugins/bibles/test_bibleimport.py index 013bbc267..9b9a8fae8 100644 --- a/tests/functional/openlp_plugins/bibles/test_bibleimport.py +++ b/tests/functional/openlp_plugins/bibles/test_bibleimport.py @@ -26,8 +26,8 @@ from io import BytesIO from unittest import TestCase from unittest.mock import MagicMock, patch -from PyQt5.QtWidgets import QDialog from lxml import etree, objectify +from PyQt5.QtWidgets import QDialog from openlp.core.common.i18n import Language from openlp.core.common.path import Path diff --git a/tests/functional/openlp_plugins/bibles/test_bibleserver.py b/tests/functional/openlp_plugins/bibles/test_bibleserver.py index 5d49a7a18..708071134 100644 --- a/tests/functional/openlp_plugins/bibles/test_bibleserver.py +++ b/tests/functional/openlp_plugins/bibles/test_bibleserver.py @@ -23,7 +23,7 @@ This module contains tests for the http module of the Bibles plugin. """ from unittest import TestCase -from unittest.mock import patch, MagicMock +from unittest.mock import MagicMock, patch from bs4 import BeautifulSoup diff --git a/tests/functional/openlp_plugins/bibles/test_csvimport.py b/tests/functional/openlp_plugins/bibles/test_csvimport.py index db07706eb..84df39bfb 100644 --- a/tests/functional/openlp_plugins/bibles/test_csvimport.py +++ b/tests/functional/openlp_plugins/bibles/test_csvimport.py @@ -34,6 +34,7 @@ from openlp.plugins.bibles.lib.importers.csvbible import Book, CSVBible, Verse from tests.utils import load_external_result_data from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'bibles' diff --git a/tests/functional/openlp_plugins/bibles/test_mediaitem.py b/tests/functional/openlp_plugins/bibles/test_mediaitem.py index 2e7d76e90..38dc47232 100755 --- a/tests/functional/openlp_plugins/bibles/test_mediaitem.py +++ b/tests/functional/openlp_plugins/bibles/test_mediaitem.py @@ -29,8 +29,8 @@ from PyQt5 import QtCore, QtWidgets from openlp.core.common.registry import Registry from openlp.core.lib.mediamanageritem import MediaManagerItem -from openlp.plugins.bibles.lib.mediaitem import BibleMediaItem, BibleSearch, ResultsTab, SearchStatus, SearchTabs, \ - get_reference_separators, VALID_TEXT_SEARCH +from openlp.plugins.bibles.lib.mediaitem import VALID_TEXT_SEARCH, BibleMediaItem, BibleSearch, ResultsTab, \ + SearchStatus, SearchTabs, get_reference_separators from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_plugins/bibles/test_opensongimport.py b/tests/functional/openlp_plugins/bibles/test_opensongimport.py index d02fffd5e..b9bf2dcd7 100644 --- a/tests/functional/openlp_plugins/bibles/test_opensongimport.py +++ b/tests/functional/openlp_plugins/bibles/test_opensongimport.py @@ -23,7 +23,7 @@ This module contains tests for the OpenSong Bible importer. """ from unittest import TestCase -from unittest.mock import MagicMock, patch, call +from unittest.mock import MagicMock, call, patch from lxml import objectify @@ -34,6 +34,7 @@ from tests.helpers.testmixin import TestMixin from tests.utils import load_external_result_data from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'bibles' diff --git a/tests/functional/openlp_plugins/bibles/test_osisimport.py b/tests/functional/openlp_plugins/bibles/test_osisimport.py index 93cc7d05d..d87bfa1a1 100644 --- a/tests/functional/openlp_plugins/bibles/test_osisimport.py +++ b/tests/functional/openlp_plugins/bibles/test_osisimport.py @@ -31,6 +31,7 @@ from openlp.plugins.bibles.lib.importers.osis import OSISBible from tests.utils import load_external_result_data from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'bibles' diff --git a/tests/functional/openlp_plugins/bibles/test_swordimport.py b/tests/functional/openlp_plugins/bibles/test_swordimport.py index aecf5c597..5c0596814 100644 --- a/tests/functional/openlp_plugins/bibles/test_swordimport.py +++ b/tests/functional/openlp_plugins/bibles/test_swordimport.py @@ -25,16 +25,18 @@ This module contains tests for the SWORD Bible importer. from unittest import TestCase, skipUnless from unittest.mock import MagicMock, patch +from openlp.plugins.bibles.lib.db import BibleDB +from tests.utils import load_external_result_data +from tests.utils.constants import RESOURCE_PATH + + try: from openlp.plugins.bibles.lib.importers.sword import SwordBible HAS_PYSWORD = True except ImportError: HAS_PYSWORD = False -from openlp.plugins.bibles.lib.db import BibleDB -from tests.utils import load_external_result_data -from tests.utils.constants import RESOURCE_PATH TEST_PATH = RESOURCE_PATH / 'bibles' diff --git a/tests/functional/openlp_plugins/bibles/test_wordprojectimport.py b/tests/functional/openlp_plugins/bibles/test_wordprojectimport.py index 388da45f9..1699371ef 100644 --- a/tests/functional/openlp_plugins/bibles/test_wordprojectimport.py +++ b/tests/functional/openlp_plugins/bibles/test_wordprojectimport.py @@ -23,12 +23,13 @@ This module contains tests for the WordProject Bible importer. """ from unittest import TestCase -from unittest.mock import MagicMock, patch, call +from unittest.mock import MagicMock, call, patch from openlp.core.common.path import Path from openlp.plugins.bibles.lib.importers.wordproject import WordProjectBible from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'bibles' INDEX_PAGE = (TEST_PATH / 'wordproject_index.htm').read_bytes().decode() CHAPTER_PAGE = (TEST_PATH / 'wordproject_chapter.htm').read_bytes().decode() diff --git a/tests/functional/openlp_plugins/bibles/test_zefaniaimport.py b/tests/functional/openlp_plugins/bibles/test_zefaniaimport.py index 3252ac152..dc36330c6 100644 --- a/tests/functional/openlp_plugins/bibles/test_zefaniaimport.py +++ b/tests/functional/openlp_plugins/bibles/test_zefaniaimport.py @@ -30,6 +30,7 @@ from openlp.plugins.bibles.lib.importers.zefania import ZefaniaBible from tests.utils import load_external_result_data from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'bibles' diff --git a/tests/functional/openlp_plugins/custom/test_mediaitem.py b/tests/functional/openlp_plugins/custom/test_mediaitem.py index e934adb10..7dfecf2b6 100644 --- a/tests/functional/openlp_plugins/custom/test_mediaitem.py +++ b/tests/functional/openlp_plugins/custom/test_mediaitem.py @@ -23,7 +23,7 @@ This module contains tests for the lib submodule of the Songs plugin. """ from unittest import TestCase -from unittest.mock import patch, MagicMock +from unittest.mock import MagicMock, patch from PyQt5 import QtCore @@ -33,6 +33,7 @@ from openlp.core.lib.serviceitem import ServiceItem from openlp.plugins.custom.lib import CustomMediaItem from tests.helpers.testmixin import TestMixin + FOOTER = ['Arky Arky (Unknown)', 'Public Domain', 'CCLI 123456'] diff --git a/tests/functional/openlp_plugins/images/test_imagetab.py b/tests/functional/openlp_plugins/images/test_imagetab.py index 813be4e88..21a8f87df 100644 --- a/tests/functional/openlp_plugins/images/test_imagetab.py +++ b/tests/functional/openlp_plugins/images/test_imagetab.py @@ -32,6 +32,7 @@ from openlp.core.common.settings import Settings from openlp.plugins.images.lib import ImageTab from tests.helpers.testmixin import TestMixin + __default_settings__ = { 'images/db type': 'sqlite', 'images/background color': '#000000', diff --git a/tests/functional/openlp_plugins/images/test_upgrade.py b/tests/functional/openlp_plugins/images/test_upgrade.py index 20c090a2b..b2d17d4de 100644 --- a/tests/functional/openlp_plugins/images/test_upgrade.py +++ b/tests/functional/openlp_plugins/images/test_upgrade.py @@ -37,6 +37,7 @@ from openlp.plugins.images.lib.db import ImageFilenames, init_schema from tests.helpers.testmixin import TestMixin from tests.utils.constants import TEST_RESOURCES_PATH + __default_settings__ = { 'images/db type': 'sqlite', 'images/background color': '#000000', diff --git a/tests/functional/openlp_plugins/media/test_mediaitem.py b/tests/functional/openlp_plugins/media/test_mediaitem.py index 8e1035161..94fb84958 100644 --- a/tests/functional/openlp_plugins/media/test_mediaitem.py +++ b/tests/functional/openlp_plugins/media/test_mediaitem.py @@ -32,6 +32,7 @@ from openlp.core.common.settings import Settings from openlp.plugins.media.lib.mediaitem import MediaMediaItem from tests.helpers.testmixin import TestMixin + __default_settings__ = { 'media/media auto start': QtCore.Qt.Unchecked, 'media/media files': [] diff --git a/tests/functional/openlp_plugins/presentations/test_impresscontroller.py b/tests/functional/openlp_plugins/presentations/test_impresscontroller.py index d3a911cec..6ecdeef70 100644 --- a/tests/functional/openlp_plugins/presentations/test_impresscontroller.py +++ b/tests/functional/openlp_plugins/presentations/test_impresscontroller.py @@ -31,9 +31,8 @@ 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__ - -from tests.utils.constants import RESOURCE_PATH from tests.helpers.testmixin import TestMixin +from tests.utils.constants import RESOURCE_PATH class TestImpressController(TestCase, TestMixin): diff --git a/tests/functional/openlp_plugins/presentations/test_mediaitem.py b/tests/functional/openlp_plugins/presentations/test_mediaitem.py index f8375be2c..d4fa46651 100644 --- a/tests/functional/openlp_plugins/presentations/test_mediaitem.py +++ b/tests/functional/openlp_plugins/presentations/test_mediaitem.py @@ -23,7 +23,7 @@ This module contains tests for the lib submodule of the Presentations plugin. """ from unittest import TestCase -from unittest.mock import patch, MagicMock, call +from unittest.mock import MagicMock, call, patch from openlp.core.common.path import Path from openlp.core.common.registry import Registry diff --git a/tests/functional/openlp_plugins/presentations/test_messagelistener.py b/tests/functional/openlp_plugins/presentations/test_messagelistener.py index 051f1e1a4..c0512af0d 100644 --- a/tests/functional/openlp_plugins/presentations/test_messagelistener.py +++ b/tests/functional/openlp_plugins/presentations/test_messagelistener.py @@ -23,7 +23,7 @@ This module contains tests for the lib submodule of the Presentations plugin. """ from unittest import TestCase -from unittest.mock import patch, MagicMock +from unittest.mock import MagicMock, patch from openlp.core.common.registry import Registry from openlp.plugins.presentations.lib.mediaitem import MessageListener, PresentationMediaItem diff --git a/tests/functional/openlp_plugins/presentations/test_pdfcontroller.py b/tests/functional/openlp_plugins/presentations/test_pdfcontroller.py index 80f84f9fa..98aa3a34e 100644 --- a/tests/functional/openlp_plugins/presentations/test_pdfcontroller.py +++ b/tests/functional/openlp_plugins/presentations/test_pdfcontroller.py @@ -24,7 +24,7 @@ This module contains tests for the PdfController """ import os from tempfile import mkdtemp -from unittest import TestCase, SkipTest +from unittest import SkipTest, TestCase from unittest.mock import MagicMock, patch from PyQt5 import QtCore, QtGui @@ -33,9 +33,9 @@ from openlp.core.common.path import Path from openlp.core.common.settings import Settings from openlp.core.display.screens import ScreenList from openlp.plugins.presentations.lib.pdfcontroller import PdfController, PdfDocument - -from tests.utils.constants import RESOURCE_PATH from tests.helpers.testmixin import TestMixin +from tests.utils.constants import RESOURCE_PATH + __default_settings__ = { 'presentations/enable_pdf_program': False, diff --git a/tests/functional/openlp_plugins/presentations/test_powerpointcontroller.py b/tests/functional/openlp_plugins/presentations/test_powerpointcontroller.py index 3ebe0ede8..f5858c2b4 100644 --- a/tests/functional/openlp_plugins/presentations/test_powerpointcontroller.py +++ b/tests/functional/openlp_plugins/presentations/test_powerpointcontroller.py @@ -26,7 +26,7 @@ import os import shutil from tempfile import mkdtemp from unittest import TestCase -from unittest.mock import patch, MagicMock +from unittest.mock import MagicMock, patch from openlp.core.common import is_win from openlp.core.common.settings import Settings @@ -35,6 +35,7 @@ from openlp.plugins.presentations.lib.powerpointcontroller import PowerpointCont from tests.helpers.testmixin import TestMixin from tests.utils.constants import TEST_RESOURCES_PATH + if is_win(): import pywintypes diff --git a/tests/functional/openlp_plugins/presentations/test_presentationcontroller.py b/tests/functional/openlp_plugins/presentations/test_presentationcontroller.py index 4383122e8..1337762dd 100644 --- a/tests/functional/openlp_plugins/presentations/test_presentationcontroller.py +++ b/tests/functional/openlp_plugins/presentations/test_presentationcontroller.py @@ -29,6 +29,7 @@ from unittest.mock import MagicMock, call, patch from openlp.core.common.path import Path from openlp.plugins.presentations.lib.presentationcontroller import PresentationController, PresentationDocument + FOLDER_TO_PATCH = 'openlp.plugins.presentations.lib.presentationcontroller.PresentationDocument.get_thumbnail_folder' diff --git a/tests/functional/openlp_plugins/songs/test_chordproimport.py b/tests/functional/openlp_plugins/songs/test_chordproimport.py index d2b8ee1dc..2db9b764e 100644 --- a/tests/functional/openlp_plugins/songs/test_chordproimport.py +++ b/tests/functional/openlp_plugins/songs/test_chordproimport.py @@ -22,11 +22,12 @@ """ This module contains tests for the OpenSong song importer. """ -from unittest.mock import patch, MagicMock +from unittest.mock import MagicMock, patch from tests.helpers.songfileimport import SongImportTestHelper from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'songs' / 'chordpro' diff --git a/tests/functional/openlp_plugins/songs/test_db.py b/tests/functional/openlp_plugins/songs/test_db.py index 1078bfca4..e15f5ec43 100644 --- a/tests/functional/openlp_plugins/songs/test_db.py +++ b/tests/functional/openlp_plugins/songs/test_db.py @@ -29,7 +29,7 @@ from unittest import TestCase from openlp.core.lib.db import upgrade_db from openlp.plugins.songs.lib import upgrade -from openlp.plugins.songs.lib.db import Song, Author, AuthorType, Book +from openlp.plugins.songs.lib.db import Author, AuthorType, Book, Song from tests.utils.constants import TEST_RESOURCES_PATH diff --git a/tests/functional/openlp_plugins/songs/test_easyslidesimport.py b/tests/functional/openlp_plugins/songs/test_easyslidesimport.py index 7e6c52e96..2bfafb785 100644 --- a/tests/functional/openlp_plugins/songs/test_easyslidesimport.py +++ b/tests/functional/openlp_plugins/songs/test_easyslidesimport.py @@ -24,6 +24,7 @@ This module contains tests for the EasySlides song importer. from tests.helpers.songfileimport import SongImportTestHelper from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'songs' / 'easyslides' diff --git a/tests/functional/openlp_plugins/songs/test_editsongform.py b/tests/functional/openlp_plugins/songs/test_editsongform.py index 650f9ca91..b367e5c7d 100644 --- a/tests/functional/openlp_plugins/songs/test_editsongform.py +++ b/tests/functional/openlp_plugins/songs/test_editsongform.py @@ -23,7 +23,7 @@ This module contains tests for the lib submodule of the Songs plugin. """ from unittest import TestCase -from unittest.mock import patch, MagicMock +from unittest.mock import MagicMock, patch from PyQt5 import QtCore diff --git a/tests/functional/openlp_plugins/songs/test_editverseform.py b/tests/functional/openlp_plugins/songs/test_editverseform.py index f269b262c..9c2b56436 100644 --- a/tests/functional/openlp_plugins/songs/test_editverseform.py +++ b/tests/functional/openlp_plugins/songs/test_editverseform.py @@ -31,6 +31,7 @@ from openlp.core.common.settings import Settings from openlp.plugins.songs.forms.editverseform import EditVerseForm from tests.helpers.testmixin import TestMixin + __default_settings__ = { 'songs/enable chords': True, } diff --git a/tests/functional/openlp_plugins/songs/test_ewimport.py b/tests/functional/openlp_plugins/songs/test_ewimport.py index 39835e677..21c9e1293 100644 --- a/tests/functional/openlp_plugins/songs/test_ewimport.py +++ b/tests/functional/openlp_plugins/songs/test_ewimport.py @@ -30,6 +30,7 @@ from openlp.core.common.registry import Registry from openlp.plugins.songs.lib.importers.easyworship import EasyWorshipSongImport, FieldDescEntry, FieldType from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'songs' / 'easyworship' SONG_TEST_DATA = [ {'title': 'Amazing Grace', diff --git a/tests/functional/openlp_plugins/songs/test_foilpresenterimport.py b/tests/functional/openlp_plugins/songs/test_foilpresenterimport.py index 9c0af59a4..7d872241e 100644 --- a/tests/functional/openlp_plugins/songs/test_foilpresenterimport.py +++ b/tests/functional/openlp_plugins/songs/test_foilpresenterimport.py @@ -23,7 +23,7 @@ This module contains tests for the SongShow Plus song importer. """ from unittest import TestCase -from unittest.mock import patch, MagicMock +from unittest.mock import MagicMock, patch from openlp.plugins.songs.lib.importers.foilpresenter import FoilPresenter diff --git a/tests/functional/openlp_plugins/songs/test_lib.py b/tests/functional/openlp_plugins/songs/test_lib.py index 09011a3e3..a40835cd4 100644 --- a/tests/functional/openlp_plugins/songs/test_lib.py +++ b/tests/functional/openlp_plugins/songs/test_lib.py @@ -23,10 +23,10 @@ This module contains tests for the lib submodule of the Songs plugin. """ from unittest import TestCase -from unittest.mock import patch, MagicMock, PropertyMock +from unittest.mock import MagicMock, PropertyMock, patch from openlp.plugins.songs.lib import VerseType, clean_string, clean_title, strip_rtf, transpose_chord, transpose_lyrics -from openlp.plugins.songs.lib.songcompare import songs_probably_equal, _remove_typos, _op_length +from openlp.plugins.songs.lib.songcompare import _op_length, _remove_typos, songs_probably_equal class TestLib(TestCase): diff --git a/tests/functional/openlp_plugins/songs/test_lyriximport.py b/tests/functional/openlp_plugins/songs/test_lyriximport.py index eea29fceb..ab1028820 100644 --- a/tests/functional/openlp_plugins/songs/test_lyriximport.py +++ b/tests/functional/openlp_plugins/songs/test_lyriximport.py @@ -24,6 +24,7 @@ This module contains tests for the LyriX song importer. from tests.helpers.songfileimport import SongImportTestHelper from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'songs' / 'lyrix' diff --git a/tests/functional/openlp_plugins/songs/test_mediaitem.py b/tests/functional/openlp_plugins/songs/test_mediaitem.py index a63e16a72..b8a413868 100644 --- a/tests/functional/openlp_plugins/songs/test_mediaitem.py +++ b/tests/functional/openlp_plugins/songs/test_mediaitem.py @@ -23,7 +23,7 @@ This module contains tests for the lib submodule of the Songs plugin. """ from unittest import TestCase -from unittest.mock import MagicMock, patch, call +from unittest.mock import MagicMock, call, patch from PyQt5 import QtCore diff --git a/tests/functional/openlp_plugins/songs/test_mediashout.py b/tests/functional/openlp_plugins/songs/test_mediashout.py index 15adfded0..c9901ac82 100644 --- a/tests/functional/openlp_plugins/songs/test_mediashout.py +++ b/tests/functional/openlp_plugins/songs/test_mediashout.py @@ -24,10 +24,11 @@ Test the MediaShout importer """ from collections import namedtuple from unittest import TestCase, skipUnless -from unittest.mock import MagicMock, patch, call +from unittest.mock import MagicMock, call, patch from openlp.core.common.registry import Registry + try: from openlp.plugins.songs.lib.importers.mediashout import MediaShoutImport CAN_RUN_TESTS = True diff --git a/tests/functional/openlp_plugins/songs/test_openlpimporter.py b/tests/functional/openlp_plugins/songs/test_openlpimporter.py index 5bf9d3a9a..90b5de39b 100644 --- a/tests/functional/openlp_plugins/songs/test_openlpimporter.py +++ b/tests/functional/openlp_plugins/songs/test_openlpimporter.py @@ -23,7 +23,7 @@ This module contains tests for the OpenLP song importer. """ from unittest import TestCase -from unittest.mock import patch, MagicMock +from unittest.mock import MagicMock, patch from openlp.core.common.registry import Registry from openlp.plugins.songs.lib.importers.openlp import OpenLPSongImport diff --git a/tests/functional/openlp_plugins/songs/test_openlyricsimport.py b/tests/functional/openlp_plugins/songs/test_openlyricsimport.py index d3356666e..864c76114 100644 --- a/tests/functional/openlp_plugins/songs/test_openlyricsimport.py +++ b/tests/functional/openlp_plugins/songs/test_openlyricsimport.py @@ -36,6 +36,7 @@ from openlp.plugins.songs.lib.openlyricsxml import OpenLyrics from tests.helpers.testmixin import TestMixin from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'songs' / 'openlyrics' SONG_TEST_DATA = { 'What a friend we have in Jesus.xml': { diff --git a/tests/functional/openlp_plugins/songs/test_openoffice.py b/tests/functional/openlp_plugins/songs/test_openoffice.py index 8821865d7..1a5700f8d 100644 --- a/tests/functional/openlp_plugins/songs/test_openoffice.py +++ b/tests/functional/openlp_plugins/songs/test_openoffice.py @@ -28,6 +28,7 @@ from unittest.mock import MagicMock, patch from openlp.core.common.registry import Registry from tests.helpers.testmixin import TestMixin + try: from openlp.plugins.songs.lib.importers.openoffice import OpenOfficeImport except ImportError: diff --git a/tests/functional/openlp_plugins/songs/test_opensongimport.py b/tests/functional/openlp_plugins/songs/test_opensongimport.py index b4c892f3e..d8744048e 100644 --- a/tests/functional/openlp_plugins/songs/test_opensongimport.py +++ b/tests/functional/openlp_plugins/songs/test_opensongimport.py @@ -23,13 +23,14 @@ This module contains tests for the OpenSong song importer. """ from unittest import TestCase -from unittest.mock import patch, MagicMock +from unittest.mock import MagicMock, patch from openlp.core.common.registry import Registry from openlp.plugins.songs.lib.importers.opensong import OpenSongImport from tests.helpers.songfileimport import SongImportTestHelper from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'songs' / 'opensong' diff --git a/tests/functional/openlp_plugins/songs/test_opsproimport.py b/tests/functional/openlp_plugins/songs/test_opsproimport.py index 2c9e61ee9..f6b5d4f57 100644 --- a/tests/functional/openlp_plugins/songs/test_opsproimport.py +++ b/tests/functional/openlp_plugins/songs/test_opsproimport.py @@ -23,7 +23,11 @@ This module contains tests for the WorshipCenter Pro song importer. """ from unittest import TestCase, skipUnless -from unittest.mock import patch, MagicMock +from unittest.mock import MagicMock, patch + +from tests.utils import load_external_result_data +from tests.utils.constants import RESOURCE_PATH + try: from openlp.core.common.registry import Registry @@ -32,8 +36,6 @@ try: except ImportError: CAN_RUN_TESTS = False -from tests.utils import load_external_result_data -from tests.utils.constants import RESOURCE_PATH TEST_PATH = RESOURCE_PATH / 'songs' / 'opspro' diff --git a/tests/functional/openlp_plugins/songs/test_powerpraiseimport.py b/tests/functional/openlp_plugins/songs/test_powerpraiseimport.py index ae823fb03..e3c4ce6f3 100644 --- a/tests/functional/openlp_plugins/songs/test_powerpraiseimport.py +++ b/tests/functional/openlp_plugins/songs/test_powerpraiseimport.py @@ -26,6 +26,7 @@ ProPresenter song files into the current installation database. from tests.helpers.songfileimport import SongImportTestHelper from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'songs' / 'powerpraise' diff --git a/tests/functional/openlp_plugins/songs/test_presentationmanagerimport.py b/tests/functional/openlp_plugins/songs/test_presentationmanagerimport.py index 88524a38d..4d992937e 100644 --- a/tests/functional/openlp_plugins/songs/test_presentationmanagerimport.py +++ b/tests/functional/openlp_plugins/songs/test_presentationmanagerimport.py @@ -25,6 +25,7 @@ This module contains tests for the PresentationManager song importer. from tests.helpers.songfileimport import SongImportTestHelper from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'songs' / 'presentationmanager' diff --git a/tests/functional/openlp_plugins/songs/test_propresenterimport.py b/tests/functional/openlp_plugins/songs/test_propresenterimport.py index fccae340d..3540fca58 100644 --- a/tests/functional/openlp_plugins/songs/test_propresenterimport.py +++ b/tests/functional/openlp_plugins/songs/test_propresenterimport.py @@ -26,6 +26,7 @@ ProPresenter song files into the current installation database. from tests.helpers.songfileimport import SongImportTestHelper from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'songs' / 'propresenter' diff --git a/tests/functional/openlp_plugins/songs/test_songbeamerimport.py b/tests/functional/openlp_plugins/songs/test_songbeamerimport.py index 4118ac837..2f0e65729 100644 --- a/tests/functional/openlp_plugins/songs/test_songbeamerimport.py +++ b/tests/functional/openlp_plugins/songs/test_songbeamerimport.py @@ -30,6 +30,7 @@ from openlp.plugins.songs.lib.importers.songbeamer import SongBeamerImport, Song from tests.helpers.songfileimport import SongImportTestHelper from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'songs' / 'songbeamer' diff --git a/tests/functional/openlp_plugins/songs/test_songproimport.py b/tests/functional/openlp_plugins/songs/test_songproimport.py index 4b3b7884c..9fb49342e 100644 --- a/tests/functional/openlp_plugins/songs/test_songproimport.py +++ b/tests/functional/openlp_plugins/songs/test_songproimport.py @@ -26,6 +26,7 @@ SongPro song files into the current installation database. from tests.helpers.songfileimport import SongImportTestHelper from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'songs' / 'songpro' diff --git a/tests/functional/openlp_plugins/songs/test_songselect.py b/tests/functional/openlp_plugins/songs/test_songselect.py index aa55fca20..61736e853 100644 --- a/tests/functional/openlp_plugins/songs/test_songselect.py +++ b/tests/functional/openlp_plugins/songs/test_songselect.py @@ -24,19 +24,20 @@ This module contains tests for the CCLI SongSelect importer. """ from unittest import TestCase -from unittest.mock import MagicMock, patch, call +from unittest.mock import MagicMock, call, patch from urllib.error import URLError from PyQt5 import QtWidgets from openlp.core.common.registry import Registry -from openlp.plugins.songs.forms.songselectform import SongSelectForm, SearchWorker +from openlp.plugins.songs.forms.songselectform import SearchWorker, SongSelectForm from openlp.plugins.songs.lib import Song -from openlp.plugins.songs.lib.songselect import SongSelectImport, LOGOUT_URL, BASE_URL +from openlp.plugins.songs.lib.songselect import BASE_URL, LOGOUT_URL, SongSelectImport from tests.helpers.songfileimport import SongImportTestHelper from tests.helpers.testmixin import TestMixin from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'songs' / 'songselect' diff --git a/tests/functional/openlp_plugins/songs/test_songshowplusimport.py b/tests/functional/openlp_plugins/songs/test_songshowplusimport.py index 9f3df41a9..93f7519db 100644 --- a/tests/functional/openlp_plugins/songs/test_songshowplusimport.py +++ b/tests/functional/openlp_plugins/songs/test_songshowplusimport.py @@ -23,13 +23,14 @@ This module contains tests for the SongShow Plus song importer. """ from unittest import TestCase -from unittest.mock import patch, MagicMock +from unittest.mock import MagicMock, patch from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib.importers.songshowplus import SongShowPlusImport from tests.helpers.songfileimport import SongImportTestHelper from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'songs' / 'songshowplus' diff --git a/tests/functional/openlp_plugins/songs/test_sundayplusimport.py b/tests/functional/openlp_plugins/songs/test_sundayplusimport.py index 05874de46..540557f57 100644 --- a/tests/functional/openlp_plugins/songs/test_sundayplusimport.py +++ b/tests/functional/openlp_plugins/songs/test_sundayplusimport.py @@ -26,6 +26,7 @@ from unittest.mock import patch from tests.helpers.songfileimport import SongImportTestHelper from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'songs' / 'sundayplus' diff --git a/tests/functional/openlp_plugins/songs/test_videopsalm.py b/tests/functional/openlp_plugins/songs/test_videopsalm.py index 8c97ab8a0..ff69beab4 100644 --- a/tests/functional/openlp_plugins/songs/test_videopsalm.py +++ b/tests/functional/openlp_plugins/songs/test_videopsalm.py @@ -21,11 +21,12 @@ """ This module contains tests for the VideoPsalm song importer. """ -from unittest.mock import patch, MagicMock +from unittest.mock import MagicMock, patch from tests.helpers.songfileimport import SongImportTestHelper from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'songs' / 'videopsalm' diff --git a/tests/functional/openlp_plugins/songs/test_wordsofworshipimport.py b/tests/functional/openlp_plugins/songs/test_wordsofworshipimport.py index 445f1545f..5091f6ec2 100644 --- a/tests/functional/openlp_plugins/songs/test_wordsofworshipimport.py +++ b/tests/functional/openlp_plugins/songs/test_wordsofworshipimport.py @@ -25,6 +25,7 @@ This module contains tests for the Words of Worship song importer. from tests.helpers.songfileimport import SongImportTestHelper from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'songs' / 'wordsofworship' diff --git a/tests/functional/openlp_plugins/songs/test_worshipassistantimport.py b/tests/functional/openlp_plugins/songs/test_worshipassistantimport.py index c29970680..042ff8c63 100644 --- a/tests/functional/openlp_plugins/songs/test_worshipassistantimport.py +++ b/tests/functional/openlp_plugins/songs/test_worshipassistantimport.py @@ -26,6 +26,7 @@ WorshipAssistant song files into the current installation database. from tests.helpers.songfileimport import SongImportTestHelper from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'songs' / 'worshipassistant' diff --git a/tests/functional/openlp_plugins/songs/test_worshipcenterproimport.py b/tests/functional/openlp_plugins/songs/test_worshipcenterproimport.py index ac3fa2ba0..b8ba223ae 100644 --- a/tests/functional/openlp_plugins/songs/test_worshipcenterproimport.py +++ b/tests/functional/openlp_plugins/songs/test_worshipcenterproimport.py @@ -23,7 +23,8 @@ This module contains tests for the WorshipCenter Pro song importer. """ from unittest import TestCase, skipUnless -from unittest.mock import patch, MagicMock +from unittest.mock import MagicMock, patch + try: import pyodbc diff --git a/tests/functional/openlp_plugins/songs/test_zionworximport.py b/tests/functional/openlp_plugins/songs/test_zionworximport.py index 0856e273e..13732691b 100644 --- a/tests/functional/openlp_plugins/songs/test_zionworximport.py +++ b/tests/functional/openlp_plugins/songs/test_zionworximport.py @@ -31,6 +31,7 @@ from openlp.plugins.songs.lib.importers.zionworx import ZionWorxImport from tests.helpers.songfileimport import SongImportTestHelper from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'songs' / 'zionworx' diff --git a/tests/helpers/songfileimport.py b/tests/helpers/songfileimport.py index ee41cbfec..f903a145e 100644 --- a/tests/helpers/songfileimport.py +++ b/tests/helpers/songfileimport.py @@ -26,10 +26,11 @@ song files from third party applications. import json import logging from unittest import TestCase -from unittest.mock import MagicMock, patch, call +from unittest.mock import MagicMock, call, patch from openlp.core.common.registry import Registry + log = logging.getLogger(__name__) diff --git a/tests/interfaces/openlp_core/common/test_utils.py b/tests/interfaces/openlp_core/common/test_utils.py index 300eb2c0b..e4431b7ea 100644 --- a/tests/interfaces/openlp_core/common/test_utils.py +++ b/tests/interfaces/openlp_core/common/test_utils.py @@ -26,9 +26,8 @@ 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 +from tests.utils.constants import RESOURCE_PATH class TestUtils(TestCase, TestMixin): diff --git a/tests/interfaces/openlp_core/ui/media/vendor/test_mediainfoWrapper.py b/tests/interfaces/openlp_core/ui/media/vendor/test_mediainfoWrapper.py index 1d106e1d4..ca908745e 100644 --- a/tests/interfaces/openlp_core/ui/media/vendor/test_mediainfoWrapper.py +++ b/tests/interfaces/openlp_core/ui/media/vendor/test_mediainfoWrapper.py @@ -27,6 +27,7 @@ from unittest import TestCase from openlp.core.ui.media.vendor.mediainfoWrapper import MediaInfoWrapper from tests.utils.constants import RESOURCE_PATH + TEST_PATH = RESOURCE_PATH / 'media' TEST_MEDIA = [['avi_file.avi', 61495], ['mp3_file.mp3', 134426], ['mpg_file.mpg', 9404], ['mp4_file.mp4', 188336]] diff --git a/tests/interfaces/openlp_core/ui/test_servicemanager.py b/tests/interfaces/openlp_core/ui/test_servicemanager.py index 007b3fb8a..2e71509ff 100644 --- a/tests/interfaces/openlp_core/ui/test_servicemanager.py +++ b/tests/interfaces/openlp_core/ui/test_servicemanager.py @@ -27,12 +27,12 @@ from unittest.mock import MagicMock, patch from PyQt5 import QtCore, QtGui, QtWidgets - from openlp.core.common.registry import Registry -from openlp.core.lib.serviceitem import ServiceItem, ItemCapabilities +from openlp.core.lib.serviceitem import ItemCapabilities, ServiceItem from openlp.core.ui.servicemanager import ServiceManager from tests.helpers.testmixin import TestMixin + class TestServiceManager(TestCase, TestMixin): """ Test the service manager diff --git a/tests/interfaces/openlp_core/ui/test_settings_form.py b/tests/interfaces/openlp_core/ui/test_settings_form.py index 39cb783f0..44618cb59 100644 --- a/tests/interfaces/openlp_core/ui/test_settings_form.py +++ b/tests/interfaces/openlp_core/ui/test_settings_form.py @@ -32,6 +32,7 @@ from openlp.core.display.screens import ScreenList from openlp.core.ui import settingsform from tests.helpers.testmixin import TestMixin + SCREEN = { 'primary': False, 'number': 1, diff --git a/tests/interfaces/openlp_core/ui/test_thememanager.py b/tests/interfaces/openlp_core/ui/test_thememanager.py index ea4beef01..8c1dfa5f8 100644 --- a/tests/interfaces/openlp_core/ui/test_thememanager.py +++ b/tests/interfaces/openlp_core/ui/test_thememanager.py @@ -23,7 +23,7 @@ Interface tests to test the themeManager class and related methods. """ from unittest import TestCase -from unittest.mock import patch, MagicMock +from unittest.mock import MagicMock, patch from openlp.core.common.path import Path from openlp.core.common.registry import Registry diff --git a/tests/interfaces/openlp_core/widgets/test_edits.py b/tests/interfaces/openlp_core/widgets/test_edits.py index 373b54d35..4b7e33c00 100644 --- a/tests/interfaces/openlp_core/widgets/test_edits.py +++ b/tests/interfaces/openlp_core/widgets/test_edits.py @@ -28,7 +28,7 @@ from unittest.mock import MagicMock, call, patch from PyQt5 import QtCore, QtGui, QtTest, QtWidgets from openlp.core.common.registry import Registry -from openlp.core.widgets.edits import SearchEdit, HistoryComboBox +from openlp.core.widgets.edits import HistoryComboBox, SearchEdit from tests.helpers.testmixin import TestMixin diff --git a/tests/interfaces/openlp_plugins/bibles/test_lib_http.py b/tests/interfaces/openlp_plugins/bibles/test_lib_http.py index 3160a2ad6..2649439ce 100644 --- a/tests/interfaces/openlp_plugins/bibles/test_lib_http.py +++ b/tests/interfaces/openlp_plugins/bibles/test_lib_http.py @@ -27,7 +27,7 @@ from unittest import TestCase, skipIf from unittest.mock import MagicMock from openlp.core.common.registry import Registry -from openlp.plugins.bibles.lib.importers.http import BGExtract, CWExtract, BSExtract +from openlp.plugins.bibles.lib.importers.http import BGExtract, BSExtract, CWExtract @skipIf(os.environ.get('JENKINS_URL'), 'Skip Bible HTTP tests to prevent Jenkins from being blacklisted') diff --git a/tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py b/tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py index bf1057667..5d276a1ba 100644 --- a/tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py +++ b/tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py @@ -27,7 +27,7 @@ from unittest.mock import MagicMock, patch 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 BibleManager, LanguageSelection, parse_reference from tests.helpers.testmixin import TestMixin from tests.utils.constants import TEST_RESOURCES_PATH diff --git a/tests/interfaces/openlp_plugins/custom/forms/test_customform.py b/tests/interfaces/openlp_plugins/custom/forms/test_customform.py index 96f265970..bbe86b0dd 100644 --- a/tests/interfaces/openlp_plugins/custom/forms/test_customform.py +++ b/tests/interfaces/openlp_plugins/custom/forms/test_customform.py @@ -25,7 +25,7 @@ Module to test the EditCustomForm. from unittest import TestCase from unittest.mock import MagicMock, patch -from PyQt5 import QtTest, QtCore, QtWidgets +from PyQt5 import QtCore, QtTest, QtWidgets from openlp.core.common.registry import Registry from openlp.plugins.custom.forms.editcustomform import EditCustomForm diff --git a/tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py b/tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py index 69e98da5d..bcc64e558 100644 --- a/tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py +++ b/tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py @@ -23,20 +23,22 @@ Module to test the MediaClipSelectorForm. """ import os -from unittest import TestCase, SkipTest +from unittest import SkipTest, TestCase from unittest.mock import MagicMock, patch +from PyQt5 import QtCore, QtTest, QtWidgets + +from openlp.core.common.registry import Registry from openlp.core.ui.media.vlcplayer import get_vlc +from openlp.plugins.media.forms.mediaclipselectorform import MediaClipSelectorForm +from tests.helpers.testmixin import TestMixin + if os.name == 'nt' and not get_vlc(): raise SkipTest('Windows without VLC, skipping this test since it cannot run without vlc') -from PyQt5 import QtTest, QtCore, QtWidgets -from openlp.core.common.registry import Registry -from openlp.plugins.media.forms.mediaclipselectorform import MediaClipSelectorForm -from tests.helpers.testmixin import TestMixin class TestMediaClipSelectorForm(TestCase, TestMixin): diff --git a/tests/interfaces/openlp_plugins/songs/forms/test_editsongform.py b/tests/interfaces/openlp_plugins/songs/forms/test_editsongform.py index ab9384863..99e5db51d 100644 --- a/tests/interfaces/openlp_plugins/songs/forms/test_editsongform.py +++ b/tests/interfaces/openlp_plugins/songs/forms/test_editsongform.py @@ -33,6 +33,7 @@ from openlp.core.common.settings import Settings from openlp.plugins.songs.forms.editsongform import EditSongForm from tests.helpers.testmixin import TestMixin + __default_settings__ = { 'songs/enable chords': True, } diff --git a/tests/interfaces/openlp_plugins/songs/forms/test_editverseform.py b/tests/interfaces/openlp_plugins/songs/forms/test_editverseform.py index 500d52af3..7ec7d15a6 100644 --- a/tests/interfaces/openlp_plugins/songs/forms/test_editverseform.py +++ b/tests/interfaces/openlp_plugins/songs/forms/test_editverseform.py @@ -31,6 +31,7 @@ from openlp.core.common.settings import Settings from openlp.plugins.songs.forms.editverseform import EditVerseForm from tests.helpers.testmixin import TestMixin + __default_settings__ = { 'songs/enable chords': True, } diff --git a/tests/interfaces/openlp_plugins/songs/forms/test_songmaintenanceform.py b/tests/interfaces/openlp_plugins/songs/forms/test_songmaintenanceform.py index 6b1788690..45bf162b4 100644 --- a/tests/interfaces/openlp_plugins/songs/forms/test_songmaintenanceform.py +++ b/tests/interfaces/openlp_plugins/songs/forms/test_songmaintenanceform.py @@ -23,7 +23,7 @@ Package to test the openlp.plugins.songs.forms.songmaintenanceform package. """ from unittest import TestCase -from unittest.mock import MagicMock, patch, call +from unittest.mock import MagicMock, call, patch from PyQt5 import QtCore, QtWidgets diff --git a/tests/openlp_core/projectors/test_projector_bugfixes_01.py b/tests/openlp_core/projectors/test_projector_bugfixes_01.py index 0f5307b53..5e12a7658 100644 --- a/tests/openlp_core/projectors/test_projector_bugfixes_01.py +++ b/tests/openlp_core/projectors/test_projector_bugfixes_01.py @@ -24,6 +24,7 @@ Package to test the openlp.core.projectors.pjlink base package. """ from unittest import TestCase + # from openlp.core.projectors.db import Projector # from openlp.core.projectors.pjlink import PJLink # from tests.resources.projector.data import TEST1_DATA diff --git a/tests/openlp_core/projectors/test_projector_constants.py b/tests/openlp_core/projectors/test_projector_constants.py index 6ef4d2118..e009ae1ea 100644 --- a/tests/openlp_core/projectors/test_projector_constants.py +++ b/tests/openlp_core/projectors/test_projector_constants.py @@ -23,6 +23,7 @@ Package to test the openlp.core.projectors.constants module. """ from unittest import TestCase + from openlp.core.projectors import constants from openlp.core.projectors.constants import STATUS_CODE, STATUS_MSG diff --git a/tests/openlp_core/projectors/test_projector_db.py b/tests/openlp_core/projectors/test_projector_db.py index a1db28b6d..0d71a90a0 100644 --- a/tests/openlp_core/projectors/test_projector_db.py +++ b/tests/openlp_core/projectors/test_projector_db.py @@ -38,7 +38,7 @@ from openlp.core.projectors.constants import PJLINK_PORT from openlp.core.projectors.db import Manufacturer, Model, Projector, ProjectorDB, ProjectorSource, Source from openlp.core.ui.mainwindow import MainWindow from tests.helpers.testmixin import TestMixin -from tests.resources.projector.data import TEST_DB_PJLINK1, TEST_DB, TEST1_DATA, TEST2_DATA, TEST3_DATA +from tests.resources.projector.data import TEST1_DATA, TEST2_DATA, TEST3_DATA, TEST_DB, TEST_DB_PJLINK1 from tests.utils.constants import TEST_RESOURCES_PATH diff --git a/tests/openlp_core/projectors/test_projector_editform.py b/tests/openlp_core/projectors/test_projector_editform.py index 0cb33afe2..f936087bb 100644 --- a/tests/openlp_core/projectors/test_projector_editform.py +++ b/tests/openlp_core/projectors/test_projector_editform.py @@ -31,7 +31,7 @@ from openlp.core.common.registry import Registry from openlp.core.projectors.db import Projector, ProjectorDB from openlp.core.projectors.editform import ProjectorEditForm from tests.helpers.testmixin import TestMixin -from tests.resources.projector.data import TEST_DB, TEST1_DATA +from tests.resources.projector.data import TEST1_DATA, TEST_DB class TestProjectorEditForm(TestCase, TestMixin): diff --git a/tests/openlp_core/projectors/test_projector_pjlink_base_01.py b/tests/openlp_core/projectors/test_projector_pjlink_base_01.py index 567c885d4..b9fb0c08b 100644 --- a/tests/openlp_core/projectors/test_projector_pjlink_base_01.py +++ b/tests/openlp_core/projectors/test_projector_pjlink_base_01.py @@ -23,13 +23,11 @@ Package to test the openlp.core.projectors.pjlink base package. """ from unittest import TestCase -from unittest.mock import call, patch, MagicMock +from unittest.mock import MagicMock, call, patch import openlp.core.projectors.pjlink -from openlp.core.projectors.constants import \ - E_NOT_CONNECTED, E_PARAMETER, E_UNKNOWN_SOCKET_ERROR, STATUS_CODE, STATUS_MSG, \ - S_CONNECTED, S_CONNECTING, S_NOT_CONNECTED, S_OK, S_ON, \ - QSOCKET_STATE +from openlp.core.projectors.constants import E_NOT_CONNECTED, E_PARAMETER, E_UNKNOWN_SOCKET_ERROR, QSOCKET_STATE, \ + S_CONNECTED, S_CONNECTING, S_NOT_CONNECTED, S_OK, S_ON, STATUS_CODE, STATUS_MSG from openlp.core.projectors.db import Projector from openlp.core.projectors.pjlink import PJLink from tests.resources.projector.data import TEST1_DATA diff --git a/tests/openlp_core/projectors/test_projector_pjlink_base_02.py b/tests/openlp_core/projectors/test_projector_pjlink_base_02.py index f2bbfe200..7b7e21402 100644 --- a/tests/openlp_core/projectors/test_projector_pjlink_base_02.py +++ b/tests/openlp_core/projectors/test_projector_pjlink_base_02.py @@ -26,7 +26,6 @@ from unittest import TestCase from unittest.mock import call, patch import openlp.core.projectors.pjlink - from openlp.core.projectors.constants import S_NOT_CONNECTED from openlp.core.projectors.db import Projector from openlp.core.projectors.pjlink import PJLink diff --git a/tests/openlp_core/projectors/test_projector_pjlink_cmd_routing.py b/tests/openlp_core/projectors/test_projector_pjlink_cmd_routing.py index 09ed0ffa8..9a906d933 100644 --- a/tests/openlp_core/projectors/test_projector_pjlink_cmd_routing.py +++ b/tests/openlp_core/projectors/test_projector_pjlink_cmd_routing.py @@ -27,11 +27,10 @@ from unittest import TestCase from unittest.mock import MagicMock, call, patch import openlp.core.projectors.pjlink -from openlp.core.projectors.constants import PJLINK_ERRORS, PJLINK_PREFIX, STATUS_MSG, \ - E_AUTHENTICATION, E_PARAMETER, E_PROJECTOR, E_UNAVAILABLE, E_UNDEFINED +from openlp.core.projectors.constants import E_AUTHENTICATION, E_PARAMETER, E_PROJECTOR, E_UNAVAILABLE, E_UNDEFINED, \ + PJLINK_ERRORS, PJLINK_PREFIX, STATUS_MSG from openlp.core.projectors.db import Projector from openlp.core.projectors.pjlink import PJLink - from tests.resources.projector.data import TEST1_DATA diff --git a/tests/openlp_core/projectors/test_projector_pjlink_commands_01.py b/tests/openlp_core/projectors/test_projector_pjlink_commands_01.py index 42d46f735..3147475f8 100644 --- a/tests/openlp_core/projectors/test_projector_pjlink_commands_01.py +++ b/tests/openlp_core/projectors/test_projector_pjlink_commands_01.py @@ -26,20 +26,10 @@ from unittest import TestCase from unittest.mock import call, patch import openlp.core.projectors.pjlink -from openlp.core.projectors.constants import \ - PJLINK_ERST_DATA, \ - PJLINK_ERST_STATUS, \ - PJLINK_POWR_STATUS, \ - STATUS_CODE, \ - E_ERROR, \ - E_WARN, \ - S_OK, \ - S_ON, \ - S_NOT_CONNECTED, \ - S_STANDBY +from openlp.core.projectors.constants import E_ERROR, E_WARN, PJLINK_ERST_DATA, PJLINK_ERST_STATUS, \ + PJLINK_POWR_STATUS, S_NOT_CONNECTED, S_OK, S_ON, S_STANDBY, STATUS_CODE from openlp.core.projectors.db import Projector from openlp.core.projectors.pjlink import PJLink - from tests.resources.projector.data import TEST1_DATA diff --git a/tests/openlp_core/projectors/test_projector_pjlink_commands_02.py b/tests/openlp_core/projectors/test_projector_pjlink_commands_02.py index 502a5b1b0..576174b1b 100644 --- a/tests/openlp_core/projectors/test_projector_pjlink_commands_02.py +++ b/tests/openlp_core/projectors/test_projector_pjlink_commands_02.py @@ -23,13 +23,13 @@ Package to test the openlp.core.projectors.pjlink commands package. """ from unittest import TestCase, skip -from unittest.mock import patch, call +from unittest.mock import call, patch import openlp.core.projectors.pjlink from openlp.core.projectors.constants import PJLINK_PORT, S_CONNECTED, S_OFF, S_ON from openlp.core.projectors.db import Projector from openlp.core.projectors.pjlink import PJLink, PJLinkUDP -from tests.resources.projector.data import TEST_HASH, TEST_PIN, TEST_SALT, TEST1_DATA, TEST2_DATA +from tests.resources.projector.data import TEST1_DATA, TEST2_DATA, TEST_HASH, TEST_PIN, TEST_SALT class TestPJLinkCommands(TestCase): diff --git a/tests/openlp_core/projectors/test_projector_pjlink_udp.py b/tests/openlp_core/projectors/test_projector_pjlink_udp.py index 45c91347f..a9624d2e2 100644 --- a/tests/openlp_core/projectors/test_projector_pjlink_udp.py +++ b/tests/openlp_core/projectors/test_projector_pjlink_udp.py @@ -29,7 +29,6 @@ from unittest.mock import call, patch import openlp.core.projectors.pjlink from openlp.core.projectors.constants import PJLINK_PORT - from openlp.core.projectors.pjlink import PJLinkUDP from tests.resources.projector.data import TEST1_DATA diff --git a/tests/openlp_core/projectors/test_projector_sourceform.py b/tests/openlp_core/projectors/test_projector_sourceform.py index 65c3eea99..3c6271ae5 100644 --- a/tests/openlp_core/projectors/test_projector_sourceform.py +++ b/tests/openlp_core/projectors/test_projector_sourceform.py @@ -33,10 +33,10 @@ from PyQt5.QtWidgets import QDialog from openlp.core.common.registry import Registry from openlp.core.projectors.constants import PJLINK_DEFAULT_CODES, PJLINK_DEFAULT_SOURCES -from openlp.core.projectors.db import ProjectorDB, Projector -from openlp.core.projectors.sourceselectform import source_group, SourceSelectSingle +from openlp.core.projectors.db import Projector, ProjectorDB +from openlp.core.projectors.sourceselectform import SourceSelectSingle, source_group from tests.helpers.testmixin import TestMixin -from tests.resources.projector.data import TEST_DB, TEST1_DATA +from tests.resources.projector.data import TEST1_DATA, TEST_DB def build_source_dict(): diff --git a/tests/openlp_core/projectors/test_projector_utilities.py b/tests/openlp_core/projectors/test_projector_utilities.py index ecdb5a240..6ac8fb5cf 100644 --- a/tests/openlp_core/projectors/test_projector_utilities.py +++ b/tests/openlp_core/projectors/test_projector_utilities.py @@ -25,8 +25,9 @@ Package to test the openlp.core.ui.projector.networkutils package. from unittest import TestCase -from openlp.core.common import verify_ip_address, md5_hash, qmd5_hash -from tests.resources.projector.data import TEST_PIN, TEST_SALT, TEST_HASH +from openlp.core.common import md5_hash, qmd5_hash, verify_ip_address +from tests.resources.projector.data import TEST_HASH, TEST_PIN, TEST_SALT + salt = TEST_SALT pin = TEST_PIN diff --git a/tests/openlp_core/projectors/test_projectormanager.py b/tests/openlp_core/projectors/test_projectormanager.py index 4fc6ec791..c48ca1517 100644 --- a/tests/openlp_core/projectors/test_projectormanager.py +++ b/tests/openlp_core/projectors/test_projectormanager.py @@ -24,7 +24,7 @@ Interface tests to test the themeManager class and related methods. """ import os from unittest import TestCase -from unittest.mock import patch, MagicMock +from unittest.mock import MagicMock, patch from openlp.core.common.registry import Registry from openlp.core.projectors.db import ProjectorDB diff --git a/tests/utils/constants.py b/tests/utils/constants.py index e65797261..2f237f4bb 100644 --- a/tests/utils/constants.py +++ b/tests/utils/constants.py @@ -23,6 +23,7 @@ import os from openlp.core.common.path import Path + OPENLP_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')) TEST_RESOURCES_PATH = os.path.join(OPENLP_PATH, 'tests', 'resources') RESOURCE_PATH = Path(TEST_RESOURCES_PATH) diff --git a/tests/utils/test_bzr_tags.py b/tests/utils/test_bzr_tags.py index b6dc8f4ee..f87a2d93c 100644 --- a/tests/utils/test_bzr_tags.py +++ b/tests/utils/test_bzr_tags.py @@ -23,9 +23,10 @@ Package to test for proper bzr tags. """ import os -from subprocess import Popen, PIPE +from subprocess import PIPE, Popen from unittest import TestCase + TAGS1 = {'1.9.0', '1.9.1', '1.9.2', '1.9.3', '1.9.4', '1.9.5', '1.9.6', '1.9.7', '1.9.8', '1.9.9', '1.9.10', '1.9.11', '1.9.12', '2.0', '2.1.0', '2.1.1', '2.1.2', '2.1.3', '2.1.4', '2.1.5', '2.1.6', '2.2', '2.3.1', '2.3.2', '2.3.3', '2.4'} diff --git a/tests/utils/test_pylint.py b/tests/utils/test_pylint.py index fb234c54f..578a1d985 100644 --- a/tests/utils/test_pylint.py +++ b/tests/utils/test_pylint.py @@ -24,7 +24,10 @@ Package to test for proper bzr tags. """ import platform import sys -from unittest import TestCase, SkipTest +from unittest import SkipTest, TestCase + +from openlp.core.common import is_win + try: from pylint import epylint as lint @@ -32,7 +35,6 @@ try: except ImportError: raise SkipTest('pylint not installed - skipping tests using pylint.') -from openlp.core.common import is_win TOLERATED_ERRORS = {'registryproperties.py': ['access-member-before-definition'], 'opensong.py': ['no-name-in-module'],