diff --git a/openlp/plugins/alerts/endpoint.py b/openlp/plugins/alerts/endpoint.py index 19449b863..a54ad0d59 100644 --- a/openlp/plugins/alerts/endpoint.py +++ b/openlp/plugins/alerts/endpoint.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 +import json ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # @@ -20,16 +21,14 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### import logging -import json import urllib from urllib.parse import urlparse -from openlp.core.api.http.endpoint import Endpoint from openlp.core.api.http import requires_auth +from openlp.core.api.http.endpoint import Endpoint from openlp.core.common.registry import Registry from openlp.core.lib import PluginStatus - log = logging.getLogger(__name__) alerts_endpoint = Endpoint('alert') diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index c7f9487c4..3a5164f33 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -25,7 +25,6 @@ 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 7d5baf859..052a5e2a6 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -23,11 +23,11 @@ import logging from openlp.core.api.http import register_endpoint -from openlp.core.common.i18n import UiStrings, translate from openlp.core.common.actions import ActionList +from openlp.core.common.i18n import UiStrings, translate from openlp.core.lib import Plugin, StringContent, build_icon -from openlp.plugins.bibles.endpoint import api_bibles_endpoint, bibles_endpoint from openlp.core.lib.ui import create_action +from openlp.plugins.bibles.endpoint import api_bibles_endpoint, bibles_endpoint from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem, LayoutStyle, DisplayStyle, \ LanguageSelection from openlp.plugins.bibles.lib.mediaitem import BibleSearch diff --git a/openlp/plugins/bibles/endpoint.py b/openlp/plugins/bibles/endpoint.py index 4d34eb966..31ff93b53 100644 --- a/openlp/plugins/bibles/endpoint.py +++ b/openlp/plugins/bibles/endpoint.py @@ -21,11 +21,10 @@ ############################################################################### import logging -from openlp.core.api.http.endpoint import Endpoint -from openlp.core.api.http.errors import NotFound from openlp.core.api.endpoint.pluginhelpers import search, live, 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__) diff --git a/openlp/plugins/bibles/forms/__init__.py b/openlp/plugins/bibles/forms/__init__.py index 1b0055d67..8db77f1c6 100644 --- a/openlp/plugins/bibles/forms/__init__.py +++ b/openlp/plugins/bibles/forms/__init__.py @@ -24,9 +24,9 @@ The :mod:`forms` module contains all the ui functionality for the bibles plugin. """ -from .booknameform import BookNameForm -from .languageform import LanguageForm from .bibleimportform import BibleImportForm +from .booknameform import BookNameForm from .editbibleform import EditBibleForm +from .languageform import LanguageForm __all__ = ['BookNameForm', 'LanguageForm', 'BibleImportForm', 'EditBibleForm'] diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 857c48f74..a45a2ab73 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -24,9 +24,10 @@ The bible import functions for OpenLP """ import logging import urllib.error -from lxml import etree from PyQt5 import QtWidgets +from lxml import etree + try: from pysword import modules PYSWORD_AVAILABLE = True diff --git a/openlp/plugins/bibles/forms/booknameform.py b/openlp/plugins/bibles/forms/booknameform.py index 7c8a2c3cd..580b43747 100644 --- a/openlp/plugins/bibles/forms/booknameform.py +++ b/openlp/plugins/bibles/forms/booknameform.py @@ -26,8 +26,8 @@ Module implementing BookNameForm. import logging import re -from PyQt5.QtWidgets import QDialog from PyQt5 import QtCore +from PyQt5.QtWidgets import QDialog from openlp.core.common.i18n import translate from openlp.core.lib.ui import critical_error_message_box diff --git a/openlp/plugins/bibles/forms/editbibleform.py b/openlp/plugins/bibles/forms/editbibleform.py index 8899087ba..1c6d60684 100644 --- a/openlp/plugins/bibles/forms/editbibleform.py +++ b/openlp/plugins/bibles/forms/editbibleform.py @@ -28,9 +28,9 @@ from PyQt5 import QtCore, QtWidgets from openlp.core.common.i18n import UiStrings, translate from openlp.core.common.mixins import RegistryProperties from openlp.core.lib.ui import critical_error_message_box -from .editbibledialog import Ui_EditBibleDialog 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 80ce9e989..e76fdc0fa 100644 --- a/openlp/plugins/bibles/forms/languageform.py +++ b/openlp/plugins/bibles/forms/languageform.py @@ -25,14 +25,13 @@ Module implementing LanguageForm. """ import logging -from PyQt5.QtWidgets import QDialog from PyQt5 import QtCore +from PyQt5.QtWidgets import QDialog 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/__init__.py b/openlp/plugins/bibles/lib/__init__.py index f9d93a43e..918e08061 100644 --- a/openlp/plugins/bibles/lib/__init__.py +++ b/openlp/plugins/bibles/lib/__init__.py @@ -29,7 +29,6 @@ import re from openlp.core.common.i18n import translate from openlp.core.common.settings import Settings - log = logging.getLogger(__name__) diff --git a/openlp/plugins/bibles/lib/bibleimport.py b/openlp/plugins/bibles/lib/bibleimport.py index 7efb46f5d..1aed01801 100644 --- a/openlp/plugins/bibles/lib/bibleimport.py +++ b/openlp/plugins/bibles/lib/bibleimport.py @@ -20,12 +20,13 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -from lxml import etree, objectify from zipfile import is_zipfile +from lxml import etree, objectify + +from openlp.core.common.i18n import get_language, translate from openlp.core.common.mixins import LogMixin, RegistryProperties from openlp.core.common.registry import Registry -from openlp.core.common.i18n import get_language, translate from openlp.core.lib import ValidationError from openlp.core.lib.ui import critical_error_message_box from openlp.plugins.bibles.lib.db import AlternativeBookNamesDB, BibleDB, BiblesResourcesDB diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index 13aeadfae..e534b4c55 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -1,6 +1,11 @@ # -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 +import logging +import re +import sqlite3 +import time + ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # @@ -20,12 +25,6 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### import chardet -import logging -import os -import re -import sqlite3 -import time - from PyQt5 import QtCore from sqlalchemy import Column, ForeignKey, Table, or_, types, func from sqlalchemy.exc import OperationalError diff --git a/openlp/plugins/bibles/lib/importers/http.py b/openlp/plugins/bibles/lib/importers/http.py index b88dbe7a9..e76f26a52 100644 --- a/openlp/plugins/bibles/lib/importers/http.py +++ b/openlp/plugins/bibles/lib/importers/http.py @@ -25,8 +25,8 @@ The :mod:`http` module enables OpenLP to retrieve scripture from bible websites. import logging import re import socket -import urllib.parse import urllib.error +import urllib.parse from bs4 import BeautifulSoup, NavigableString, Tag diff --git a/openlp/plugins/bibles/lib/importers/sword.py b/openlp/plugins/bibles/lib/importers/sword.py index dcb392754..04c49e1ee 100644 --- a/openlp/plugins/bibles/lib/importers/sword.py +++ b/openlp/plugins/bibles/lib/importers/sword.py @@ -21,6 +21,7 @@ ############################################################################### import logging + from pysword import modules from openlp.core.common.i18n import translate @@ -28,7 +29,6 @@ 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/zefania.py b/openlp/plugins/bibles/lib/importers/zefania.py index 2b5eb68b8..48ed13dc4 100644 --- a/openlp/plugins/bibles/lib/importers/zefania.py +++ b/openlp/plugins/bibles/lib/importers/zefania.py @@ -27,7 +27,6 @@ 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 37586b4be..834f5a75e 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -33,8 +33,9 @@ from .importers.csvbible import CSVBible from .importers.http import HTTPBible from .importers.opensong import OpenSongBible from .importers.osis import OSISBible -from .importers.zefania import ZefaniaBible from .importers.wordproject import WordProjectBible +from .importers.zefania import ZefaniaBible + try: from .importers.sword import SwordBible except: diff --git a/openlp/plugins/custom/endpoint.py b/openlp/plugins/custom/endpoint.py index ca5c39088..c36589b0a 100644 --- a/openlp/plugins/custom/endpoint.py +++ b/openlp/plugins/custom/endpoint.py @@ -21,11 +21,10 @@ ############################################################################### import logging -from openlp.core.api.http.endpoint import Endpoint -from openlp.core.api.http.errors import NotFound from openlp.core.api.endpoint.pluginhelpers import search, live, 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__) diff --git a/openlp/plugins/custom/lib/__init__.py b/openlp/plugins/custom/lib/__init__.py index 6ecd423b3..c6314cfb7 100644 --- a/openlp/plugins/custom/lib/__init__.py +++ b/openlp/plugins/custom/lib/__init__.py @@ -20,6 +20,6 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### +from .customtab import CustomTab from .customxmlhandler import CustomXMLBuilder, CustomXMLParser from .mediaitem import CustomMediaItem -from .customtab import CustomTab diff --git a/openlp/plugins/custom/lib/customxmlhandler.py b/openlp/plugins/custom/lib/customxmlhandler.py index a205b1d6a..43964ef20 100644 --- a/openlp/plugins/custom/lib/customxmlhandler.py +++ b/openlp/plugins/custom/lib/customxmlhandler.py @@ -36,9 +36,9 @@ The basic XML is of the format:: """ import logging - from xml.dom.minidom import Document from xml.etree.ElementTree import dump + from lxml import etree, objectify log = logging.getLogger(__name__) diff --git a/openlp/plugins/images/endpoint.py b/openlp/plugins/images/endpoint.py index 05c1e64b4..63d076307 100644 --- a/openlp/plugins/images/endpoint.py +++ b/openlp/plugins/images/endpoint.py @@ -21,11 +21,10 @@ ############################################################################### import logging -from openlp.core.api.http.endpoint import Endpoint -from openlp.core.api.http.errors import NotFound from openlp.core.api.endpoint.pluginhelpers import search, live, service, display_thumbnails 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__) diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index cfa5448f5..39b7335c6 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -20,10 +20,10 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -from PyQt5 import QtGui - import logging +from PyQt5 import QtGui + from openlp.core.api.http import register_endpoint from openlp.core.common.i18n import translate from openlp.core.common.settings import Settings diff --git a/openlp/plugins/images/lib/__init__.py b/openlp/plugins/images/lib/__init__.py index aa49ec62e..196bc9c49 100644 --- a/openlp/plugins/images/lib/__init__.py +++ b/openlp/plugins/images/lib/__init__.py @@ -20,5 +20,5 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -from .mediaitem import ImageMediaItem from .imagetab import ImageTab +from .mediaitem import ImageMediaItem diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 25a8d2353..538e1c66a 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -37,7 +37,6 @@ 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/media/endpoint.py b/openlp/plugins/media/endpoint.py index c7b703358..52d7a43f0 100644 --- a/openlp/plugins/media/endpoint.py +++ b/openlp/plugins/media/endpoint.py @@ -21,11 +21,10 @@ ############################################################################### import logging -from openlp.core.api.http.endpoint import Endpoint -from openlp.core.api.http.errors import NotFound from openlp.core.api.endpoint.pluginhelpers import search, live, 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__) diff --git a/openlp/plugins/media/forms/mediaclipselectorform.py b/openlp/plugins/media/forms/mediaclipselectorform.py index be9e69fbd..66f101587 100644 --- a/openlp/plugins/media/forms/mediaclipselectorform.py +++ b/openlp/plugins/media/forms/mediaclipselectorform.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 +import logging ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # @@ -20,20 +21,19 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### import os -import logging import re -from time import sleep from datetime import datetime +from time import sleep from PyQt5 import QtCore, QtGui, QtWidgets from openlp.core.common import is_win, is_linux, is_macosx -from openlp.core.common.path import Path from openlp.core.common.i18n import translate from openlp.core.common.mixins import RegistryProperties -from openlp.plugins.media.forms.mediaclipselectordialog import Ui_MediaClipSelector +from openlp.core.common.path import Path from openlp.core.lib.ui import critical_error_message_box 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 8e6faa587..0fa91cc1e 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -27,8 +27,8 @@ 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.path import Path, path_to_str, create_paths from openlp.core.common.mixins import RegistryProperties +from openlp.core.common.path import Path, path_to_str, create_paths from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings from openlp.core.lib import ItemCapabilities, MediaManagerItem, MediaType, ServiceItem, ServiceItemContext, \ diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 461e78746..b92c930fc 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -23,7 +23,6 @@ The Media plugin """ import logging -import os import re from PyQt5 import QtCore @@ -37,7 +36,6 @@ from openlp.core.lib import Plugin, StringContent, build_icon 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 99c828b4b..c549f360f 100644 --- a/openlp/plugins/presentations/endpoint.py +++ b/openlp/plugins/presentations/endpoint.py @@ -21,11 +21,10 @@ ############################################################################### import logging -from openlp.core.api.http.endpoint import Endpoint -from openlp.core.api.http.errors import NotFound from openlp.core.api.endpoint.pluginhelpers import search, live, service, display_thumbnails 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__) diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 923953040..ff94a3715 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -24,10 +24,10 @@ import logging from PyQt5 import QtCore, QtGui, QtWidgets from openlp.core.common.i18n import UiStrings, translate, get_natural_key -from openlp.core.common.path import Path, path_to_str, str_to_path +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 MediaManagerItem, ItemCapabilities, ServiceItemContext,\ +from openlp.core.lib import MediaManagerItem, ItemCapabilities, ServiceItemContext, \ build_icon, check_item_selected, create_thumb, validate_thumb from openlp.core.lib.ui import critical_error_message_box, create_horizontal_adjusting_combo_box from openlp.plugins.presentations.lib import MessageListener diff --git a/openlp/plugins/presentations/lib/messagelistener.py b/openlp/plugins/presentations/lib/messagelistener.py index 33f5e0693..7c9b41276 100644 --- a/openlp/plugins/presentations/lib/messagelistener.py +++ b/openlp/plugins/presentations/lib/messagelistener.py @@ -24,9 +24,9 @@ import logging from PyQt5 import QtCore +from openlp.core.common.path import Path from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings -from openlp.core.common.path import Path from openlp.core.lib import ServiceItemContext from openlp.core.ui import HideMode from openlp.plugins.presentations.lib.pdfcontroller import PDF_CONTROLLER_FILETYPES diff --git a/openlp/plugins/presentations/lib/pptviewcontroller.py b/openlp/plugins/presentations/lib/pptviewcontroller.py index ddabe07e1..519094d28 100644 --- a/openlp/plugins/presentations/lib/pptviewcontroller.py +++ b/openlp/plugins/presentations/lib/pptviewcontroller.py @@ -20,8 +20,8 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### import logging -import zipfile import re +import zipfile from xml.etree import ElementTree from openlp.core.common import is_win diff --git a/openlp/plugins/presentations/lib/pptviewlib/ppttest.py b/openlp/plugins/presentations/lib/pptviewlib/ppttest.py index bea341a49..a4828cf98 100644 --- a/openlp/plugins/presentations/lib/pptviewlib/ppttest.py +++ b/openlp/plugins/presentations/lib/pptviewlib/ppttest.py @@ -21,10 +21,11 @@ ############################################################################### import sys -from PyQt5 import QtWidgets from ctypes import * from ctypes.wintypes import RECT +from PyQt5 import QtWidgets + class PPTViewer(QtWidgets.QWidget): """ diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index c65971f11..750a6a060 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -23,8 +23,8 @@ The :mod:`openlp.plugins.presentations.presentationplugin` module provides the ability for OpenLP to display presentations from a variety of document formats. """ -import os import logging +import os from PyQt5 import QtCore diff --git a/openlp/plugins/songs/endpoint.py b/openlp/plugins/songs/endpoint.py index c8af62764..49249b36e 100644 --- a/openlp/plugins/songs/endpoint.py +++ b/openlp/plugins/songs/endpoint.py @@ -21,11 +21,10 @@ ############################################################################### import logging -from openlp.core.api.http.endpoint import Endpoint -from openlp.core.api.http.errors import NotFound from openlp.core.api.endpoint.pluginhelpers import search, live, 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__) diff --git a/openlp/plugins/songs/forms/duplicatesongremovalform.py b/openlp/plugins/songs/forms/duplicatesongremovalform.py index 8e7724808..1a6c1b86f 100644 --- a/openlp/plugins/songs/forms/duplicatesongremovalform.py +++ b/openlp/plugins/songs/forms/duplicatesongremovalform.py @@ -32,9 +32,9 @@ from openlp.core.common.i18n import translate from openlp.core.common.mixins import RegistryProperties from openlp.core.common.registry import Registry from openlp.core.widgets.wizard import OpenLPWizard, WizardStrings +from openlp.plugins.songs.forms.songreviewwidget import SongReviewWidget from openlp.plugins.songs.lib import delete_song from openlp.plugins.songs.lib.db import Song -from openlp.plugins.songs.forms.songreviewwidget import SongReviewWidget from openlp.plugins.songs.lib.songcompare import songs_probably_equal log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 6e0772418..664b8e7b9 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -30,8 +30,8 @@ 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.path import create_paths, copyfile from openlp.core.common.mixins import RegistryProperties +from openlp.core.common.path import create_paths, copyfile from openlp.core.common.registry import Registry from openlp.core.lib import PluginStatus, MediaType, create_separated_list from openlp.core.lib.ui import set_case_insensitive_completer, critical_error_message_box, find_and_set_in_combo_box diff --git a/openlp/plugins/songs/forms/editversedialog.py b/openlp/plugins/songs/forms/editversedialog.py index 76dc70c17..b0cb81316 100644 --- a/openlp/plugins/songs/forms/editversedialog.py +++ b/openlp/plugins/songs/forms/editversedialog.py @@ -22,8 +22,8 @@ from PyQt5 import QtWidgets -from openlp.core.common.settings import Settings from openlp.core.common.i18n import UiStrings, translate +from openlp.core.common.settings import Settings from openlp.core.lib import build_icon from openlp.core.lib.ui import create_button_box from openlp.core.widgets.edits import SpellTextEdit diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index 09ba1e300..00c972c96 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -20,14 +20,14 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -import re import logging +import re from PyQt5 import QtCore, QtGui, QtWidgets -from openlp.core.lib.ui import critical_error_message_box from openlp.core.common.i18n import translate from openlp.core.common.settings import Settings +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 diff --git a/openlp/plugins/songs/forms/mediafilesform.py b/openlp/plugins/songs/forms/mediafilesform.py index 8718471ea..d9e09c1b0 100644 --- a/openlp/plugins/songs/forms/mediafilesform.py +++ b/openlp/plugins/songs/forms/mediafilesform.py @@ -21,7 +21,6 @@ ############################################################################### import logging -import os from PyQt5 import QtCore, QtWidgets diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index 7f0236d24..fadb195be 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -29,8 +29,8 @@ 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.topicsform import TopicsForm 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 .songmaintenancedialog import Ui_SongMaintenanceDialog diff --git a/openlp/plugins/songs/lib/importer.py b/openlp/plugins/songs/lib/importer.py index e306dae87..e48db5b85 100644 --- a/openlp/plugins/songs/lib/importer.py +++ b/openlp/plugins/songs/lib/importer.py @@ -27,28 +27,28 @@ 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.opensong import OpenSongImport +from .importers.cclifile import CCLIFileImport +from .importers.chordpro import ChordProImport +from .importers.dreambeam import DreamBeamImport from .importers.easyslides import EasySlidesImport +from .importers.easyworship import EasyWorshipSongImport +from .importers.foilpresenter import FoilPresenterImport +from .importers.lyrix import LyrixImport from .importers.openlp import OpenLPSongImport from .importers.openlyrics import OpenLyricsImport -from .importers.wordsofworship import WordsOfWorshipImport -from .importers.cclifile import CCLIFileImport -from .importers.dreambeam import DreamBeamImport -from .importers.powersong import PowerSongImport -from .importers.easyworship import EasyWorshipSongImport -from .importers.songbeamer import SongBeamerImport -from .importers.songshowplus import SongShowPlusImport -from .importers.songpro import SongProImport -from .importers.sundayplus import SundayPlusImport -from .importers.foilpresenter import FoilPresenterImport -from .importers.zionworx import ZionWorxImport -from .importers.propresenter import ProPresenterImport -from .importers.worshipassistant import WorshipAssistantImport +from .importers.opensong import OpenSongImport from .importers.powerpraise import PowerPraiseImport +from .importers.powersong import PowerSongImport from .importers.presentationmanager import PresentationManagerImport -from .importers.lyrix import LyrixImport +from .importers.propresenter import ProPresenterImport +from .importers.songbeamer import SongBeamerImport +from .importers.songpro import SongProImport +from .importers.songshowplus import SongShowPlusImport +from .importers.sundayplus import SundayPlusImport from .importers.videopsalm import VideoPsalmImport -from .importers.chordpro import ChordProImport +from .importers.wordsofworship import WordsOfWorshipImport +from .importers.worshipassistant import WorshipAssistantImport +from .importers.zionworx import ZionWorxImport log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/importers/cclifile.py b/openlp/plugins/songs/lib/importers/cclifile.py index 10a8b09e1..cc4630fda 100644 --- a/openlp/plugins/songs/lib/importers/cclifile.py +++ b/openlp/plugins/songs/lib/importers/cclifile.py @@ -1,6 +1,9 @@ # -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 +import codecs +import logging + ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # @@ -20,8 +23,6 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### import chardet -import codecs -import logging from openlp.core.common.i18n import translate from openlp.plugins.songs.lib import VerseType diff --git a/openlp/plugins/songs/lib/importers/easyworship.py b/openlp/plugins/songs/lib/importers/easyworship.py index 8f096099f..108cc5133 100644 --- a/openlp/plugins/songs/lib/importers/easyworship.py +++ b/openlp/plugins/songs/lib/importers/easyworship.py @@ -25,11 +25,10 @@ The :mod:`easyworship` module provides the functionality for importing EasyWorsh import logging import os import re +import sqlite3 import struct import zlib -import sqlite3 - from openlp.core.common.i18n import translate from openlp.core.common.path import Path from openlp.plugins.songs.lib import VerseType diff --git a/openlp/plugins/songs/lib/importers/foilpresenter.py b/openlp/plugins/songs/lib/importers/foilpresenter.py index f164dfda2..f05ed4c0c 100644 --- a/openlp/plugins/songs/lib/importers/foilpresenter.py +++ b/openlp/plugins/songs/lib/importers/foilpresenter.py @@ -90,10 +90,10 @@ 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.importers.songimport import SongImport from openlp.plugins.songs.lib.db import Author, Book, Song, Topic -from openlp.plugins.songs.lib.ui import SongStrings +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/mediashout.py b/openlp/plugins/songs/lib/importers/mediashout.py index 9df9baa0f..09efb3cbf 100644 --- a/openlp/plugins/songs/lib/importers/mediashout.py +++ b/openlp/plugins/songs/lib/importers/mediashout.py @@ -27,9 +27,10 @@ a MediaShout database into the OpenLP database. # WARNING: See https://docs.python.org/3/library/sqlite3.html for value substitution # in SQL statements -import pyodbc import logging +import pyodbc + from openlp.core.common.i18n import translate from openlp.plugins.songs.lib.importers.songimport import SongImport diff --git a/openlp/plugins/songs/lib/importers/openlyrics.py b/openlp/plugins/songs/lib/importers/openlyrics.py index f443cfb34..7274dedf3 100644 --- a/openlp/plugins/songs/lib/importers/openlyrics.py +++ b/openlp/plugins/songs/lib/importers/openlyrics.py @@ -29,8 +29,8 @@ from lxml import etree from openlp.core.widgets.wizard import WizardStrings from openlp.plugins.songs.lib.importers.songimport import SongImport -from openlp.plugins.songs.lib.ui import SongStrings 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/opspro.py b/openlp/plugins/songs/lib/importers/opspro.py index f7dba83b8..d0a17f5a0 100644 --- a/openlp/plugins/songs/lib/importers/opspro.py +++ b/openlp/plugins/songs/lib/importers/opspro.py @@ -29,9 +29,10 @@ a OPS Pro database into the OpenLP database. import logging import re -import pyodbc import struct +import pyodbc + from openlp.core.common.i18n import translate from openlp.plugins.songs.lib.importers.songimport import SongImport diff --git a/openlp/plugins/songs/lib/importers/presentationmanager.py b/openlp/plugins/songs/lib/importers/presentationmanager.py index c8f9a16f9..7a8458e2e 100644 --- a/openlp/plugins/songs/lib/importers/presentationmanager.py +++ b/openlp/plugins/songs/lib/importers/presentationmanager.py @@ -27,8 +27,8 @@ import re from lxml import objectify, etree -from openlp.core.common.i18n import translate from openlp.core.common import get_file_encoding +from openlp.core.common.i18n import translate from openlp.core.widgets.wizard import WizardStrings from openlp.plugins.songs.lib.importers.songimport import SongImport diff --git a/openlp/plugins/songs/lib/importers/propresenter.py b/openlp/plugins/songs/lib/importers/propresenter.py index 0de0e5300..e1557d2c4 100644 --- a/openlp/plugins/songs/lib/importers/propresenter.py +++ b/openlp/plugins/songs/lib/importers/propresenter.py @@ -25,6 +25,7 @@ ProPresenter song files into the current installation database. """ import base64 import logging + from lxml import objectify from openlp.core.widgets.wizard import WizardStrings diff --git a/openlp/plugins/songs/lib/importers/songbeamer.py b/openlp/plugins/songs/lib/importers/songbeamer.py index adc364325..eae22dbdc 100644 --- a/openlp/plugins/songs/lib/importers/songbeamer.py +++ b/openlp/plugins/songs/lib/importers/songbeamer.py @@ -22,15 +22,15 @@ """ The :mod:`songbeamer` module provides the functionality for importing SongBeamer songs into the OpenLP database. """ +import base64 import logging +import math import os import re -import base64 -import math from openlp.core.common import is_win, is_macosx, get_file_encoding -from openlp.core.common.settings import Settings 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 diff --git a/openlp/plugins/songs/lib/importers/songimport.py b/openlp/plugins/songs/lib/importers/songimport.py index 2bd8c0e56..177e7c9a8 100644 --- a/openlp/plugins/songs/lib/importers/songimport.py +++ b/openlp/plugins/songs/lib/importers/songimport.py @@ -33,8 +33,8 @@ 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.ui import SongStrings 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/songsoffellowship.py b/openlp/plugins/songs/lib/importers/songsoffellowship.py index bbba654c9..2518adb52 100644 --- a/openlp/plugins/songs/lib/importers/songsoffellowship.py +++ b/openlp/plugins/songs/lib/importers/songsoffellowship.py @@ -27,13 +27,11 @@ # http://wiki.services.openoffice.org/wiki/Python import logging -import os 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 a6bacf1b2..051e5ebc2 100644 --- a/openlp/plugins/songs/lib/importers/sundayplus.py +++ b/openlp/plugins/songs/lib/importers/sundayplus.py @@ -19,7 +19,6 @@ # with this program; if not, write to the Free Software Foundation, Inc., 59 # # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -import os import re from openlp.plugins.songs.lib import VerseType, retrieve_windows_encoding diff --git a/openlp/plugins/songs/lib/importers/videopsalm.py b/openlp/plugins/songs/lib/importers/videopsalm.py index 180dbd333..d95470245 100644 --- a/openlp/plugins/songs/lib/importers/videopsalm.py +++ b/openlp/plugins/songs/lib/importers/videopsalm.py @@ -27,10 +27,10 @@ import logging import re from openlp.core.common.i18n import translate -from openlp.core.common.settings import Settings from openlp.core.common.path import Path -from openlp.plugins.songs.lib.importers.songimport import SongImport +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 e1c561361..aa1ca88e5 100644 --- a/openlp/plugins/songs/lib/importers/wordsofworship.py +++ b/openlp/plugins/songs/lib/importers/wordsofworship.py @@ -23,9 +23,8 @@ The :mod:`wordsofworship` module provides the functionality for importing Words of Worship songs into the OpenLP database. """ -import os import logging -from openlp.core.common.path import Path +import os from openlp.core.common.i18n import translate from openlp.plugins.songs.lib.importers.songimport import SongImport diff --git a/openlp/plugins/songs/lib/importers/worshipcenterpro.py b/openlp/plugins/songs/lib/importers/worshipcenterpro.py index 6bba00682..d6b618f5e 100644 --- a/openlp/plugins/songs/lib/importers/worshipcenterpro.py +++ b/openlp/plugins/songs/lib/importers/worshipcenterpro.py @@ -25,6 +25,7 @@ a WorshipCenter Pro database into the OpenLP database. """ import logging import re + import pyodbc from openlp.core.common.i18n import translate diff --git a/openlp/plugins/songs/lib/openlyricsexport.py b/openlp/plugins/songs/lib/openlyricsexport.py index b07298253..d91265177 100644 --- a/openlp/plugins/songs/lib/openlyricsexport.py +++ b/openlp/plugins/songs/lib/openlyricsexport.py @@ -29,8 +29,8 @@ from lxml import etree from openlp.core.common import clean_filename from openlp.core.common.i18n import translate -from openlp.core.common.path import create_paths 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 ef47fa77b..1315fc0fb 100644 --- a/openlp/plugins/songs/lib/openlyricsxml.py +++ b/openlp/plugins/songs/lib/openlyricsxml.py @@ -63,8 +63,8 @@ from lxml import etree, objectify from openlp.core.common.i18n import translate from openlp.core.common.settings import Settings -from openlp.core.version import get_version from openlp.core.lib import FormattingTags +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 diff --git a/openlp/plugins/songs/lib/songselect.py b/openlp/plugins/songs/lib/songselect.py index 85ada339f..fbdf42495 100644 --- a/openlp/plugins/songs/lib/songselect.py +++ b/openlp/plugins/songs/lib/songselect.py @@ -25,11 +25,11 @@ The :mod:`~openlp.plugins.songs.lib.songselect` module contains the SongSelect i import logging import random import re +from html import unescape +from html.parser import HTMLParser from http.cookiejar import CookieJar from urllib.parse import urlencode from urllib.request import HTTPCookieProcessor, URLError, build_opener -from html.parser import HTMLParser -from html import unescape from bs4 import BeautifulSoup, NavigableString diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 4e87a5af7..2a40a91cc 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -25,7 +25,6 @@ for the Songs plugin. """ import logging -import os import sqlite3 from pathlib import Path from tempfile import gettempdir diff --git a/openlp/plugins/songusage/forms/songusagedeleteform.py b/openlp/plugins/songusage/forms/songusagedeleteform.py index 9042756d6..2a031f257 100644 --- a/openlp/plugins/songusage/forms/songusagedeleteform.py +++ b/openlp/plugins/songusage/forms/songusagedeleteform.py @@ -24,8 +24,8 @@ from PyQt5 import QtCore, QtWidgets from openlp.core.common.i18n import translate from openlp.core.common.mixins import RegistryProperties -from openlp.plugins.songusage.lib.db import SongUsageItem from openlp.plugins.songusage.forms.songusagedeletedialog import Ui_SongUsageDeleteDialog +from openlp.plugins.songusage.lib.db import SongUsageItem class SongUsageDeleteForm(QtWidgets.QDialog, Ui_SongUsageDeleteDialog, RegistryProperties): diff --git a/openlp/plugins/songusage/forms/songusagedetailform.py b/openlp/plugins/songusage/forms/songusagedetailform.py index dc3393c8d..873882f9a 100644 --- a/openlp/plugins/songusage/forms/songusagedetailform.py +++ b/openlp/plugins/songusage/forms/songusagedetailform.py @@ -26,8 +26,8 @@ from sqlalchemy.sql import and_ from openlp.core.common.i18n import translate from openlp.core.common.mixins import RegistryProperties -from openlp.core.common.settings import Settings 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