From 63685cb29e621528f7eb0a00bcea729fe8ca83cc Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 13 Oct 2013 21:36:42 +0100 Subject: [PATCH] Move Settings and translate --- openlp/core/__init__.py | 4 +- openlp/core/common/__init__.py | 42 ++ openlp/core/common/applocation.py | 4 +- openlp/core/{lib => common}/uistrings.py | 2 +- openlp/core/lib/__init__.py | 33 +- openlp/core/lib/db.py | 4 +- openlp/core/lib/formattingtags.py | 3 +- openlp/core/lib/mediamanageritem.py | 3 +- openlp/core/lib/plugin.py | 3 +- openlp/core/lib/renderer.py | 5 +- openlp/core/lib/screen.py | 4 +- openlp/core/lib/serviceitem.py | 3 +- openlp/core/lib/settings.py | 499 ------------------ openlp/core/lib/theme.py | 9 - openlp/core/lib/ui.py | 3 +- openlp/core/ui/aboutdialog.py | 3 +- openlp/core/ui/advancedtab.py | 5 +- openlp/core/ui/exceptionform.py | 2 +- openlp/core/ui/firsttimeform.py | 4 +- openlp/core/ui/formattingtagdialog.py | 3 +- openlp/core/ui/generaltab.py | 3 +- openlp/core/ui/maindisplay.py | 3 +- openlp/core/ui/mainwindow.py | 4 +- openlp/core/ui/media/__init__.py | 2 +- openlp/core/ui/media/mediacontroller.py | 3 +- openlp/core/ui/media/phononplayer.py | 3 +- openlp/core/ui/media/playertab.py | 3 +- openlp/core/ui/media/vlcplayer.py | 3 +- openlp/core/ui/media/webkitplayer.py | 3 +- openlp/core/ui/plugindialog.py | 2 +- openlp/core/ui/printservicedialog.py | 3 +- openlp/core/ui/printserviceform.py | 3 +- openlp/core/ui/servicemanager.py | 8 +- openlp/core/ui/shortcutlistform.py | 4 +- openlp/core/ui/slidecontroller.py | 5 +- openlp/core/ui/starttimedialog.py | 2 +- openlp/core/ui/starttimeform.py | 3 +- openlp/core/ui/themeform.py | 3 +- openlp/core/ui/thememanager.py | 6 +- openlp/core/ui/themestab.py | 4 +- openlp/core/ui/themewizard.py | 3 +- openlp/core/ui/wizard.py | 5 +- openlp/core/utils/__init__.py | 4 +- openlp/core/utils/actions.py | 2 +- openlp/core/utils/languagemanager.py | 4 +- openlp/plugins/alerts/alertsplugin.py | 3 +- openlp/plugins/alerts/lib/alertstab.py | 3 +- .../plugins/bibles/forms/bibleimportform.py | 3 +- .../plugins/bibles/forms/bibleupgradeform.py | 4 +- openlp/plugins/bibles/forms/booknamedialog.py | 2 +- openlp/plugins/bibles/forms/booknameform.py | 2 +- .../plugins/bibles/forms/editbibledialog.py | 3 +- openlp/plugins/bibles/forms/editbibleform.py | 3 +- openlp/plugins/bibles/forms/languagedialog.py | 2 +- openlp/plugins/bibles/forms/languageform.py | 2 +- openlp/plugins/bibles/lib/__init__.py | 3 +- openlp/plugins/bibles/lib/biblestab.py | 3 +- openlp/plugins/bibles/lib/manager.py | 4 +- openlp/plugins/bibles/lib/mediaitem.py | 5 +- .../plugins/custom/forms/editcustomdialog.py | 3 +- .../custom/forms/editcustomslidedialog.py | 3 +- .../custom/forms/editcustomslideform.py | 2 +- openlp/plugins/custom/lib/customtab.py | 3 +- openlp/plugins/custom/lib/mediaitem.py | 5 +- openlp/plugins/images/imageplugin.py | 5 +- openlp/plugins/images/lib/imagetab.py | 3 +- openlp/plugins/images/lib/mediaitem.py | 6 +- openlp/plugins/media/lib/mediaitem.py | 4 +- openlp/plugins/media/lib/mediatab.py | 3 +- openlp/plugins/media/mediaplugin.py | 2 +- openlp/plugins/presentations/lib/mediaitem.py | 5 +- .../lib/presentationcontroller.py | 4 +- .../presentations/lib/presentationtab.py | 3 +- openlp/plugins/remotes/lib/httprouter.py | 5 +- openlp/plugins/remotes/lib/httpserver.py | 3 +- openlp/plugins/remotes/lib/remotetab.py | 4 +- openlp/plugins/songs/forms/editsongdialog.py | 3 +- openlp/plugins/songs/forms/editsongform.py | 4 +- openlp/plugins/songs/forms/songexportform.py | 3 +- openlp/plugins/songs/forms/songimportform.py | 4 +- .../songs/forms/songmaintenancedialog.py | 3 +- .../songs/forms/songmaintenanceform.py | 3 +- openlp/plugins/songs/lib/importer.py | 2 +- openlp/plugins/songs/lib/mediaitem.py | 6 +- openlp/plugins/songs/lib/olpimport.py | 2 +- openlp/plugins/songs/lib/oooimport.py | 1 + openlp/plugins/songs/lib/openlyricsexport.py | 4 +- openlp/plugins/songs/lib/opensongimport.py | 3 +- openlp/plugins/songs/lib/powersongimport.py | 2 +- openlp/plugins/songs/lib/songimport.py | 4 +- openlp/plugins/songs/lib/songproimport.py | 1 + .../plugins/songs/lib/songshowplusimport.py | 5 +- openlp/plugins/songs/lib/songstab.py | 3 +- openlp/plugins/songs/lib/ui.py | 1 + .../songs/lib/worshipcenterproimport.py | 2 +- openlp/plugins/songs/lib/wowimport.py | 2 +- openlp/plugins/songs/lib/xml.py | 3 +- openlp/plugins/songs/lib/zionworximport.py | 2 +- openlp/plugins/songs/songsplugin.py | 3 +- .../songusage/forms/songusagedeletedialog.py | 2 +- .../songusage/forms/songusagedeleteform.py | 5 +- .../songusage/forms/songusagedetaildialog.py | 3 +- .../songusage/forms/songusagedetailform.py | 4 +- openlp/plugins/songusage/songusageplugin.py | 3 +- .../openlp_core_common/test_applocation.py | 5 +- .../test_settings.py | 2 +- .../test_uistrings.py | 2 +- .../openlp_core_lib/test_formattingtags.py | 4 +- tests/functional/openlp_core_lib/test_lib.py | 4 +- .../openlp_core_lib/test_pluginmanager.py | 3 +- .../openlp_core_utils/test_actions.py | 2 +- .../openlp_plugins/remotes/test_remotetab.py | 6 +- .../openlp_plugins/remotes/test_router.py | 2 +- .../openlp_plugins/songs/test_mediaitem.py | 3 +- .../openlp_core_lib/test_pluginmanager.py | 3 +- 115 files changed, 257 insertions(+), 693 deletions(-) rename openlp/core/{lib => common}/uistrings.py (99%) delete mode 100644 openlp/core/lib/settings.py rename tests/functional/{openlp_core_lib => openlp_core_common}/test_settings.py (99%) rename tests/functional/{openlp_core_lib => openlp_core_common}/test_uistrings.py (98%) diff --git a/openlp/core/__init__.py b/openlp/core/__init__.py index 2ea41a3ec..7d198db5e 100644 --- a/openlp/core/__init__.py +++ b/openlp/core/__init__.py @@ -43,8 +43,8 @@ from traceback import format_exception from PyQt4 import QtCore, QtGui -from openlp.core.common import AppLocation, check_directory_exists -from openlp.core.lib import Settings, ScreenList, UiStrings, Registry +from openlp.core.common import AppLocation, Settings, UiStrings, check_directory_exists +from openlp.core.lib import ScreenList, Registry from openlp.core.resources import qInitResources from openlp.core.ui.mainwindow import MainWindow from openlp.core.ui.firsttimelanguageform import FirstTimeLanguageForm diff --git a/openlp/core/common/__init__.py b/openlp/core/common/__init__.py index 02fab3512..42fde7065 100644 --- a/openlp/core/common/__init__.py +++ b/openlp/core/common/__init__.py @@ -34,6 +34,8 @@ import os import logging import sys +from PyQt4 import QtCore + log = logging.getLogger(__name__) @@ -64,4 +66,44 @@ def get_frozen_path(frozen_option, non_frozen_option): return frozen_option return non_frozen_option + +class ThemeLevel(object): + """ + Provides an enumeration for the level a theme applies to + """ + Global = 1 + Service = 2 + Song = 3 + + +def translate(context, text, comment=None, encoding=QtCore.QCoreApplication.CodecForTr, n=-1, + qt_translate=QtCore.QCoreApplication.translate): + """ + A special shortcut method to wrap around the Qt4 translation functions. This abstracts the translation procedure so + that we can change it if at a later date if necessary, without having to redo the whole of OpenLP. + + ``context`` + The translation context, used to give each string a context or a namespace. + + ``text`` + The text to put into the translation tables for translation. + + ``comment`` + An identifying string for when the same text is used in different roles within the same context. + """ + return qt_translate(context, text, comment, encoding, n) + + +class SlideLimits(object): + """ + Provides an enumeration for behaviour of OpenLP at the end limits of each service item when pressing the up/down + arrow keys + """ + End = 1 + Wrap = 2 + Next = 3 + +from .uistrings import UiStrings +from .settings import Settings from .applocation import AppLocation + diff --git a/openlp/core/common/applocation.py b/openlp/core/common/applocation.py index 8925b4c59..41b47ecbe 100644 --- a/openlp/core/common/applocation.py +++ b/openlp/core/common/applocation.py @@ -33,6 +33,9 @@ import logging import os import sys +from openlp.core.common import Settings + + if sys.platform != 'win32' and sys.platform != 'darwin': try: from xdg import BaseDirectory @@ -91,7 +94,6 @@ class AppLocation(object): Return the path OpenLP stores all its data under. """ # Check if we have a different data location. - from openlp.core.lib import Settings if Settings().contains('advanced/data path'): path = Settings().value('advanced/data path') else: diff --git a/openlp/core/lib/uistrings.py b/openlp/core/common/uistrings.py similarity index 99% rename from openlp/core/lib/uistrings.py rename to openlp/core/common/uistrings.py index 6d4b4d250..d7a4c1c42 100644 --- a/openlp/core/lib/uistrings.py +++ b/openlp/core/common/uistrings.py @@ -31,7 +31,7 @@ The :mod:`uistrings` module provides standard strings for OpenLP. """ import logging -from openlp.core.lib import translate +from openlp.core.common import translate log = logging.getLogger(__name__) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 40a9c2367..67ac409df 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -37,6 +37,8 @@ import os from PyQt4 import QtCore, QtGui, Qt +from openlp.core.common import translate + log = logging.getLogger(__name__) @@ -72,16 +74,6 @@ class MediaType(object): Video = 2 -class SlideLimits(object): - """ - Provides an enumeration for behaviour of OpenLP at the end limits of each service item when pressing the up/down - arrow keys - """ - End = 1 - Wrap = 2 - Next = 3 - - class ServiceItemAction(object): """ Provides an enumeration for the required action moving between service items by left/right arrow keys @@ -91,24 +83,6 @@ class ServiceItemAction(object): Next = 3 -def translate(context, text, comment=None, encoding=QtCore.QCoreApplication.CodecForTr, n=-1, - qt_translate=QtCore.QCoreApplication.translate): - """ - A special shortcut method to wrap around the Qt4 translation functions. This abstracts the translation procedure so - that we can change it if at a later date if necessary, without having to redo the whole of OpenLP. - - ``context`` - The translation context, used to give each string a context or a namespace. - - ``text`` - The text to put into the translation tables for translation. - - ``comment`` - An identifying string for when the same text is used in different roles within the same context. - """ - return qt_translate(context, text, comment, encoding, n) - - def get_text_file_string(text_file): """ Open a file and return its content as unicode string. If the supplied file name is not a file then the function @@ -326,6 +300,7 @@ def expand_tags(text): text = text.replace(tag['end tag'], tag['end html']) return text + def create_separated_list(string_list): """ Returns a string that represents a join of a list of strings with a localized separator. This function corresponds @@ -355,9 +330,7 @@ def create_separated_list(string_list): from .registry import Registry -from .uistrings import UiStrings from .screen import ScreenList -from .settings import Settings from .listwidgetwithdnd import ListWidgetWithDnD from .treewidgetwithdnd import TreeWidgetWithDnD from .formattingtags import FormattingTags diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index 0fff6e871..6bbca9b5c 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -41,8 +41,8 @@ from sqlalchemy.pool import NullPool from alembic.migration import MigrationContext from alembic.operations import Operations -from openlp.core.common import AppLocation -from openlp.core.lib import translate, Settings +from openlp.core.common import AppLocation, Settings +from openlp.core.lib import translate from openlp.core.lib.ui import critical_error_message_box from openlp.core.utils import delete_file diff --git a/openlp/core/lib/formattingtags.py b/openlp/core/lib/formattingtags.py index f914677c6..58e3226d1 100644 --- a/openlp/core/lib/formattingtags.py +++ b/openlp/core/lib/formattingtags.py @@ -31,7 +31,8 @@ Provide HTML Tag management and Formatting Tag access class """ import json -from openlp.core.lib import Settings, translate +from openlp.core.common import Settings +from openlp.core.lib import translate class FormattingTags(object): diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 3fddc18f2..01e16eef3 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -35,8 +35,9 @@ import re from PyQt4 import QtCore, QtGui +from openlp.core.common import Settings, UiStrings, translate from openlp.core.lib import OpenLPToolbar, ServiceItem, StringContent, ListWidgetWithDnD, \ - ServiceItemContext, Settings, Registry, UiStrings, translate + ServiceItemContext, Registry from openlp.core.lib.searchedit import SearchEdit from openlp.core.lib.ui import create_widget_action, critical_error_message_box diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index fc9830398..2e6f42c6b 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -34,7 +34,8 @@ import os from PyQt4 import QtCore -from openlp.core.lib import Settings, Registry, UiStrings +from openlp.core.common import Settings, UiStrings +from openlp.core.lib import Registry from openlp.core.utils import get_application_version log = logging.getLogger(__name__) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 4b2aacda6..b743f3962 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -31,9 +31,10 @@ import logging from PyQt4 import QtGui, QtCore, QtWebKit -from openlp.core.lib import Settings, FormattingTags, ImageSource, ItemCapabilities, Registry, ScreenList, \ +from openlp.core.common import Settings +from openlp.core.lib import FormattingTags, ImageSource, ItemCapabilities, Registry, ScreenList, \ ServiceItem, expand_tags, build_lyrics_format_css, build_lyrics_outline_css -from openlp.core.lib.theme import ThemeLevel +from openlp.core.common import ThemeLevel from openlp.core.ui import MainDisplay log = logging.getLogger(__name__) diff --git a/openlp/core/lib/screen.py b/openlp/core/lib/screen.py index d1cca99cd..ddae9fba1 100644 --- a/openlp/core/lib/screen.py +++ b/openlp/core/lib/screen.py @@ -36,7 +36,8 @@ import copy from PyQt4 import QtCore -from openlp.core.lib import Registry, translate +from openlp.core.common import Settings, translate +from openlp.core.lib import Registry log = logging.getLogger(__name__) @@ -244,7 +245,6 @@ class ScreenList(object): """ Loads the screen size and the monitor number from the settings. """ - from openlp.core.lib import Settings # Add the screen settings to the settings dict. This has to be done here due to cyclic dependency. # Do not do this anywhere else. screen_settings = { diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index cbb3c8458..c1438840b 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -39,7 +39,8 @@ import uuid from PyQt4 import QtGui -from openlp.core.lib import ImageSource, Settings, Registry, build_icon, clean_tags, expand_tags, translate +from openlp.core.common import Settings +from openlp.core.lib import ImageSource, Registry, build_icon, clean_tags, expand_tags, translate log = logging.getLogger(__name__) diff --git a/openlp/core/lib/settings.py b/openlp/core/lib/settings.py deleted file mode 100644 index a124132ab..000000000 --- a/openlp/core/lib/settings.py +++ /dev/null @@ -1,499 +0,0 @@ -# -*- coding: utf-8 -*- -# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 - -############################################################################### -# OpenLP - Open Source Lyrics Projection # -# --------------------------------------------------------------------------- # -# Copyright (c) 2008-2013 Raoul Snyman # -# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # -# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # -# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # -# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # -# Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith, # -# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Dave Warnock, # -# Frode Woldsund, Martin Zibricky, Patrick Zimmermann # -# --------------------------------------------------------------------------- # -# This program is free software; you can redistribute it and/or modify it # -# under the terms of the GNU General Public License as published by the Free # -# Software Foundation; version 2 of the License. # -# # -# This program is distributed in the hope that it will be useful, but WITHOUT # -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # -# 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 # -############################################################################### -""" -This class contains the core default settings. -""" -import datetime -import logging -import os -import sys - -from PyQt4 import QtCore, QtGui - -from openlp.core.lib import SlideLimits, UiStrings -from openlp.core.lib.theme import ThemeLevel - - -log = logging.getLogger(__name__) - - -# Fix for bug #1014422. -X11_BYPASS_DEFAULT = True -if sys.platform.startswith('linux'): - # Default to False on Gnome. - X11_BYPASS_DEFAULT = bool(not os.environ.get('GNOME_DESKTOP_SESSION_ID')) - # Default to False on Xfce. - if os.environ.get('DESKTOP_SESSION') == 'xfce': - X11_BYPASS_DEFAULT = False - - -class Settings(QtCore.QSettings): - """ - Class to wrap QSettings. - - * Exposes all the methods of QSettings. - * Adds functionality for OpenLP Portable. If the ``defaultFormat`` is set to - ``IniFormat``, and the path to the Ini file is set using ``set_filename``, - then the Settings constructor (without any arguments) will create a Settings - object for accessing settings stored in that Ini file. - - ``__default_settings__`` - This dict contains all core settings with their default values. - - ``__obsolete_settings__`` - Each entry is structured in the following way:: - - (u'general/enable slide loop', u'advanced/slide limits', - [(SlideLimits.Wrap, True), (SlideLimits.End, False)]) - - The first entry is the *old key*; it will be removed. - - The second entry is the *new key*; we will add it to the config. If this is just an empty string, we just remove - the old key. - - The last entry is a list containing two-pair tuples. If the list is empty, no conversion is made. Otherwise each - pair describes how to convert the old setting's value:: - - (SlideLimits.Wrap, True) - - This means, that if the value of ``general/enable slide loop`` is equal (``==``) ``True`` then we set - ``advanced/slide limits`` to ``SlideLimits.Wrap``. **NOTE**, this means that the rules have to cover all cases! - So, if the type of the old value is bool, then there must be two rules. - """ - __default_settings__ = { - 'advanced/add page break': False, - 'advanced/alternate rows': not sys.platform.startswith('win'), - 'advanced/current media plugin': -1, - 'advanced/data path': '', - 'advanced/default color': '#ffffff', - 'advanced/default image': ':/graphics/openlp-splash-screen.png', - # 7 stands for now, 0 to 6 is Monday to Sunday. - 'advanced/default service day': 7, - 'advanced/default service enabled': True, - 'advanced/default service hour': 11, - 'advanced/default service minute': 0, - 'advanced/default service name': UiStrings().DefaultServiceName, - 'advanced/display size': 0, - 'advanced/double click live': False, - 'advanced/enable exit confirmation': True, - 'advanced/expand service item': False, - 'advanced/hide mouse': True, - 'advanced/is portable': False, - 'advanced/max recent files': 20, - 'advanced/print file meta data': False, - 'advanced/print notes': False, - 'advanced/print slide text': False, - 'advanced/recent file count': 4, - 'advanced/save current plugin': False, - 'advanced/slide limits': SlideLimits.End, - 'advanced/single click preview': False, - 'advanced/x11 bypass wm': X11_BYPASS_DEFAULT, - 'crashreport/last directory': '', - 'formattingTags/html_tags': '', - 'core/audio repeat list': False, - 'core/auto open': False, - 'core/auto preview': False, - 'core/audio start paused': True, - 'core/auto unblank': False, - 'core/blank warning': False, - 'core/ccli number': '', - 'core/has run wizard': False, - 'core/language': '[en]', - 'core/last version test': '', - 'core/loop delay': 5, - 'core/recent files': [], - 'core/save prompt': False, - 'core/screen blank': False, - 'core/show splash': True, - 'core/songselect password': '', - 'core/songselect username': '', - 'core/update check': True, - 'core/view mode': 'default', - # The other display settings (display position and dimensions) are defined in the ScreenList class due to a - # circular dependency. - 'core/display on monitor': True, - 'core/override position': False, - 'images/background color': '#000000', - 'media/players': 'webkit', - 'media/override player': QtCore.Qt.Unchecked, - 'players/background color': '#000000', - 'servicemanager/last directory': '', - 'servicemanager/last file': '', - 'servicemanager/service theme': '', - 'SettingsImport/file_date_created': datetime.datetime.now().strftime("%Y-%m-%d %H:%M"), - 'SettingsImport/Make_Changes': 'At_Own_RISK', - 'SettingsImport/type': 'OpenLP_settings_export', - 'SettingsImport/version': '', - 'shortcuts/aboutItem': [QtGui.QKeySequence('Ctrl+F1')], - 'shortcuts/addToService': [], - 'shortcuts/audioPauseItem': [], - 'shortcuts/displayTagItem': [], - 'shortcuts/blankScreen': [QtGui.QKeySequence(QtCore.Qt.Key_Period)], - 'shortcuts/collapse': [QtGui.QKeySequence(QtCore.Qt.Key_Minus)], - 'shortcuts/desktopScreen': [QtGui.QKeySequence('D')], - 'shortcuts/delete': [], - 'shortcuts/down': [QtGui.QKeySequence(QtCore.Qt.Key_Down)], - 'shortcuts/editSong': [], - 'shortcuts/escapeItem': [QtGui.QKeySequence(QtCore.Qt.Key_Escape)], - 'shortcuts/expand': [QtGui.QKeySequence(QtCore.Qt.Key_Plus)], - 'shortcuts/exportThemeItem': [], - 'shortcuts/fileNewItem': [QtGui.QKeySequence('Ctrl+N')], - 'shortcuts/fileSaveAsItem': [QtGui.QKeySequence('Ctrl+Shift+S')], - 'shortcuts/fileExitItem': [QtGui.QKeySequence('Alt+F4')], - 'shortcuts/fileSaveItem': [QtGui.QKeySequence('Ctrl+S')], - 'shortcuts/fileOpenItem': [QtGui.QKeySequence('Ctrl+O')], - 'shortcuts/goLive': [], - 'shortcuts/importThemeItem': [], - 'shortcuts/importBibleItem': [], - 'shortcuts/listViewBiblesDeleteItem': [QtGui.QKeySequence(QtCore.Qt.Key_Delete)], - 'shortcuts/listViewBiblesPreviewItem': [QtGui.QKeySequence(QtCore.Qt.Key_Enter), - QtGui.QKeySequence(QtCore.Qt.Key_Return)], - 'shortcuts/listViewBiblesLiveItem': [QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Enter), - QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Return)], - 'shortcuts/listViewBiblesServiceItem': [QtGui.QKeySequence(QtCore.Qt.Key_Plus), - QtGui.QKeySequence(QtCore.Qt.Key_Equal)], - 'shortcuts/listViewCustomDeleteItem': [QtGui.QKeySequence(QtCore.Qt.Key_Delete)], - 'shortcuts/listViewCustomPreviewItem': [QtGui.QKeySequence(QtCore.Qt.Key_Enter), - QtGui.QKeySequence(QtCore.Qt.Key_Return)], - 'shortcuts/listViewCustomLiveItem': [QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Enter), - QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Return)], - 'shortcuts/listViewCustomServiceItem': [QtGui.QKeySequence(QtCore.Qt.Key_Plus), - QtGui.QKeySequence(QtCore.Qt.Key_Equal)], - 'shortcuts/listViewImagesDeleteItem': [QtGui.QKeySequence(QtCore.Qt.Key_Delete)], - 'shortcuts/listViewImagesPreviewItem': [QtGui.QKeySequence(QtCore.Qt.Key_Enter), - QtGui.QKeySequence(QtCore.Qt.Key_Return)], - 'shortcuts/listViewImagesLiveItem': [QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Enter), - QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Return)], - 'shortcuts/listViewImagesServiceItem': [QtGui.QKeySequence(QtCore.Qt.Key_Plus), - QtGui.QKeySequence(QtCore.Qt.Key_Equal)], - 'shortcuts/listViewMediaDeleteItem': [QtGui.QKeySequence(QtCore.Qt.Key_Delete)], - 'shortcuts/listViewMediaPreviewItem': [QtGui.QKeySequence(QtCore.Qt.Key_Enter), - QtGui.QKeySequence(QtCore.Qt.Key_Return)], - 'shortcuts/listViewMediaLiveItem': [QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Enter), - QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Return)], - 'shortcuts/listViewMediaServiceItem': [QtGui.QKeySequence(QtCore.Qt.Key_Plus), - QtGui.QKeySequence(QtCore.Qt.Key_Equal)], - 'shortcuts/listViewPresentationsDeleteItem': [QtGui.QKeySequence(QtCore.Qt.Key_Delete)], - 'shortcuts/listViewPresentationsPreviewItem': [QtGui.QKeySequence(QtCore.Qt.Key_Enter), - QtGui.QKeySequence(QtCore.Qt.Key_Return)], - 'shortcuts/listViewPresentationsLiveItem': [QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Enter), - QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Return)], - 'shortcuts/listViewPresentationsServiceItem': [QtGui.QKeySequence(QtCore.Qt.Key_Plus), - QtGui.QKeySequence(QtCore.Qt.Key_Equal)], - 'shortcuts/listViewSongsDeleteItem': [QtGui.QKeySequence(QtCore.Qt.Key_Delete)], - 'shortcuts/listViewSongsPreviewItem': [QtGui.QKeySequence(QtCore.Qt.Key_Enter), - QtGui.QKeySequence(QtCore.Qt.Key_Return)], - 'shortcuts/listViewSongsLiveItem': [QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Enter), - QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Return)], - 'shortcuts/listViewSongsServiceItem': [QtGui.QKeySequence(QtCore.Qt.Key_Plus), - QtGui.QKeySequence(QtCore.Qt.Key_Equal)], - 'shortcuts/lockPanel': [], - 'shortcuts/modeDefaultItem': [], - 'shortcuts/modeLiveItem': [], - 'shortcuts/make_live': [QtGui.QKeySequence(QtCore.Qt.Key_Enter), QtGui.QKeySequence(QtCore.Qt.Key_Return)], - 'shortcuts/moveUp': [QtGui.QKeySequence(QtCore.Qt.Key_PageUp)], - 'shortcuts/moveTop': [QtGui.QKeySequence(QtCore.Qt.Key_Home)], - 'shortcuts/modeSetupItem': [], - 'shortcuts/moveBottom': [QtGui.QKeySequence(QtCore.Qt.Key_End)], - 'shortcuts/moveDown': [QtGui.QKeySequence(QtCore.Qt.Key_PageDown)], - 'shortcuts/nextTrackItem': [], - 'shortcuts/nextItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Down), - QtGui.QKeySequence(QtCore.Qt.Key_PageDown)], - 'shortcuts/nextItem_preview': [], - 'shortcuts/nextService': [QtGui.QKeySequence(QtCore.Qt.Key_Right)], - 'shortcuts/newService': [], - 'shortcuts/offlineHelpItem': [], - 'shortcuts/onlineHelpItem': [QtGui.QKeySequence('Alt+F1')], - 'shortcuts/openService': [], - 'shortcuts/saveService': [], - 'shortcuts/previousItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Up), - QtGui.QKeySequence(QtCore.Qt.Key_PageUp)], - 'shortcuts/playbackPause': [], - 'shortcuts/playbackPlay': [], - 'shortcuts/playbackStop': [], - 'shortcuts/playSlidesLoop': [], - 'shortcuts/playSlidesOnce': [], - 'shortcuts/previousService': [QtGui.QKeySequence(QtCore.Qt.Key_Left)], - 'shortcuts/previousItem_preview': [], - 'shortcuts/printServiceItem': [QtGui.QKeySequence('Ctrl+P')], - 'shortcuts/songExportItem': [], - 'shortcuts/songUsageStatus': [QtGui.QKeySequence(QtCore.Qt.Key_F4)], - 'shortcuts/searchShortcut': [QtGui.QKeySequence('Ctrl+F')], - 'shortcuts/settingsShortcutsItem': [], - 'shortcuts/settingsImportItem': [], - 'shortcuts/settingsPluginListItem': [QtGui.QKeySequence('Alt+F7')], - 'shortcuts/songUsageDelete': [], - 'shortcuts/settingsConfigureItem': [], - 'shortcuts/shortcutAction_B': [QtGui.QKeySequence('B')], - 'shortcuts/shortcutAction_C': [QtGui.QKeySequence('C')], - 'shortcuts/shortcutAction_E': [QtGui.QKeySequence('E')], - 'shortcuts/shortcutAction_I': [QtGui.QKeySequence('I')], - 'shortcuts/shortcutAction_O': [QtGui.QKeySequence('O')], - 'shortcuts/shortcutAction_P': [QtGui.QKeySequence('P')], - 'shortcuts/shortcutAction_V': [QtGui.QKeySequence('V')], - 'shortcuts/shortcutAction_0': [QtGui.QKeySequence('0')], - 'shortcuts/shortcutAction_1': [QtGui.QKeySequence('1')], - 'shortcuts/shortcutAction_2': [QtGui.QKeySequence('2')], - 'shortcuts/shortcutAction_3': [QtGui.QKeySequence('3')], - 'shortcuts/shortcutAction_4': [QtGui.QKeySequence('4')], - 'shortcuts/shortcutAction_5': [QtGui.QKeySequence('5')], - 'shortcuts/shortcutAction_6': [QtGui.QKeySequence('6')], - 'shortcuts/shortcutAction_7': [QtGui.QKeySequence('7')], - 'shortcuts/shortcutAction_8': [QtGui.QKeySequence('8')], - 'shortcuts/shortcutAction_9': [QtGui.QKeySequence('9')], - 'shortcuts/settingsExportItem': [], - 'shortcuts/songUsageReport': [], - 'shortcuts/songImportItem': [], - 'shortcuts/themeScreen': [QtGui.QKeySequence('T')], - 'shortcuts/toolsReindexItem': [], - 'shortcuts/toolsFindDuplicates': [], - 'shortcuts/toolsAlertItem': [QtGui.QKeySequence('F7')], - 'shortcuts/toolsFirstTimeWizard': [], - 'shortcuts/toolsOpenDataFolder': [], - 'shortcuts/toolsAddToolItem': [], - 'shortcuts/updateThemeImages': [], - 'shortcuts/up': [QtGui.QKeySequence(QtCore.Qt.Key_Up)], - 'shortcuts/viewThemeManagerItem': [QtGui.QKeySequence('F10')], - 'shortcuts/viewMediaManagerItem': [QtGui.QKeySequence('F8')], - 'shortcuts/viewPreviewPanel': [QtGui.QKeySequence('F11')], - 'shortcuts/viewLivePanel': [QtGui.QKeySequence('F12')], - 'shortcuts/viewServiceManagerItem': [QtGui.QKeySequence('F9')], - 'shortcuts/webSiteItem': [], - 'themes/global theme': '', - 'themes/last directory': '', - 'themes/last directory export': '', - 'themes/last directory import': '', - 'themes/theme level': ThemeLevel.Song, - 'user interface/live panel': True, - 'user interface/live splitter geometry': QtCore.QByteArray(), - 'user interface/lock panel': False, - 'user interface/main window geometry': QtCore.QByteArray(), - 'user interface/main window position': QtCore.QPoint(0, 0), - 'user interface/main window splitter geometry': QtCore.QByteArray(), - 'user interface/main window state': QtCore.QByteArray(), - 'user interface/preview panel': True, - 'user interface/preview splitter geometry': QtCore.QByteArray() - } - __file_path__ = '' - __obsolete_settings__ = [ - # Changed during 1.9.x development. - ('bibles/bookname language', 'bibles/book name language', []), - ('general/enable slide loop', 'advanced/slide limits', [(SlideLimits.Wrap, True), (SlideLimits.End, False)]), - ('songs/ccli number', 'core/ccli number', []), - ('media/use phonon', '', []), - # Changed during 2.1.x development. - ('advanced/stylesheet fix', '', []), - ('bibles/last directory 1', 'bibles/last directory import', []), - ('media/background color', 'players/background color', []), - ('themes/last directory', 'themes/last directory import', []), - ('themes/last directory 1', 'themes/last directory export', []), - ('songs/last directory 1', 'songs/last directory import', []), - ('songusage/last directory 1', 'songusage/last directory export', []), - ('user interface/mainwindow splitter geometry', 'user interface/main window splitter geometry', []), - ('shortcuts/makeLive', 'shortcuts/make_live', []), - ('general/audio repeat list', 'core/audio repeat list', []), - ('general/auto open', 'core/auto open', []), - ('general/auto preview', 'core/auto preview', []), - ('general/audio start paused', 'core/audio start paused', []), - ('general/auto unblank', 'core/auto unblank', []), - ('general/blank warning', 'core/blank warning', []), - ('general/ccli number', 'core/ccli number', []), - ('general/has run wizard', 'core/has run wizard', []), - ('general/language', 'core/language', []), - ('general/last version test', 'core/last version test', []), - ('general/loop delay', 'core/loop delay', []), - ('general/recent files', 'core/recent files', []), - ('general/save prompt', 'core/save prompt', []), - ('general/screen blank', 'core/screen blank', []), - ('general/show splash', 'core/show splash', []), - ('general/songselect password', 'core/songselect password', []), - ('general/songselect username', 'core/songselect username', []), - ('general/update check', 'core/update check', []), - ('general/view mode', 'core/view mode', []), - ('general/display on monitor', 'core/display on monitor', []), - ('general/override position', 'core/override position', []), - ('general/x position', 'core/x position', []), - ('general/y position', 'core/y position', []), - ('general/monitor', 'core/monitor', []), - ('general/height', 'core/height', []), - ('general/monitor', 'core/monitor', []), - ('general/width', 'core/width', []) - ] - - @staticmethod - def extend_default_settings(default_values): - """ - Static method to merge the given ``default_values`` with the ``Settings.__default_settings__``. - - ``default_values`` - A dict with setting keys and their default values. - """ - Settings.__default_settings__ = dict(list(default_values.items()) + list(Settings.__default_settings__.items())) - - @staticmethod - def set_filename(ini_file): - """ - Sets the complete path to an Ini file to be used by Settings objects. - - Does not affect existing Settings objects. - """ - Settings.__file_path__ = ini_file - - @staticmethod - def set_up_default_values(): - """ - This static method is called on start up. It is used to perform any operation on the __default_settings__ dict. - """ - # Make sure the string is translated (when building the dict the string is not translated because the translate - # function was not set up as this stage). - Settings.__default_settings__['advanced/default service name'] = UiStrings().DefaultServiceName - - def __init__(self, *args): - """ - Constructor which checks if this should be a native settings object, or an INI file. - """ - if not args and Settings.__file_path__ and Settings.defaultFormat() == Settings.IniFormat: - QtCore.QSettings.__init__(self, Settings.__file_path__, Settings.IniFormat) - else: - QtCore.QSettings.__init__(self, *args) - - def get_default_value(self, key): - """ - Get the default value of the given key - """ - if self.group(): - key = self.group() + '/' + key - return Settings.__default_settings__[key] - - def remove_obsolete_settings(self): - """ - This method is only called to clean up the config. It removes old settings and it renames settings. See - ``__obsolete_settings__`` for more details. - """ - for old_key, new_key, rules in Settings.__obsolete_settings__: - # Once removed we don't have to do this again. - if self.contains(old_key): - if new_key: - # Get the value of the old_key. - old_value = super(Settings, self).value(old_key) - # When we want to convert the value, we have to figure out the default value (because we cannot get - # the default value from the central settings dict. - if rules: - default_value = rules[0][1] - old_value = self._convert_value(old_value, default_value) - # Iterate over our rules and check what the old_value should be "converted" to. - for new, old in rules: - # If the value matches with the condition (rule), then use the provided value. This is used to - # convert values. E. g. an old value 1 results in True, and 0 in False. - if old == old_value: - old_value = new - break - self.setValue(new_key, old_value) - self.remove(old_key) - - def value(self, key): - """ - Returns the value for the given ``key``. The returned ``value`` is of the same type as the default value in the - *Settings.__default_settings__* dict. - - ``key`` - The key to return the value from. - """ - # if group() is not empty the group has not been specified together with the key. - if self.group(): - default_value = Settings.__default_settings__[self.group() + '/' + key] - else: - default_value = Settings.__default_settings__[key] - setting = super(Settings, self).value(key, default_value) - return self._convert_value(setting, default_value) - - def _convert_value(self, setting, default_value): - """ - This converts the given ``setting`` to the type of the given ``default_value``. - - ``setting`` - The setting to convert. This could be ``true`` for example.Settings() - - ``default_value`` - Indication the type the setting should be converted to. For example ``True`` (type is boolean), meaning that - we convert the string ``true`` to a python boolean. - - **Note**, this method only converts a few types and might need to be extended if a certain type is missing! - """ - # On OS X (and probably on other platforms too) empty value from QSettings is represented as type - # PyQt4.QtCore.QPyNullVariant. This type has to be converted to proper 'None' Python type. - if isinstance(setting, QtCore.QPyNullVariant) and setting.isNull(): - setting = None - # Handle 'None' type (empty value) properly. - if setting is None: - # An empty string saved to the settings results in a None type being returned. - # Convert it to empty unicode string. - if isinstance(default_value, str): - return '' - # An empty list saved to the settings results in a None type being returned. - else: - return [] - # Convert the setting to the correct type. - if isinstance(default_value, bool): - if isinstance(setting, bool): - return setting - # Sometimes setting is string instead of a boolean. - return setting == 'true' - if isinstance(default_value, int): - return int(setting) - return setting - - def get_files_from_config(self, plugin): - """ - This removes the settings needed for old way we saved files (e. g. the image paths for the image plugin). A list - of file paths are returned. - - **Note**: Only a list of paths is returned; this does not convert anything! - - ``plugin`` - The Plugin object.The caller has to convert/save the list himself; o - """ - files_list = [] - # We need QSettings instead of Settings here to bypass our central settings dict. - # Do NOT do this anywhere else! - settings = QtCore.QSettings(self.fileName(), Settings.IniFormat) - settings.beginGroup(plugin.settings_section) - if settings.contains('%s count' % plugin.name): - # Get the count. - list_count = int(settings.value('%s count' % plugin.name, 0)) - if list_count: - for counter in range(list_count): - # The keys were named e. g.: "image 0" - item = settings.value('%s %d' % (plugin.name, counter), '') - if item: - files_list.append(item) - settings.remove('%s %d' % (plugin.name, counter)) - settings.remove('%s count' % plugin.name) - settings.endGroup() - return files_list diff --git a/openlp/core/lib/theme.py b/openlp/core/lib/theme.py index c10a59560..98e98ac6e 100644 --- a/openlp/core/lib/theme.py +++ b/openlp/core/lib/theme.py @@ -43,15 +43,6 @@ from openlp.core.lib import str_to_bool, ScreenList, get_text_file_string log = logging.getLogger(__name__) -class ThemeLevel(object): - """ - Provides an enumeration for the level a theme applies to - """ - Global = 1 - Service = 2 - Song = 3 - - class BackgroundType(object): """ Type enumeration for backgrounds. diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 14ffdc2e8..631187505 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -33,7 +33,8 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Registry, UiStrings, build_icon, translate +from openlp.core.common import UiStrings, translate +from openlp.core.lib import Registry, build_icon from openlp.core.utils.actions import ActionList diff --git a/openlp/core/ui/aboutdialog.py b/openlp/core/ui/aboutdialog.py index e96553803..f825e9a63 100644 --- a/openlp/core/ui/aboutdialog.py +++ b/openlp/core/ui/aboutdialog.py @@ -29,7 +29,8 @@ from PyQt4 import QtGui -from openlp.core.lib import UiStrings, build_icon, translate +from openlp.core.common import UiStrings, translate +from openlp.core.lib import build_icon from openlp.core.lib.ui import create_button, create_button_box diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index fbd44a9f8..50bdc57fa 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -36,10 +36,9 @@ import sys from PyQt4 import QtCore, QtGui -from openlp.core.common import AppLocation -from openlp.core.lib import SettingsTab, Settings, UiStrings, translate, build_icon +from openlp.core.common import AppLocation, Settings, SlideLimits, UiStrings, translate +from openlp.core.lib import SettingsTab, build_icon from openlp.core.utils import format_time, get_images_filter -from openlp.core.lib import SlideLimits log = logging.getLogger(__name__) diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 2dc034f71..b2427e009 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -85,7 +85,7 @@ try: except ImportError: VLC_VERSION = '-' -from openlp.core.lib import UiStrings, Settings, translate +from openlp.core.common import Settings, UiStrings, translate from openlp.core.utils import get_application_version from .exceptiondialog import Ui_ExceptionDialog diff --git a/openlp/core/ui/firsttimeform.py b/openlp/core/ui/firsttimeform.py index cbb5434f9..31d9cf198 100644 --- a/openlp/core/ui/firsttimeform.py +++ b/openlp/core/ui/firsttimeform.py @@ -41,8 +41,8 @@ from configparser import SafeConfigParser from PyQt4 import QtCore, QtGui -from openlp.core.common import AppLocation, check_directory_exists -from openlp.core.lib import PluginStatus, Settings, Registry, build_icon, translate +from openlp.core.common import AppLocation, Settings, check_directory_exists +from openlp.core.lib import PluginStatus, Registry, build_icon, translate from openlp.core.utils import get_web_page from .firsttimewizard import Ui_FirstTimeWizard, FirstTimePage diff --git a/openlp/core/ui/formattingtagdialog.py b/openlp/core/ui/formattingtagdialog.py index 6d7dd2453..f7855e470 100644 --- a/openlp/core/ui/formattingtagdialog.py +++ b/openlp/core/ui/formattingtagdialog.py @@ -31,7 +31,8 @@ The UI widgets for the formatting tags window. """ from PyQt4 import QtCore, QtGui -from openlp.core.lib import UiStrings, translate, build_icon +from openlp.core.common import UiStrings, translate +from openlp.core.lib import build_icon from openlp.core.lib.ui import create_button_box diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index 42bba94d3..2e758ed34 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -33,7 +33,8 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Registry, Settings, SettingsTab, ScreenList, UiStrings, translate +from openlp.core.common import Settings, UiStrings, translate +from openlp.core.lib import Registry, SettingsTab, ScreenList log = logging.getLogger(__name__) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index f2c1033ed..541e5002a 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -44,7 +44,8 @@ import sys from PyQt4 import QtCore, QtGui, QtWebKit, QtOpenGL from PyQt4.phonon import Phonon -from openlp.core.lib import ServiceItem, Settings, ImageSource, Registry, build_html, expand_tags, \ +from openlp.core.common import Settings +from openlp.core.lib import ServiceItem, ImageSource, Registry, build_html, expand_tags, \ image_to_byte, translate from openlp.core.lib.theme import BackgroundType diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 4110c5e04..f397e3306 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -42,12 +42,12 @@ from datetime import datetime from PyQt4 import QtCore, QtGui from openlp.core.lib import Renderer, OpenLPDockWidget, PluginManager, ImageManager, PluginStatus, Registry, \ - Settings, ScreenList, build_icon, translate + ScreenList, build_icon, translate from openlp.core.lib.ui import UiStrings, create_action from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, ThemeManager, SlideController, PluginForm, \ MediaDockManager, ShortcutListForm, FormattingTagForm -from openlp.core.common import AppLocation, check_directory_exists +from openlp.core.common import AppLocation, Settings, check_directory_exists from openlp.core.ui.media import MediaController from openlp.core.utils import LanguageManager, add_actions, get_application_version from openlp.core.utils.actions import ActionList, CategoryOrder diff --git a/openlp/core/ui/media/__init__.py b/openlp/core/ui/media/__init__.py index 19771862f..02c22fc68 100644 --- a/openlp/core/ui/media/__init__.py +++ b/openlp/core/ui/media/__init__.py @@ -31,7 +31,7 @@ The :mod:`~openlp.core.ui.media` module contains classes and objects for media p """ import logging -from openlp.core.lib import Settings +from openlp.core.common import Settings from PyQt4 import QtCore diff --git a/openlp/core/ui/media/mediacontroller.py b/openlp/core/ui/media/mediacontroller.py index 83b9630fc..eb2d932ee 100644 --- a/openlp/core/ui/media/mediacontroller.py +++ b/openlp/core/ui/media/mediacontroller.py @@ -35,7 +35,8 @@ import os import datetime from PyQt4 import QtCore, QtGui -from openlp.core.lib import OpenLPToolbar, Settings, Registry, UiStrings, translate +from openlp.core.common import Settings, UiStrings, translate +from openlp.core.lib import OpenLPToolbar, Registry from openlp.core.lib.ui import critical_error_message_box from openlp.core.ui.media import MediaState, MediaInfo, MediaType, get_media_players, set_media_players from openlp.core.ui.media.mediaplayer import MediaPlayer diff --git a/openlp/core/ui/media/phononplayer.py b/openlp/core/ui/media/phononplayer.py index 0ea0bf2ff..fadd8a694 100644 --- a/openlp/core/ui/media/phononplayer.py +++ b/openlp/core/ui/media/phononplayer.py @@ -36,7 +36,8 @@ from datetime import datetime from PyQt4 import QtGui from PyQt4.phonon import Phonon -from openlp.core.lib import Settings, translate +from openlp.core.common import Settings +from openlp.core.lib import translate from openlp.core.ui.media import MediaState from openlp.core.ui.media.mediaplayer import MediaPlayer diff --git a/openlp/core/ui/media/playertab.py b/openlp/core/ui/media/playertab.py index b01f37ac7..4aa9feb0f 100644 --- a/openlp/core/ui/media/playertab.py +++ b/openlp/core/ui/media/playertab.py @@ -31,7 +31,8 @@ The :mod:`~openlp.core.ui.media.playertab` module holds the configuration tab fo """ from PyQt4 import QtCore, QtGui -from openlp.core.lib import Registry, SettingsTab, Settings, UiStrings, translate +from openlp.core.common import Settings, UiStrings, translate +from openlp.core.lib import Registry, SettingsTab from openlp.core.lib.ui import create_button from openlp.core.ui.media import get_media_players, set_media_players diff --git a/openlp/core/ui/media/vlcplayer.py b/openlp/core/ui/media/vlcplayer.py index 2055f287b..139751603 100644 --- a/openlp/core/ui/media/vlcplayer.py +++ b/openlp/core/ui/media/vlcplayer.py @@ -37,7 +37,8 @@ import sys from PyQt4 import QtGui -from openlp.core.lib import Settings, translate +from openlp.core.common import Settings +from openlp.core.lib import translate from openlp.core.ui.media import MediaState from openlp.core.ui.media.mediaplayer import MediaPlayer diff --git a/openlp/core/ui/media/webkitplayer.py b/openlp/core/ui/media/webkitplayer.py index 3983a1e8d..c8cae2d13 100644 --- a/openlp/core/ui/media/webkitplayer.py +++ b/openlp/core/ui/media/webkitplayer.py @@ -33,7 +33,8 @@ from PyQt4 import QtGui import logging -from openlp.core.lib import Settings, translate +from openlp.core.common import Settings +from openlp.core.lib import translate from openlp.core.ui.media import MediaState from openlp.core.ui.media.mediaplayer import MediaPlayer diff --git a/openlp/core/ui/plugindialog.py b/openlp/core/ui/plugindialog.py index d0bc0f103..fe7a185d6 100644 --- a/openlp/core/ui/plugindialog.py +++ b/openlp/core/ui/plugindialog.py @@ -31,7 +31,7 @@ The UI widgets of the plugin view dialog #""" from PyQt4 import QtCore, QtGui -from openlp.core.lib import UiStrings, translate +from openlp.core.common import UiStrings, translate from openlp.core.lib.ui import create_button_box diff --git a/openlp/core/ui/printservicedialog.py b/openlp/core/ui/printservicedialog.py index 6f007cf64..13308d6aa 100644 --- a/openlp/core/ui/printservicedialog.py +++ b/openlp/core/ui/printservicedialog.py @@ -31,7 +31,8 @@ The UI widgets of the print service dialog. """ from PyQt4 import QtCore, QtGui -from openlp.core.lib import SpellTextEdit, UiStrings, build_icon, translate +from openlp.core.common import UiStrings, translate +from openlp.core.lib import SpellTextEdit, build_icon class ZoomSize(object): diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 153b6bed9..6c2dab2be 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -36,7 +36,8 @@ import os from PyQt4 import QtCore, QtGui from lxml import html -from openlp.core.lib import Settings, UiStrings, Registry, translate, get_text_file_string +from openlp.core.common import Settings, UiStrings, translate +from openlp.core.lib import Registry, get_text_file_string from openlp.core.ui.printservicedialog import Ui_PrintServiceDialog, ZoomSize from openlp.core.common import AppLocation diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index ee4fa850f..20989bb90 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -42,10 +42,10 @@ log = logging.getLogger(__name__) from PyQt4 import QtCore, QtGui -from openlp.core.common import AppLocation, check_directory_exists -from openlp.core.lib import OpenLPToolbar, ServiceItem, ItemCapabilities, Settings, PluginStatus, Registry, \ - UiStrings, build_icon, translate -from openlp.core.lib.theme import ThemeLevel +from openlp.core.common import AppLocation, Settings, check_directory_exists, UiStrings, translate +from openlp.core.lib import OpenLPToolbar, ServiceItem, ItemCapabilities, PluginStatus, Registry, \ + build_icon +from openlp.core.common import ThemeLevel from openlp.core.lib.ui import critical_error_message_box, create_widget_action, find_and_set_in_combo_box from openlp.core.ui import ServiceNoteForm, ServiceItemEditForm, StartTimeForm from openlp.core.ui.printserviceform import PrintServiceForm diff --git a/openlp/core/ui/shortcutlistform.py b/openlp/core/ui/shortcutlistform.py index f49b66678..efe876e3e 100644 --- a/openlp/core/ui/shortcutlistform.py +++ b/openlp/core/ui/shortcutlistform.py @@ -33,8 +33,8 @@ import re from PyQt4 import QtCore, QtGui -from openlp.core.lib import Registry, Settings -from openlp.core.utils import translate +from openlp.core.lib import Registry +from openlp.core.common import Settings, translate from openlp.core.utils.actions import ActionList from .shortcutlistdialog import Ui_ShortcutListDialog diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index a04af6525..171a24f16 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -37,8 +37,9 @@ from collections import deque from PyQt4 import QtCore, QtGui -from openlp.core.lib import OpenLPToolbar, ItemCapabilities, ServiceItem, ImageSource, SlideLimits, \ - ServiceItemAction, Settings, Registry, UiStrings, ScreenList, build_icon, build_html, translate +from openlp.core.common import Settings, SlideLimits, UiStrings, translate +from openlp.core.lib import OpenLPToolbar, ItemCapabilities, ServiceItem, ImageSource, \ + ServiceItemAction, Registry, ScreenList, build_icon, build_html from openlp.core.ui import HideMode, MainDisplay, Display, DisplayControllerType from openlp.core.lib.ui import create_action from openlp.core.utils.actions import ActionList, CategoryOrder diff --git a/openlp/core/ui/starttimedialog.py b/openlp/core/ui/starttimedialog.py index dfd794f26..24e11c14e 100644 --- a/openlp/core/ui/starttimedialog.py +++ b/openlp/core/ui/starttimedialog.py @@ -31,7 +31,7 @@ The UI widgets for the time dialog """ from PyQt4 import QtCore, QtGui -from openlp.core.lib import UiStrings, translate +from openlp.core.common import UiStrings, translate from openlp.core.lib.ui import create_button_box diff --git a/openlp/core/ui/starttimeform.py b/openlp/core/ui/starttimeform.py index 0a0867b3f..308453978 100644 --- a/openlp/core/ui/starttimeform.py +++ b/openlp/core/ui/starttimeform.py @@ -33,7 +33,8 @@ from PyQt4 import QtGui from .starttimedialog import Ui_StartTimeDialog -from openlp.core.lib import UiStrings, Registry, translate +from openlp.core.common import UiStrings, translate +from openlp.core.lib import Registry from openlp.core.lib.ui import critical_error_message_box diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index fe92d679b..46f632827 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -34,7 +34,8 @@ import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import UiStrings, Registry, translate +from openlp.core.common import UiStrings, translate +from openlp.core.lib import Registry from openlp.core.lib.theme import BackgroundType, BackgroundGradientType from openlp.core.lib.ui import critical_error_message_box from openlp.core.ui import ThemeLayoutForm diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 8dd0727ea..daee4c320 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -38,9 +38,9 @@ import re from xml.etree.ElementTree import ElementTree, XML from PyQt4 import QtCore, QtGui -from openlp.core.common import AppLocation, check_directory_exists -from openlp.core.lib import ImageSource, OpenLPToolbar, Registry, Settings, UiStrings, get_text_file_string, \ - build_icon, translate, check_item_selected, create_thumb, validate_thumb +from openlp.core.common import AppLocation, Settings, check_directory_exists, UiStrings, translate +from openlp.core.lib import ImageSource, OpenLPToolbar, Registry, get_text_file_string, \ + build_icon, check_item_selected, create_thumb, validate_thumb from openlp.core.lib.theme import ThemeXML, BackgroundType from openlp.core.lib.ui import critical_error_message_box, create_widget_action from openlp.core.ui import FileRenameForm, ThemeForm, ThemeManagerHelper diff --git a/openlp/core/ui/themestab.py b/openlp/core/ui/themestab.py index c3c93f3af..be06f6ffc 100644 --- a/openlp/core/ui/themestab.py +++ b/openlp/core/ui/themestab.py @@ -33,8 +33,8 @@ The Themes configuration tab from PyQt4 import QtCore, QtGui -from openlp.core.lib import Registry, Settings, SettingsTab, UiStrings, translate -from openlp.core.lib.theme import ThemeLevel +from openlp.core.common import Settings, ThemeLevel, UiStrings, translate +from openlp.core.lib import Registry, SettingsTab from openlp.core.lib.ui import find_and_set_in_combo_box diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index f0674e924..d681a4428 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -31,7 +31,8 @@ The Create/Edit theme wizard """ from PyQt4 import QtCore, QtGui -from openlp.core.lib import UiStrings, build_icon, translate +from openlp.core.common import UiStrings, translate +from openlp.core.lib import build_icon from openlp.core.lib.theme import HorizontalType, BackgroundType, BackgroundGradientType from openlp.core.lib.ui import add_welcome_page, create_valign_selection_widgets diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index 3a8669b1c..255695a65 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -32,9 +32,10 @@ The :mod:``wizard`` module provides generic wizard tools for OpenLP. import logging import os -from PyQt4 import QtCore, QtGui +from PyQt4 import QtGui -from openlp.core.lib import Registry, Settings, UiStrings, build_icon, translate +from openlp.core.common import Settings, UiStrings, translate +from openlp.core.lib import Registry, build_icon from openlp.core.lib.ui import add_welcome_page log = logging.getLogger(__name__) diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index d07153a2a..c75e8782a 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -43,8 +43,8 @@ import urllib.parse from PyQt4 import QtGui, QtCore -from openlp.core.common import AppLocation -from openlp.core.lib import Registry, Settings +from openlp.core.common import AppLocation, Settings +from openlp.core.lib import Registry if sys.platform != 'win32' and sys.platform != 'darwin': diff --git a/openlp/core/utils/actions.py b/openlp/core/utils/actions.py index 6feeda276..82619a6e7 100644 --- a/openlp/core/utils/actions.py +++ b/openlp/core/utils/actions.py @@ -34,7 +34,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Settings +from openlp.core.common import Settings log = logging.getLogger(__name__) diff --git a/openlp/core/utils/languagemanager.py b/openlp/core/utils/languagemanager.py index d6b3cd668..63f2e6f24 100644 --- a/openlp/core/utils/languagemanager.py +++ b/openlp/core/utils/languagemanager.py @@ -35,8 +35,8 @@ import sys from PyQt4 import QtCore, QtGui -from openlp.core.common import AppLocation -from openlp.core.lib import Settings, translate +from openlp.core.common import AppLocation, Settings +from openlp.core.lib import translate log = logging.getLogger(__name__) diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index b13230196..1dcdb13c7 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -31,7 +31,8 @@ import logging from PyQt4 import QtGui -from openlp.core.lib import Plugin, Settings, StringContent, build_icon, translate +from openlp.core.common import Settings +from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib.db import Manager from openlp.core.lib.ui import create_action, UiStrings from openlp.core.lib.theme import VerticalType diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index f57caaf7c..5a1512c4b 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -29,7 +29,8 @@ from PyQt4 import QtGui -from openlp.core.lib import SettingsTab, Settings, UiStrings, translate +from openlp.core.common import Settings, UiStrings, translate +from openlp.core.lib import SettingsTab from openlp.core.lib.ui import create_valign_selection_widgets diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 93bb5d565..f99d8138b 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -34,8 +34,7 @@ import os from PyQt4 import QtGui -from openlp.core.common import AppLocation -from openlp.core.lib import Settings, UiStrings, translate +from openlp.core.common import AppLocation, Settings, UiStrings, translate from openlp.core.lib.db import delete_database from openlp.core.lib.ui import critical_error_message_box from openlp.core.ui.wizard import OpenLPWizard, WizardStrings diff --git a/openlp/plugins/bibles/forms/bibleupgradeform.py b/openlp/plugins/bibles/forms/bibleupgradeform.py index ca74d6666..cc164363b 100644 --- a/openlp/plugins/bibles/forms/bibleupgradeform.py +++ b/openlp/plugins/bibles/forms/bibleupgradeform.py @@ -36,8 +36,8 @@ from tempfile import gettempdir from PyQt4 import QtCore, QtGui -from openlp.core.common import AppLocation, check_directory_exists -from openlp.core.lib import Registry, Settings, UiStrings, translate +from openlp.core.common import AppLocation, UiStrings, Settings, check_directory_exists, translate +from openlp.core.lib import Registry from openlp.core.lib.ui import critical_error_message_box from openlp.core.ui.wizard import OpenLPWizard, WizardStrings from openlp.core.utils import delete_file diff --git a/openlp/plugins/bibles/forms/booknamedialog.py b/openlp/plugins/bibles/forms/booknamedialog.py index 90a5bae40..605a4fb95 100644 --- a/openlp/plugins/bibles/forms/booknamedialog.py +++ b/openlp/plugins/bibles/forms/booknamedialog.py @@ -29,7 +29,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate +from openlp.core.common import translate from openlp.core.lib.ui import create_button_box class Ui_BookNameDialog(object): diff --git a/openlp/plugins/bibles/forms/booknameform.py b/openlp/plugins/bibles/forms/booknameform.py index 04a0e2fe7..1fb359c86 100644 --- a/openlp/plugins/bibles/forms/booknameform.py +++ b/openlp/plugins/bibles/forms/booknameform.py @@ -36,7 +36,7 @@ import re from PyQt4.QtGui import QDialog from PyQt4 import QtCore -from openlp.core.lib import translate +from openlp.core.common import translate from openlp.core.lib.ui import critical_error_message_box from openlp.plugins.bibles.forms.booknamedialog import Ui_BookNameDialog from openlp.plugins.bibles.lib import BibleStrings diff --git a/openlp/plugins/bibles/forms/editbibledialog.py b/openlp/plugins/bibles/forms/editbibledialog.py index 6e608d8df..6c832f5ee 100644 --- a/openlp/plugins/bibles/forms/editbibledialog.py +++ b/openlp/plugins/bibles/forms/editbibledialog.py @@ -29,7 +29,8 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, translate +from openlp.core.common import translate +from openlp.core.lib import build_icon 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 diff --git a/openlp/plugins/bibles/forms/editbibleform.py b/openlp/plugins/bibles/forms/editbibleform.py index e0163a8b8..5e2c94f79 100644 --- a/openlp/plugins/bibles/forms/editbibleform.py +++ b/openlp/plugins/bibles/forms/editbibleform.py @@ -33,7 +33,8 @@ import re from PyQt4 import QtGui -from openlp.core.lib import Registry, UiStrings, translate +from openlp.core.common import UiStrings, translate +from openlp.core.lib import Registry from openlp.core.lib.ui import critical_error_message_box from .editbibledialog import Ui_EditBibleDialog from openlp.plugins.bibles.lib import BibleStrings diff --git a/openlp/plugins/bibles/forms/languagedialog.py b/openlp/plugins/bibles/forms/languagedialog.py index 533848187..c69eb8828 100644 --- a/openlp/plugins/bibles/forms/languagedialog.py +++ b/openlp/plugins/bibles/forms/languagedialog.py @@ -29,7 +29,7 @@ from PyQt4 import QtGui -from openlp.core.lib import translate +from openlp.core.common import translate from openlp.core.lib.ui import create_button_box class Ui_LanguageDialog(object): diff --git a/openlp/plugins/bibles/forms/languageform.py b/openlp/plugins/bibles/forms/languageform.py index 88d9906cd..dcfb14462 100644 --- a/openlp/plugins/bibles/forms/languageform.py +++ b/openlp/plugins/bibles/forms/languageform.py @@ -34,7 +34,7 @@ import logging from PyQt4.QtGui import QDialog -from openlp.core.lib import translate +from openlp.core.common import translate from openlp.core.lib.ui import critical_error_message_box from openlp.plugins.bibles.forms.languagedialog import \ Ui_LanguageDialog diff --git a/openlp/plugins/bibles/lib/__init__.py b/openlp/plugins/bibles/lib/__init__.py index df816d436..38575a974 100644 --- a/openlp/plugins/bibles/lib/__init__.py +++ b/openlp/plugins/bibles/lib/__init__.py @@ -33,7 +33,8 @@ plugin. import logging import re -from openlp.core.lib import Settings, translate +from openlp.core.common import Settings +from openlp.core.lib import translate log = logging.getLogger(__name__) diff --git a/openlp/plugins/bibles/lib/biblestab.py b/openlp/plugins/bibles/lib/biblestab.py index dd95d9b33..807cb2195 100644 --- a/openlp/plugins/bibles/lib/biblestab.py +++ b/openlp/plugins/bibles/lib/biblestab.py @@ -31,7 +31,8 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Registry, SettingsTab, Settings, UiStrings, translate +from openlp.core.common import Settings, UiStrings, translate +from openlp.core.lib import Registry, 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 diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index a05d0c301..fc7c31d15 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -30,8 +30,8 @@ import logging import os -from openlp.core.common import AppLocation -from openlp.core.lib import Registry, Settings, translate +from openlp.core.common import AppLocation, Settings +from openlp.core.lib import Registry, translate from openlp.core.utils import delete_file from openlp.plugins.bibles.lib import parse_reference, get_reference_separator, LanguageSelection from openlp.plugins.bibles.lib.db import BibleDB, BibleMeta diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 4ccd37df1..437dfd65e 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -31,8 +31,9 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Registry, MediaManagerItem, ItemCapabilities, ServiceItemContext, Settings, UiStrings, \ - create_separated_list, translate +from openlp.core.common import Settings, UiStrings, translate +from openlp.core.lib import Registry, MediaManagerItem, ItemCapabilities, ServiceItemContext, \ + create_separated_list from openlp.core.lib.searchedit import SearchEdit 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, build_icon diff --git a/openlp/plugins/custom/forms/editcustomdialog.py b/openlp/plugins/custom/forms/editcustomdialog.py index 20adefa9a..106b3e339 100644 --- a/openlp/plugins/custom/forms/editcustomdialog.py +++ b/openlp/plugins/custom/forms/editcustomdialog.py @@ -29,7 +29,8 @@ from PyQt4 import QtGui -from openlp.core.lib import UiStrings, build_icon, translate +from openlp.core.common import UiStrings, translate +from openlp.core.lib import build_icon from openlp.core.lib.ui import create_button_box, create_button diff --git a/openlp/plugins/custom/forms/editcustomslidedialog.py b/openlp/plugins/custom/forms/editcustomslidedialog.py index 80b3c8cc9..bf000d308 100644 --- a/openlp/plugins/custom/forms/editcustomslidedialog.py +++ b/openlp/plugins/custom/forms/editcustomslidedialog.py @@ -29,7 +29,8 @@ from PyQt4 import QtGui -from openlp.core.lib import SpellTextEdit, UiStrings, translate +from openlp.core.common import UiStrings, translate +from openlp.core.lib import SpellTextEdit from openlp.core.lib.ui import create_button, create_button_box class Ui_CustomSlideEditDialog(object): diff --git a/openlp/plugins/custom/forms/editcustomslideform.py b/openlp/plugins/custom/forms/editcustomslideform.py index 65a8deb68..181f6c6af 100644 --- a/openlp/plugins/custom/forms/editcustomslideform.py +++ b/openlp/plugins/custom/forms/editcustomslideform.py @@ -30,7 +30,7 @@ import logging -from PyQt4 import QtCore, QtGui +from PyQt4 import QtGui from .editcustomslidedialog import Ui_CustomSlideEditDialog diff --git a/openlp/plugins/custom/lib/customtab.py b/openlp/plugins/custom/lib/customtab.py index f62c4547d..c66711f49 100644 --- a/openlp/plugins/custom/lib/customtab.py +++ b/openlp/plugins/custom/lib/customtab.py @@ -33,7 +33,8 @@ for the Custom Slides plugin, which is inserted into the configuration dialog. from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab, Settings, translate +from openlp.core.common import Settings, translate +from openlp.core.lib import SettingsTab class CustomTab(SettingsTab): diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index f5b518ce8..386045b40 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -32,8 +32,9 @@ import logging from PyQt4 import QtCore, QtGui from sqlalchemy.sql import or_, func, and_ -from openlp.core.lib import Registry, MediaManagerItem, ItemCapabilities, ServiceItemContext, Settings, PluginStatus,\ - UiStrings, check_item_selected, translate +from openlp.core.common import Settings, UiStrings, translate +from openlp.core.lib import Registry, MediaManagerItem, ItemCapabilities, ServiceItemContext, PluginStatus,\ + check_item_selected from openlp.plugins.custom.forms.editcustomform import EditCustomForm from openlp.plugins.custom.lib import CustomXMLParser, CustomXMLBuilder from openlp.plugins.custom.lib.db import CustomSlide diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index a6712d941..b82cfa184 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -31,10 +31,11 @@ from PyQt4 import QtGui import logging -from openlp.core.lib import Plugin, StringContent, Registry, ImageSource, Settings, build_icon, translate +from openlp.core.common import Settings +from openlp.core.lib import Plugin, StringContent, Registry, ImageSource, build_icon, translate from openlp.core.lib.db import Manager from openlp.plugins.images.lib import ImageMediaItem, ImageTab -from openlp.plugins.images.lib.db import init_schema, ImageFilenames +from openlp.plugins.images.lib.db import init_schema log = logging.getLogger(__name__) diff --git a/openlp/plugins/images/lib/imagetab.py b/openlp/plugins/images/lib/imagetab.py index b408c1361..20e810b7e 100644 --- a/openlp/plugins/images/lib/imagetab.py +++ b/openlp/plugins/images/lib/imagetab.py @@ -29,7 +29,8 @@ from PyQt4 import QtGui -from openlp.core.lib import Registry, SettingsTab, Settings, UiStrings, translate +from openlp.core.common import Settings, UiStrings, translate +from openlp.core.lib import SettingsTab class ImageTab(SettingsTab): diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index ce7d55e17..976a3d47e 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -32,9 +32,9 @@ import os from PyQt4 import QtCore, QtGui -from openlp.core.common import AppLocation, check_directory_exists -from openlp.core.lib import ItemCapabilities, MediaManagerItem, Registry, ServiceItemContext, Settings, \ - StringContent, TreeWidgetWithDnD, UiStrings, build_icon, check_item_selected, create_thumb, translate, \ +from openlp.core.common import AppLocation, Settings, UiStrings, check_directory_exists, translate +from openlp.core.lib import ItemCapabilities, MediaManagerItem, Registry, ServiceItemContext, \ + StringContent, TreeWidgetWithDnD, build_icon, check_item_selected, create_thumb, \ validate_thumb from openlp.core.lib.ui import create_widget_action, critical_error_message_box from openlp.core.utils import delete_file, get_locale_key, get_images_filter diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index dc6b1456f..3d2d5b26e 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -32,9 +32,9 @@ import os from PyQt4 import QtCore, QtGui -from openlp.core.common import AppLocation, check_directory_exists +from openlp.core.common import AppLocation, Settings, check_directory_exists, UiStrings, translate from openlp.core.lib import ItemCapabilities, MediaManagerItem,MediaType, Registry, ServiceItem, ServiceItemContext, \ - Settings, UiStrings, build_icon, check_item_selected, translate + build_icon, check_item_selected from openlp.core.lib.ui import critical_error_message_box, create_horizontal_adjusting_combo_box from openlp.core.ui import DisplayController, Display, DisplayControllerType from openlp.core.ui.media import get_media_players, set_media_players diff --git a/openlp/plugins/media/lib/mediatab.py b/openlp/plugins/media/lib/mediatab.py index 7798b2cf3..40b6a1ea8 100644 --- a/openlp/plugins/media/lib/mediatab.py +++ b/openlp/plugins/media/lib/mediatab.py @@ -29,7 +29,8 @@ from PyQt4 import QtGui -from openlp.core.lib import Settings, SettingsTab, UiStrings, translate +from openlp.core.common import Settings, UiStrings, translate +from openlp.core.lib import SettingsTab class MediaQ_check_box(QtGui.QCheckBox): diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 896ff95d1..cd432c54c 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -31,7 +31,7 @@ import logging from PyQt4 import QtCore -from openlp.core.lib import Plugin, Registry, StringContent, Settings, build_icon, translate +from openlp.core.lib import Plugin, Registry, StringContent, build_icon, translate from openlp.plugins.media.lib import MediaMediaItem, MediaTab diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 695baddc5..ce0325c7e 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -32,8 +32,9 @@ import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import MediaManagerItem, Registry, ItemCapabilities, ServiceItemContext, Settings, UiStrings, \ - build_icon, check_item_selected, create_thumb, translate, validate_thumb +from openlp.core.common import Settings, UiStrings, translate +from openlp.core.lib import MediaManagerItem, Registry, 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.core.utils import get_locale_key from openlp.plugins.presentations.lib import MessageListener diff --git a/openlp/plugins/presentations/lib/presentationcontroller.py b/openlp/plugins/presentations/lib/presentationcontroller.py index 08584038e..17911606c 100644 --- a/openlp/plugins/presentations/lib/presentationcontroller.py +++ b/openlp/plugins/presentations/lib/presentationcontroller.py @@ -33,8 +33,8 @@ import shutil from PyQt4 import QtCore -from openlp.core.common import AppLocation, check_directory_exists -from openlp.core.lib import Registry, Settings, create_thumb, validate_thumb +from openlp.core.common import AppLocation, Settings, check_directory_exists +from openlp.core.lib import Registry, create_thumb, validate_thumb log = logging.getLogger(__name__) diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index fed02ce75..50b066850 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -29,7 +29,8 @@ from PyQt4 import QtGui -from openlp.core.lib import Settings, SettingsTab, UiStrings, translate +from openlp.core.common import Settings, UiStrings, translate +from openlp.core.lib import SettingsTab class PresentationTab(SettingsTab): diff --git a/openlp/plugins/remotes/lib/httprouter.py b/openlp/plugins/remotes/lib/httprouter.py index 42b45abc6..ce13ed812 100644 --- a/openlp/plugins/remotes/lib/httprouter.py +++ b/openlp/plugins/remotes/lib/httprouter.py @@ -124,9 +124,8 @@ from urllib.parse import urlparse, parse_qs from mako.template import Template from PyQt4 import QtCore -from openlp.core.common import AppLocation -from openlp.core.lib import Registry, Settings, PluginStatus, StringContent, image_to_byte -from openlp.core.utils import translate +from openlp.core.common import AppLocation, Settings, translate +from openlp.core.lib import Registry, PluginStatus, StringContent, image_to_byte log = logging.getLogger(__name__) diff --git a/openlp/plugins/remotes/lib/httpserver.py b/openlp/plugins/remotes/lib/httpserver.py index a8453fb2b..0ac77115c 100644 --- a/openlp/plugins/remotes/lib/httpserver.py +++ b/openlp/plugins/remotes/lib/httpserver.py @@ -40,8 +40,7 @@ import logging from PyQt4 import QtCore -from openlp.core.common import AppLocation -from openlp.core.lib import Settings +from openlp.core.common import AppLocation, Settings from openlp.plugins.remotes.lib import HttpRouter diff --git a/openlp/plugins/remotes/lib/remotetab.py b/openlp/plugins/remotes/lib/remotetab.py index d7ae97342..3953d777f 100644 --- a/openlp/plugins/remotes/lib/remotetab.py +++ b/openlp/plugins/remotes/lib/remotetab.py @@ -31,8 +31,8 @@ import os.path from PyQt4 import QtCore, QtGui, QtNetwork -from openlp.core.common import AppLocation -from openlp.core.lib import Settings, SettingsTab, translate +from openlp.core.common import AppLocation, Settings, translate +from openlp.core.lib import SettingsTab ZERO_URL = '0.0.0.0' diff --git a/openlp/plugins/songs/forms/editsongdialog.py b/openlp/plugins/songs/forms/editsongdialog.py index 16e680587..e867aca37 100644 --- a/openlp/plugins/songs/forms/editsongdialog.py +++ b/openlp/plugins/songs/forms/editsongdialog.py @@ -29,7 +29,8 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import UiStrings, build_icon, translate +from openlp.core.common import UiStrings, translate +from openlp.core.lib import build_icon from openlp.core.lib.ui import create_button_box, create_button 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 83b4c8d04..ed4676929 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -38,8 +38,8 @@ import shutil from PyQt4 import QtCore, QtGui -from openlp.core.common import AppLocation, check_directory_exists -from openlp.core.lib import Registry, PluginStatus, MediaType, UiStrings, translate, create_separated_list +from openlp.core.common import AppLocation, UiStrings, check_directory_exists, translate +from openlp.core.lib import Registry, 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 from openlp.plugins.songs.lib import VerseType, clean_song from openlp.plugins.songs.lib.db import Book, Song, Author, Topic, MediaFile diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 26c07395c..f0b9262a7 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -34,7 +34,8 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Registry, UiStrings, create_separated_list, build_icon, translate +from openlp.core.common import UiStrings, translate +from openlp.core.lib import Registry, create_separated_list, build_icon from openlp.core.lib.ui import critical_error_message_box from openlp.core.ui.wizard import OpenLPWizard, WizardStrings from openlp.plugins.songs.lib.db import Song diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index f1f63ffb5..2105e5e35 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -35,7 +35,9 @@ import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import Registry, Settings, UiStrings, translate +from openlp.core.common import UiStrings, translate +from openlp.core.common import Settings +from openlp.core.lib import Registry from openlp.core.lib.ui import critical_error_message_box from openlp.core.ui.wizard import OpenLPWizard, WizardStrings from openlp.plugins.songs.lib.importer import SongFormat, SongFormatSelect diff --git a/openlp/plugins/songs/forms/songmaintenancedialog.py b/openlp/plugins/songs/forms/songmaintenancedialog.py index ea908fb0f..3e0363772 100644 --- a/openlp/plugins/songs/forms/songmaintenancedialog.py +++ b/openlp/plugins/songs/forms/songmaintenancedialog.py @@ -29,7 +29,8 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import UiStrings, build_icon +from openlp.core.common import UiStrings +from openlp.core.lib import build_icon from openlp.core.lib.ui import create_button_box from openlp.plugins.songs.lib.ui import SongStrings diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index 67d9ee3ad..142cca1e7 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -32,7 +32,8 @@ import os from PyQt4 import QtGui, QtCore from sqlalchemy.sql import and_ -from openlp.core.lib import Registry, UiStrings, translate +from openlp.core.common import UiStrings, translate +from openlp.core.lib 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 diff --git a/openlp/plugins/songs/lib/importer.py b/openlp/plugins/songs/lib/importer.py index 8e7a9f36e..acdfddae7 100644 --- a/openlp/plugins/songs/lib/importer.py +++ b/openlp/plugins/songs/lib/importer.py @@ -32,7 +32,7 @@ The :mod:`importer` modules provides the general song import functionality. import os import logging -from openlp.core.lib import translate, UiStrings +from openlp.core.common import translate, UiStrings from openlp.core.ui.wizard import WizardStrings from .opensongimport import OpenSongImport from .easyslidesimport import EasySlidesImport diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index a708948ae..b8b1b5dcd 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -35,9 +35,9 @@ import shutil from PyQt4 import QtCore, QtGui from sqlalchemy.sql import or_ -from openlp.core.common import AppLocation, check_directory_exists -from openlp.core.lib import Registry, MediaManagerItem, ItemCapabilities, PluginStatus, ServiceItemContext, Settings, \ - UiStrings, translate, check_item_selected, create_separated_list +from openlp.core.common import AppLocation, Settings, check_directory_exists, UiStrings, translate +from openlp.core.lib import Registry, MediaManagerItem, ItemCapabilities, PluginStatus, ServiceItemContext, \ + check_item_selected, create_separated_list from openlp.core.lib.ui import create_widget_action from openlp.plugins.songs.forms.editsongform import EditSongForm from openlp.plugins.songs.forms.songmaintenanceform import SongMaintenanceForm diff --git a/openlp/plugins/songs/lib/olpimport.py b/openlp/plugins/songs/lib/olpimport.py index e95f78232..19078c9ec 100644 --- a/openlp/plugins/songs/lib/olpimport.py +++ b/openlp/plugins/songs/lib/olpimport.py @@ -36,7 +36,7 @@ from sqlalchemy import create_engine, MetaData, Table from sqlalchemy.orm import class_mapper, mapper, relation, scoped_session, sessionmaker from sqlalchemy.orm.exc import UnmappedClassError -from openlp.core.lib import translate +from openlp.core.common import translate from openlp.core.lib.db import BaseModel from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib import clean_song diff --git a/openlp/plugins/songs/lib/oooimport.py b/openlp/plugins/songs/lib/oooimport.py index f74c022a7..bb7654d01 100644 --- a/openlp/plugins/songs/lib/oooimport.py +++ b/openlp/plugins/songs/lib/oooimport.py @@ -51,6 +51,7 @@ except ImportError: PAGE_AFTER = 5 PAGE_BOTH = 6 + class OooImport(SongImport): """ Import songs from Impress/Powerpoint docs using Impress diff --git a/openlp/plugins/songs/lib/openlyricsexport.py b/openlp/plugins/songs/lib/openlyricsexport.py index ef62a64f0..8f927dd8c 100644 --- a/openlp/plugins/songs/lib/openlyricsexport.py +++ b/openlp/plugins/songs/lib/openlyricsexport.py @@ -35,8 +35,8 @@ import os from lxml import etree -from openlp.core.common import check_directory_exists -from openlp.core.lib import Registry, translate +from openlp.core.common import check_directory_exists, translate +from openlp.core.lib import Registry from openlp.core.utils import clean_filename from openlp.plugins.songs.lib.xml import OpenLyrics diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 669f861e3..3e60c9994 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -33,13 +33,14 @@ import re from lxml import objectify from lxml.etree import Error, LxmlError -from openlp.core.lib import translate +from openlp.core.common import translate from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib.songimport import SongImport from openlp.plugins.songs.lib.ui import SongStrings log = logging.getLogger(__name__) + class OpenSongImport(SongImport): """ Import songs exported from OpenSong diff --git a/openlp/plugins/songs/lib/powersongimport.py b/openlp/plugins/songs/lib/powersongimport.py index 7ab802505..88cea0b72 100644 --- a/openlp/plugins/songs/lib/powersongimport.py +++ b/openlp/plugins/songs/lib/powersongimport.py @@ -34,7 +34,7 @@ import logging import fnmatch import os -from openlp.core.lib import translate +from openlp.core.common import translate from openlp.plugins.songs.lib.songimport import SongImport log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index 378f18272..ead897e0e 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -34,8 +34,8 @@ import os from PyQt4 import QtCore -from openlp.core.common import AppLocation, check_directory_exists -from openlp.core.lib import Registry, translate +from openlp.core.common import AppLocation, check_directory_exists, translate +from openlp.core.lib import Registry from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib import clean_song, VerseType from openlp.plugins.songs.lib.db import Song, Author, Topic, Book, MediaFile diff --git a/openlp/plugins/songs/lib/songproimport.py b/openlp/plugins/songs/lib/songproimport.py index 5673eaa34..a7384afd3 100644 --- a/openlp/plugins/songs/lib/songproimport.py +++ b/openlp/plugins/songs/lib/songproimport.py @@ -35,6 +35,7 @@ import re from openlp.plugins.songs.lib import strip_rtf from openlp.plugins.songs.lib.songimport import SongImport + class SongProImport(SongImport): """ The :class:`SongProImport` class provides the ability to import song files diff --git a/openlp/plugins/songs/lib/songshowplusimport.py b/openlp/plugins/songs/lib/songshowplusimport.py index 35cd44b8a..a82ae0c98 100644 --- a/openlp/plugins/songs/lib/songshowplusimport.py +++ b/openlp/plugins/songs/lib/songshowplusimport.py @@ -27,8 +27,8 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### """ -The :mod:`songshowplusimport` module provides the functionality for importing -SongShow Plus songs into the OpenLP database. +The :mod:`songshowplusimport` module provides the functionality for importing SongShow Plus songs into the OpenLP +database. """ import chardet import os @@ -56,6 +56,7 @@ CUSTOM_VERSE = 37 log = logging.getLogger(__name__) + class SongShowPlusImport(SongImport): """ The :class:`SongShowPlusImport` class provides the ability to import song files from SongShow Plus. diff --git a/openlp/plugins/songs/lib/songstab.py b/openlp/plugins/songs/lib/songstab.py index f2a36e0c8..c422f1231 100644 --- a/openlp/plugins/songs/lib/songstab.py +++ b/openlp/plugins/songs/lib/songstab.py @@ -29,7 +29,8 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import Settings, SettingsTab, translate +from openlp.core.common import Settings, translate +from openlp.core.lib import SettingsTab class SongsTab(SettingsTab): diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py index de864b470..ce876fe81 100644 --- a/openlp/plugins/songs/lib/ui.py +++ b/openlp/plugins/songs/lib/ui.py @@ -32,6 +32,7 @@ for the songs plugin. """ from openlp.core.lib import translate + class SongStrings(object): """ Provide standard strings for use throughout the songs plugin. diff --git a/openlp/plugins/songs/lib/worshipcenterproimport.py b/openlp/plugins/songs/lib/worshipcenterproimport.py index b1de90634..a58ace982 100644 --- a/openlp/plugins/songs/lib/worshipcenterproimport.py +++ b/openlp/plugins/songs/lib/worshipcenterproimport.py @@ -34,7 +34,7 @@ import logging import pyodbc -from openlp.core.lib import translate +from openlp.core.common import translate from openlp.plugins.songs.lib.songimport import SongImport log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/wowimport.py b/openlp/plugins/songs/lib/wowimport.py index 3f06b4df8..8e9023e2f 100644 --- a/openlp/plugins/songs/lib/wowimport.py +++ b/openlp/plugins/songs/lib/wowimport.py @@ -33,7 +33,7 @@ Worship songs into the OpenLP database. import os import logging -from openlp.core.lib import translate +from openlp.core.common import translate from openlp.plugins.songs.lib.songimport import SongImport BLOCK_TYPES = ('V', 'C', 'B') diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index e788948b6..de1d33a22 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -68,7 +68,8 @@ import re from lxml import etree, objectify -from openlp.core.lib import FormattingTags, translate +from openlp.core.common import translate +from openlp.core.lib import FormattingTags from openlp.plugins.songs.lib import VerseType, clean_song from openlp.plugins.songs.lib.db import Author, Book, Song, Topic from openlp.core.utils import get_application_version diff --git a/openlp/plugins/songs/lib/zionworximport.py b/openlp/plugins/songs/lib/zionworximport.py index 50839f832..315f99708 100644 --- a/openlp/plugins/songs/lib/zionworximport.py +++ b/openlp/plugins/songs/lib/zionworximport.py @@ -33,7 +33,7 @@ ZionWorx songs into the OpenLP database. import csv import logging -from openlp.core.lib import translate +from openlp.core.common import translate from openlp.plugins.songs.lib.songimport import SongImport log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 3418dd7e4..6e6f7ea77 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -38,7 +38,8 @@ import sqlite3 from PyQt4 import QtCore, QtGui -from openlp.core.lib import Plugin, StringContent, UiStrings, build_icon, translate +from openlp.core.common import UiStrings, translate +from openlp.core.lib import Plugin, StringContent, build_icon from openlp.core.lib.db import Manager from openlp.core.lib.ui import create_action from openlp.core.utils.actions import ActionList diff --git a/openlp/plugins/songusage/forms/songusagedeletedialog.py b/openlp/plugins/songusage/forms/songusagedeletedialog.py index a47afb9f4..4c7b57285 100644 --- a/openlp/plugins/songusage/forms/songusagedeletedialog.py +++ b/openlp/plugins/songusage/forms/songusagedeletedialog.py @@ -29,7 +29,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate +from openlp.core.common import translate from openlp.core.lib.ui import create_button_box diff --git a/openlp/plugins/songusage/forms/songusagedeleteform.py b/openlp/plugins/songusage/forms/songusagedeleteform.py index 4ae9756b3..babd9d178 100644 --- a/openlp/plugins/songusage/forms/songusagedeleteform.py +++ b/openlp/plugins/songusage/forms/songusagedeleteform.py @@ -27,9 +27,10 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -from PyQt4 import QtCore, QtGui +from PyQt4 import QtGui -from openlp.core.lib import Registry, translate +from openlp.core.common import translate +from openlp.core.lib import Registry from openlp.plugins.songusage.lib.db import SongUsageItem from .songusagedeletedialog import Ui_SongUsageDeleteDialog diff --git a/openlp/plugins/songusage/forms/songusagedetaildialog.py b/openlp/plugins/songusage/forms/songusagedetaildialog.py index efe84a7c8..278feebf8 100644 --- a/openlp/plugins/songusage/forms/songusagedetaildialog.py +++ b/openlp/plugins/songusage/forms/songusagedetaildialog.py @@ -29,7 +29,8 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, translate +from openlp.core.common import translate +from openlp.core.lib import build_icon from openlp.core.lib.ui import create_button_box diff --git a/openlp/plugins/songusage/forms/songusagedetailform.py b/openlp/plugins/songusage/forms/songusagedetailform.py index e5925da78..6ff73b068 100644 --- a/openlp/plugins/songusage/forms/songusagedetailform.py +++ b/openlp/plugins/songusage/forms/songusagedetailform.py @@ -33,8 +33,8 @@ import os from PyQt4 import QtGui from sqlalchemy.sql import and_ -from openlp.core.common import check_directory_exists -from openlp.core.lib import Registry, Settings, translate +from openlp.core.common import Settings, check_directory_exists, translate +from openlp.core.lib import Registry from openlp.plugins.songusage.lib.db import SongUsageItem from .songusagedetaildialog import Ui_SongUsageDetailDialog diff --git a/openlp/plugins/songusage/songusageplugin.py b/openlp/plugins/songusage/songusageplugin.py index bed0e5be3..077b81155 100644 --- a/openlp/plugins/songusage/songusageplugin.py +++ b/openlp/plugins/songusage/songusageplugin.py @@ -32,7 +32,8 @@ from datetime import datetime from PyQt4 import QtCore, QtGui -from openlp.core.lib import Plugin, Registry, Settings, StringContent, build_icon, translate +from openlp.core.common import Settings, translate +from openlp.core.lib import Plugin, Registry, StringContent, build_icon from openlp.core.lib.db import Manager from openlp.core.lib.ui import create_action from openlp.core.utils.actions import ActionList diff --git a/tests/functional/openlp_core_common/test_applocation.py b/tests/functional/openlp_core_common/test_applocation.py index 7ce891bd9..28db96e43 100644 --- a/tests/functional/openlp_core_common/test_applocation.py +++ b/tests/functional/openlp_core_common/test_applocation.py @@ -46,7 +46,7 @@ class TestAppLocation(TestCase): """ Test the AppLocation.get_data_path() method """ - with patch('openlp.core.lib.Settings') as mocked_class, \ + with patch('openlp.core.common.Settings') as mocked_class, \ patch('openlp.core.common.AppLocation.get_directory') as mocked_get_directory, \ patch('openlp.core.common.applocation.check_directory_exists') as mocked_check_directory_exists, \ patch('openlp.core.common.applocation.os') as mocked_os: @@ -59,6 +59,7 @@ class TestAppLocation(TestCase): # WHEN: we call AppLocation.get_data_path() data_path = AppLocation.get_data_path() + print(data_path) # THEN: check that all the correct methods were called, and the result is correct mocked_settings.contains.assert_called_with('advanced/data path') @@ -70,7 +71,7 @@ class TestAppLocation(TestCase): """ Test the AppLocation.get_data_path() method when a custom location is set in the settings """ - with patch('openlp.core.lib.Settings') as mocked_class,\ + with patch('openlp.core.common.Settings') as mocked_class,\ patch('openlp.core.common.applocation.os') as mocked_os: # GIVEN: A mocked out Settings class which returns a custom data location mocked_settings = mocked_class.return_value diff --git a/tests/functional/openlp_core_lib/test_settings.py b/tests/functional/openlp_core_common/test_settings.py similarity index 99% rename from tests/functional/openlp_core_lib/test_settings.py rename to tests/functional/openlp_core_common/test_settings.py index 25647a6e1..f51cb7379 100644 --- a/tests/functional/openlp_core_lib/test_settings.py +++ b/tests/functional/openlp_core_common/test_settings.py @@ -35,7 +35,7 @@ from tempfile import mkstemp from PyQt4 import QtGui -from openlp.core.lib import Settings +from openlp.core.common import Settings class TestSettings(TestCase): diff --git a/tests/functional/openlp_core_lib/test_uistrings.py b/tests/functional/openlp_core_common/test_uistrings.py similarity index 98% rename from tests/functional/openlp_core_lib/test_uistrings.py rename to tests/functional/openlp_core_common/test_uistrings.py index fbfe07c78..b7f5ecc23 100644 --- a/tests/functional/openlp_core_lib/test_uistrings.py +++ b/tests/functional/openlp_core_common/test_uistrings.py @@ -31,7 +31,7 @@ Package to test the openlp.core.lib.uistrings package. """ from unittest import TestCase -from openlp.core.lib import UiStrings +from openlp.core.common import UiStrings class TestUiStrings(TestCase): diff --git a/tests/functional/openlp_core_lib/test_formattingtags.py b/tests/functional/openlp_core_lib/test_formattingtags.py index a200318ff..53d7519c7 100644 --- a/tests/functional/openlp_core_lib/test_formattingtags.py +++ b/tests/functional/openlp_core_lib/test_formattingtags.py @@ -59,7 +59,7 @@ class TestFormattingTags(TestCase): Test the FormattingTags class' get_html_tags static method. """ with patch('openlp.core.lib.translate') as mocked_translate, \ - patch('openlp.core.lib.settings') as mocked_settings, \ + patch('openlp.core.common.settings') as mocked_settings, \ patch('openlp.core.lib.formattingtags.json') as mocked_json: # GIVEN: Our mocked modules and functions. mocked_translate.side_effect = lambda module, string_to_translate, comment: string_to_translate @@ -80,7 +80,7 @@ class TestFormattingTags(TestCase): FormattingTags class - test the get_html_tags(), add_html_tags() and remove_html_tag() methods. """ with patch('openlp.core.lib.translate') as mocked_translate, \ - patch('openlp.core.lib.settings') as mocked_settings, \ + patch('openlp.core.common.settings') as mocked_settings, \ patch('openlp.core.lib.formattingtags.json') as mocked_json: # GIVEN: Our mocked modules and functions. mocked_translate.side_effect = lambda module, string_to_translate: string_to_translate diff --git a/tests/functional/openlp_core_lib/test_lib.py b/tests/functional/openlp_core_lib/test_lib.py index 6ba7eddbb..361b8d2cb 100644 --- a/tests/functional/openlp_core_lib/test_lib.py +++ b/tests/functional/openlp_core_lib/test_lib.py @@ -36,8 +36,8 @@ from datetime import datetime, timedelta from PyQt4 import QtCore, QtGui -from openlp.core.common import check_directory_exists -from openlp.core.lib import str_to_bool, create_thumb, translate, get_text_file_string, \ +from openlp.core.common import check_directory_exists, translate +from openlp.core.lib import str_to_bool, create_thumb, get_text_file_string, \ build_icon, image_to_byte, check_item_selected, validate_thumb, create_separated_list, clean_tags, expand_tags from tests.functional import MagicMock, patch diff --git a/tests/functional/openlp_core_lib/test_pluginmanager.py b/tests/functional/openlp_core_lib/test_pluginmanager.py index eb6d80f8c..725efd29e 100644 --- a/tests/functional/openlp_core_lib/test_pluginmanager.py +++ b/tests/functional/openlp_core_lib/test_pluginmanager.py @@ -31,8 +31,9 @@ Package to test the openlp.core.lib.pluginmanager package. """ from unittest import TestCase +from openlp.core.common import Settings from openlp.core.lib.pluginmanager import PluginManager -from openlp.core.lib import Settings, Registry, PluginStatus +from openlp.core.lib import Registry, PluginStatus from tests.functional import MagicMock diff --git a/tests/functional/openlp_core_utils/test_actions.py b/tests/functional/openlp_core_utils/test_actions.py index 42a7c7079..6b4972b37 100644 --- a/tests/functional/openlp_core_utils/test_actions.py +++ b/tests/functional/openlp_core_utils/test_actions.py @@ -35,7 +35,7 @@ from unittest import TestCase from PyQt4 import QtGui, QtCore -from openlp.core.lib import Settings +from openlp.core.common import Settings from openlp.core.utils import ActionList diff --git a/tests/functional/openlp_plugins/remotes/test_remotetab.py b/tests/functional/openlp_plugins/remotes/test_remotetab.py index cd32479d4..067c5cff1 100644 --- a/tests/functional/openlp_plugins/remotes/test_remotetab.py +++ b/tests/functional/openlp_plugins/remotes/test_remotetab.py @@ -36,7 +36,7 @@ from tempfile import mkstemp from PyQt4 import QtGui -from openlp.core.lib import Settings +from openlp.core.common import Settings from openlp.plugins.remotes.lib.remotetab import RemoteTab from tests.functional import patch @@ -105,7 +105,7 @@ class TestRemoteTab(TestCase): Test the set_urls function with standard defaults """ # GIVEN: A mocked location - with patch('openlp.core.lib.Settings') as mocked_class, \ + with patch('openlp.core.common.Settings') as mocked_class, \ patch('openlp.core.utils.AppLocation.get_directory') as mocked_get_directory, \ patch('openlp.core.common.check_directory_exists') as mocked_check_directory_exists, \ patch('openlp.core.common.applocation.os') as mocked_os: @@ -133,7 +133,7 @@ class TestRemoteTab(TestCase): Test the set_urls function with certificate available """ # GIVEN: A mocked location - with patch('openlp.core.lib.Settings') as mocked_class, \ + with patch('openlp.core.common.Settings') as mocked_class, \ patch('openlp.core.utils.AppLocation.get_directory') as mocked_get_directory, \ patch('openlp.core.common.check_directory_exists') as mocked_check_directory_exists, \ patch('openlp.core.common.applocation.os') as mocked_os: diff --git a/tests/functional/openlp_plugins/remotes/test_router.py b/tests/functional/openlp_plugins/remotes/test_router.py index 9b1b1dbb3..a9ba16bf8 100644 --- a/tests/functional/openlp_plugins/remotes/test_router.py +++ b/tests/functional/openlp_plugins/remotes/test_router.py @@ -35,7 +35,7 @@ from tempfile import mkstemp from PyQt4 import QtGui -from openlp.core.lib import Settings +from openlp.core.common import Settings from openlp.plugins.remotes.lib.httpserver import HttpRouter from tests.functional import MagicMock diff --git a/tests/functional/openlp_plugins/songs/test_mediaitem.py b/tests/functional/openlp_plugins/songs/test_mediaitem.py index 39f3146de..45c62469c 100644 --- a/tests/functional/openlp_plugins/songs/test_mediaitem.py +++ b/tests/functional/openlp_plugins/songs/test_mediaitem.py @@ -7,7 +7,8 @@ from unittest import TestCase from PyQt4 import QtCore, QtGui -from openlp.core.lib import Registry, ServiceItem, Settings +from openlp.core.common import Settings +from openlp.core.lib import Registry, ServiceItem from openlp.plugins.songs.lib.mediaitem import SongMediaItem from tests.functional import patch, MagicMock diff --git a/tests/interfaces/openlp_core_lib/test_pluginmanager.py b/tests/interfaces/openlp_core_lib/test_pluginmanager.py index dcff55e19..184b04808 100644 --- a/tests/interfaces/openlp_core_lib/test_pluginmanager.py +++ b/tests/interfaces/openlp_core_lib/test_pluginmanager.py @@ -10,8 +10,9 @@ from unittest import TestCase from mock import MagicMock from PyQt4 import QtGui +from openlp.core.common import Settings from openlp.core.lib.pluginmanager import PluginManager -from openlp.core.lib import Registry, Settings +from openlp.core.lib import Registry class TestPluginManager(TestCase):