This commit is contained in:
Tim Bentley 2016-03-31 17:34:22 +01:00
parent 946d9ee3d5
commit ba6d66497c
13 changed files with 37 additions and 43 deletions

View File

@ -242,3 +242,4 @@ from .uistrings import UiStrings
from .settings import Settings from .settings import Settings
from .applocation import AppLocation from .applocation import AppLocation
from .historycombobox import HistoryComboBox from .historycombobox import HistoryComboBox
from .actions import ActionList

View File

@ -27,8 +27,8 @@ import logging
from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5 import QtCore, QtGui, QtWidgets
from openlp.core.common import Registry, UiStrings, translate, is_macosx from openlp.core.common import Registry, UiStrings, translate, is_macosx
from openlp.core.common.actions import ActionList
from openlp.core.lib import build_icon from openlp.core.lib import build_icon
from openlp.core.utils.actions import ActionList
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View File

@ -24,30 +24,29 @@ This is the main window, where all the action happens.
""" """
import logging import logging
import os import os
import sys
import shutil import shutil
import sys
import time
from datetime import datetime
from distutils import dir_util from distutils import dir_util
from distutils.errors import DistutilsFileError from distutils.errors import DistutilsFileError
from tempfile import gettempdir from tempfile import gettempdir
import time
from datetime import datetime
from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5 import QtCore, QtGui, QtWidgets
from openlp.core.common import Registry, RegistryProperties, AppLocation, Settings, check_directory_exists, translate, \ from openlp.core.common import Registry, RegistryProperties, AppLocation, Settings, check_directory_exists, translate, \
is_win, is_macosx is_win, is_macosx
from openlp.core.common.actions import ActionList, CategoryOrder
from openlp.core.lib import Renderer, OpenLPDockWidget, PluginManager, ImageManager, PluginStatus, ScreenList, \ from openlp.core.lib import Renderer, OpenLPDockWidget, PluginManager, ImageManager, PluginStatus, ScreenList, \
build_icon build_icon
from openlp.core.lib.ui import UiStrings, create_action from openlp.core.lib.ui import UiStrings, create_action
from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, ThemeManager, LiveController, PluginForm, \ from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, ThemeManager, LiveController, PluginForm, \
MediaDockManager, ShortcutListForm, FormattingTagForm, PreviewController MediaDockManager, ShortcutListForm, FormattingTagForm, PreviewController
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
from openlp.core.ui.firsttimeform import FirstTimeForm from openlp.core.ui.firsttimeform import FirstTimeForm
from openlp.core.ui.projector.manager import ProjectorManager from openlp.core.ui.media import MediaController
from openlp.core.ui.printserviceform import PrintServiceForm from openlp.core.ui.printserviceform import PrintServiceForm
from openlp.core.ui.projector.manager import ProjectorManager
from openlp.core.utils import LanguageManager, add_actions, get_application_version
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View File

@ -23,23 +23,22 @@
The service manager sets up, loads, saves and manages services. The service manager sets up, loads, saves and manages services.
""" """
import html import html
import json
import os import os
import shutil import shutil
import zipfile import zipfile
import json
from tempfile import mkstemp
from datetime import datetime, timedelta from datetime import datetime, timedelta
from tempfile import mkstemp
from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5 import QtCore, QtGui, QtWidgets
from openlp.core.common import Registry, RegistryProperties, AppLocation, Settings, ThemeLevel, OpenLPMixin, \ from openlp.core.common import Registry, RegistryProperties, AppLocation, Settings, ThemeLevel, OpenLPMixin, \
RegistryMixin, check_directory_exists, UiStrings, translate RegistryMixin, check_directory_exists, UiStrings, translate
from openlp.core.common.actions import ActionList, CategoryOrder
from openlp.core.lib import OpenLPToolbar, ServiceItem, ItemCapabilities, PluginStatus, build_icon from openlp.core.lib import OpenLPToolbar, ServiceItem, ItemCapabilities, PluginStatus, build_icon
from openlp.core.lib.ui import critical_error_message_box, create_widget_action, find_and_set_in_combo_box 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 import ServiceNoteForm, ServiceItemEditForm, StartTimeForm
from openlp.core.ui.printserviceform import PrintServiceForm
from openlp.core.utils import delete_file, split_filename, format_time from openlp.core.utils import delete_file, split_filename, format_time
from openlp.core.utils.actions import ActionList, CategoryOrder
class ServiceManagerList(QtWidgets.QTreeWidget): class ServiceManagerList(QtWidgets.QTreeWidget):

View File

@ -27,7 +27,7 @@ import re
from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5 import QtCore, QtGui, QtWidgets
from openlp.core.common import RegistryProperties, Settings, translate from openlp.core.common import RegistryProperties, Settings, translate
from openlp.core.utils.actions import ActionList from openlp.core.common.actions import ActionList
from .shortcutlistdialog import Ui_ShortcutListDialog from .shortcutlistdialog import Ui_ShortcutListDialog
REMOVE_AMPERSAND = re.compile(r'&{1}') REMOVE_AMPERSAND = re.compile(r'&{1}')

View File

@ -23,20 +23,20 @@
The :mod:`slidecontroller` module contains the most important part of OpenLP - the slide controller The :mod:`slidecontroller` module contains the most important part of OpenLP - the slide controller
""" """
import os
import copy import copy
import os
from collections import deque from collections import deque
from threading import Lock from threading import Lock
from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5 import QtCore, QtGui, QtWidgets
from openlp.core.common import Registry, RegistryProperties, Settings, SlideLimits, UiStrings, translate, \ from openlp.core.common import Registry, RegistryProperties, Settings, SlideLimits, UiStrings, translate, \
RegistryMixin, OpenLPMixin, is_win RegistryMixin, OpenLPMixin
from openlp.core.common.actions import ActionList, CategoryOrder
from openlp.core.lib import OpenLPToolbar, ItemCapabilities, ServiceItem, ImageSource, ServiceItemAction, \ from openlp.core.lib import OpenLPToolbar, ItemCapabilities, ServiceItem, ImageSource, ServiceItemAction, \
ScreenList, build_icon, build_html 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.lib.ui import create_action
from openlp.core.utils.actions import ActionList, CategoryOrder from openlp.core.ui import HideMode, MainDisplay, Display, DisplayControllerType
from openlp.core.ui.listpreviewwidget import ListPreviewWidget from openlp.core.ui.listpreviewwidget import ListPreviewWidget
# Threshold which has to be trespassed to toggle. # Threshold which has to be trespassed to toggle.

View File

@ -22,29 +22,28 @@
""" """
The :mod:`openlp.core.utils` module provides the utility libraries for OpenLP. The :mod:`openlp.core.utils` module provides the utility libraries for OpenLP.
""" """
from datetime import datetime
from distutils.version import LooseVersion
from http.client import HTTPException
import logging
import locale import locale
import logging
import os import os
import platform import platform
import re import re
import socket import socket
import time
from shutil import which
from subprocess import Popen, PIPE
import sys import sys
import urllib.request import time
import urllib.error import urllib.error
import urllib.parse import urllib.parse
import urllib.request
from datetime import datetime
from distutils.version import LooseVersion
from http.client import HTTPException
from random import randint from random import randint
from shutil import which
from subprocess import Popen, PIPE
from PyQt5 import QtGui, QtCore from PyQt5 import QtGui, QtCore
from openlp.core.common import Registry, AppLocation, Settings, is_win, is_macosx from openlp.core.common import Registry, AppLocation, Settings, is_win, is_macosx
if not is_win() and not is_macosx(): if not is_win() and not is_macosx():
try: try:
from xdg import BaseDirectory from xdg import BaseDirectory
@ -537,9 +536,8 @@ def get_natural_key(string):
from .languagemanager import LanguageManager from .languagemanager import LanguageManager
from .actions import ActionList
__all__ = ['ActionList', 'LanguageManager', 'get_application_version', 'check_latest_version', __all__ = ['LanguageManager', 'get_application_version', 'check_latest_version',
'add_actions', 'get_filesystem_encoding', 'get_web_page', 'get_uno_command', 'get_uno_instance', 'add_actions', 'get_filesystem_encoding', 'get_web_page', 'get_uno_command', 'get_uno_instance',
'delete_file', 'clean_filename', 'format_time', 'get_locale_key', 'get_natural_key'] 'delete_file', 'clean_filename', 'format_time', 'get_locale_key', 'get_natural_key']

View File

@ -24,17 +24,16 @@ import logging
from PyQt5 import QtGui from PyQt5 import QtGui
from openlp.core.common import Settings, translate from openlp.core.common import Settings, translate
from openlp.core.common.actions import ActionList
from openlp.core.lib import Plugin, StringContent, build_icon from openlp.core.lib import Plugin, StringContent, build_icon
from openlp.core.lib.db import Manager from openlp.core.lib.db import Manager
from openlp.core.lib.ui import create_action, UiStrings
from openlp.core.lib.theme import VerticalType from openlp.core.lib.theme import VerticalType
from openlp.core.lib.ui import create_action, UiStrings
from openlp.core.ui import AlertLocation from openlp.core.ui import AlertLocation
from openlp.core.utils.actions import ActionList from openlp.plugins.alerts.forms import AlertForm
from openlp.plugins.alerts.lib import AlertsManager, AlertsTab from openlp.plugins.alerts.lib import AlertsManager, AlertsTab
from openlp.plugins.alerts.lib.db import init_schema from openlp.plugins.alerts.lib.db import init_schema
from openlp.plugins.alerts.forms import AlertForm
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View File

@ -24,13 +24,13 @@ import logging
from PyQt5 import QtWidgets from PyQt5 import QtWidgets
from openlp.core.common.actions import ActionList
from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib import Plugin, StringContent, build_icon, translate
from openlp.core.lib.ui import UiStrings, create_action from openlp.core.lib.ui import UiStrings, create_action
from openlp.core.utils.actions import ActionList from openlp.plugins.bibles.forms import BibleUpgradeForm
from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem, LayoutStyle, DisplayStyle, \ from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem, LayoutStyle, DisplayStyle, \
LanguageSelection LanguageSelection
from openlp.plugins.bibles.lib.mediaitem import BibleSearch from openlp.plugins.bibles.lib.mediaitem import BibleSearch
from openlp.plugins.bibles.forms import BibleUpgradeForm
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View File

@ -26,27 +26,26 @@ for the Songs plugin.
import logging import logging
import os import os
from tempfile import gettempdir
import sqlite3 import sqlite3
from tempfile import gettempdir
from PyQt5 import QtCore, QtWidgets from PyQt5 import QtCore, QtWidgets
from openlp.core.common import UiStrings, Registry, translate from openlp.core.common import UiStrings, Registry, translate
from openlp.core.common.actions import ActionList
from openlp.core.lib import Plugin, StringContent, build_icon from openlp.core.lib import Plugin, StringContent, build_icon
from openlp.core.lib.db import Manager from openlp.core.lib.db import Manager
from openlp.core.lib.ui import create_action from openlp.core.lib.ui import create_action
from openlp.core.utils.actions import ActionList
from openlp.plugins.songs.forms.duplicatesongremovalform import DuplicateSongRemovalForm from openlp.plugins.songs.forms.duplicatesongremovalform import DuplicateSongRemovalForm
from openlp.plugins.songs.forms.songselectform import SongSelectForm from openlp.plugins.songs.forms.songselectform import SongSelectForm
from openlp.plugins.songs.lib import clean_song, upgrade from openlp.plugins.songs.lib import clean_song, upgrade
from openlp.plugins.songs.lib.db import init_schema, Song from openlp.plugins.songs.lib.db import init_schema, Song
from openlp.plugins.songs.lib.mediaitem import SongSearch
from openlp.plugins.songs.lib.importer import SongFormat from openlp.plugins.songs.lib.importer import SongFormat
from openlp.plugins.songs.lib.importers.openlp import OpenLPSongImport from openlp.plugins.songs.lib.importers.openlp import OpenLPSongImport
from openlp.plugins.songs.lib.mediaitem import SongMediaItem from openlp.plugins.songs.lib.mediaitem import SongMediaItem
from openlp.plugins.songs.lib.mediaitem import SongSearch
from openlp.plugins.songs.lib.songstab import SongsTab from openlp.plugins.songs.lib.songstab import SongsTab
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
__default_settings__ = { __default_settings__ = {
'songs/db type': 'sqlite', 'songs/db type': 'sqlite',

View File

@ -26,10 +26,10 @@ from datetime import datetime
from PyQt5 import QtCore, QtWidgets from PyQt5 import QtCore, QtWidgets
from openlp.core.common import Registry, Settings, translate from openlp.core.common import Registry, Settings, translate
from openlp.core.common.actions import ActionList
from openlp.core.lib import Plugin, StringContent, build_icon from openlp.core.lib import Plugin, StringContent, build_icon
from openlp.core.lib.db import Manager from openlp.core.lib.db import Manager
from openlp.core.lib.ui import create_action from openlp.core.lib.ui import create_action
from openlp.core.utils.actions import ActionList
from openlp.plugins.songusage.forms import SongUsageDetailForm, SongUsageDeleteForm from openlp.plugins.songusage.forms import SongUsageDetailForm, SongUsageDeleteForm
from openlp.plugins.songusage.lib import upgrade from openlp.plugins.songusage.lib import upgrade
from openlp.plugins.songusage.lib.db import init_schema, SongUsageItem from openlp.plugins.songusage.lib.db import init_schema, SongUsageItem

View File

@ -20,15 +20,14 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
############################################################################### ###############################################################################
""" """
Package to test the openlp.core.utils.actions package. Package to test the openlp.core.common.actions package.
""" """
from unittest import TestCase from unittest import TestCase
from PyQt5 import QtGui, QtCore, QtWidgets from PyQt5 import QtGui, QtCore, QtWidgets
from openlp.core.common import Settings from openlp.core.common import Settings
from openlp.core.utils import ActionList from openlp.core.common.actions import CategoryActionList, ActionList
from openlp.core.utils.actions import CategoryActionList
from tests.functional import MagicMock from tests.functional import MagicMock
from tests.helpers.testmixin import TestMixin from tests.helpers.testmixin import TestMixin