forked from openlp/openlp
Head + fix merge problems
This commit is contained in:
commit
fae34b1b4d
@ -237,7 +237,7 @@ def set_up_logging(log_path):
|
|||||||
logfile.setFormatter(logging.Formatter(u'%(asctime)s %(name)-55s %(levelname)-8s %(message)s'))
|
logfile.setFormatter(logging.Formatter(u'%(asctime)s %(name)-55s %(levelname)-8s %(message)s'))
|
||||||
log.addHandler(logfile)
|
log.addHandler(logfile)
|
||||||
if log.isEnabledFor(logging.DEBUG):
|
if log.isEnabledFor(logging.DEBUG):
|
||||||
print 'Logging to:', filename
|
print('Logging to: %s' % filename)
|
||||||
|
|
||||||
|
|
||||||
def main(args=None):
|
def main(args=None):
|
||||||
|
@ -61,8 +61,7 @@ def init_db(url, auto_flush=True, auto_commit=False):
|
|||||||
"""
|
"""
|
||||||
engine = create_engine(url, poolclass=NullPool)
|
engine = create_engine(url, poolclass=NullPool)
|
||||||
metadata = MetaData(bind=engine)
|
metadata = MetaData(bind=engine)
|
||||||
session = scoped_session(sessionmaker(autoflush=auto_flush,
|
session = scoped_session(sessionmaker(autoflush=auto_flush, autocommit=auto_commit, bind=engine))
|
||||||
autocommit=auto_commit, bind=engine))
|
|
||||||
return session, metadata
|
return session, metadata
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ import logging
|
|||||||
|
|
||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from openlp.core.lib import build_icon, ScreenList
|
from openlp.core.lib import ScreenList, build_icon
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ Provide HTML Tag management and Formatting Tag access class
|
|||||||
"""
|
"""
|
||||||
import cPickle
|
import cPickle
|
||||||
|
|
||||||
from openlp.core.lib import translate, Settings
|
from openlp.core.lib import Settings, translate
|
||||||
|
|
||||||
|
|
||||||
class FormattingTags(object):
|
class FormattingTags(object):
|
||||||
|
@ -39,7 +39,7 @@ import Queue
|
|||||||
|
|
||||||
from PyQt4 import QtCore
|
from PyQt4 import QtCore
|
||||||
|
|
||||||
from openlp.core.lib import resize_image, image_to_byte, Registry, ScreenList
|
from openlp.core.lib import Registry, ScreenList, resize_image, image_to_byte
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -31,8 +31,8 @@ import logging
|
|||||||
|
|
||||||
from PyQt4 import QtGui, QtCore, QtWebKit
|
from PyQt4 import QtGui, QtCore, QtWebKit
|
||||||
|
|
||||||
from openlp.core.lib import ServiceItem, expand_tags, build_lyrics_format_css, build_lyrics_outline_css, Receiver, \
|
from openlp.core.lib import FormattingTags, ImageSource, ItemCapabilities, Receiver, Registry, ScreenList, \
|
||||||
ItemCapabilities, FormattingTags, ImageSource, Registry, ScreenList
|
ServiceItem, expand_tags, build_lyrics_format_css, build_lyrics_outline_css
|
||||||
from openlp.core.lib.theme import ThemeLevel
|
from openlp.core.lib.theme import ThemeLevel
|
||||||
from openlp.core.ui import MainDisplay
|
from openlp.core.ui import MainDisplay
|
||||||
|
|
||||||
|
@ -139,8 +139,7 @@ class ScreenList(object):
|
|||||||
"""
|
"""
|
||||||
screen_list = []
|
screen_list = []
|
||||||
for screen in self.screen_list:
|
for screen in self.screen_list:
|
||||||
screen_name = u'%s %d' % (translate('OpenLP.ScreenList', 'Screen'),
|
screen_name = u'%s %d' % (translate('OpenLP.ScreenList', 'Screen'), screen[u'number'] + 1)
|
||||||
screen[u'number'] + 1)
|
|
||||||
if screen[u'primary']:
|
if screen[u'primary']:
|
||||||
screen_name = u'%s (%s)' % (screen_name, translate('OpenLP.ScreenList', 'primary'))
|
screen_name = u'%s (%s)' % (screen_name, translate('OpenLP.ScreenList', 'primary'))
|
||||||
screen_list.append(screen_name)
|
screen_list.append(screen_name)
|
||||||
@ -237,8 +236,7 @@ class ScreenList(object):
|
|||||||
y = window.y() + (window.height() / 2)
|
y = window.y() + (window.height() / 2)
|
||||||
for screen in self.screen_list:
|
for screen in self.screen_list:
|
||||||
size = screen[u'size']
|
size = screen[u'size']
|
||||||
if x >= size.x() and x <= (size.x() + size.width()) and \
|
if x >= size.x() and x <= (size.x() + size.width()) and y >= size.y() and y <= (size.y() + size.height()):
|
||||||
y >= size.y() and y <= (size.y() + size.height()):
|
|
||||||
return screen[u'number']
|
return screen[u'number']
|
||||||
|
|
||||||
def load_screen_settings(self):
|
def load_screen_settings(self):
|
||||||
|
@ -39,7 +39,7 @@ import uuid
|
|||||||
|
|
||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from openlp.core.lib import build_icon, clean_tags, expand_tags, translate, ImageSource, Settings, Registry
|
from openlp.core.lib import ImageSource, Settings, Registry, build_icon, clean_tags, expand_tags, translate
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -74,7 +74,8 @@ class Settings(QtCore.QSettings):
|
|||||||
|
|
||||||
The first entry is the *old key*; it will be removed.
|
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.
|
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
|
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::
|
pair describes how to convert the old setting's value::
|
||||||
@ -86,66 +87,67 @@ class Settings(QtCore.QSettings):
|
|||||||
So, if the type of the old value is bool, then there must be two rules.
|
So, if the type of the old value is bool, then there must be two rules.
|
||||||
"""
|
"""
|
||||||
__default_settings__ = {
|
__default_settings__ = {
|
||||||
u'advanced/x11 bypass wm': X11_BYPASS_DEFAULT,
|
u'advanced/add page break': False,
|
||||||
u'advanced/alternate rows': not sys.platform.startswith(u'win'),
|
u'advanced/alternate rows': not sys.platform.startswith(u'win'),
|
||||||
u'advanced/default service enabled': True,
|
|
||||||
u'advanced/enable exit confirmation': True,
|
|
||||||
u'advanced/save current plugin': False,
|
|
||||||
u'advanced/single click preview': False,
|
|
||||||
# 7 stands for now, 0 to 6 is Monday to Sunday.
|
|
||||||
u'advanced/default service day': 7,
|
|
||||||
u'advanced/max recent files': 20,
|
|
||||||
u'advanced/is portable': False,
|
|
||||||
u'advanced/hide mouse': True,
|
|
||||||
u'advanced/current media plugin': -1,
|
u'advanced/current media plugin': -1,
|
||||||
u'advanced/double click live': False,
|
|
||||||
u'advanced/data path': u'',
|
u'advanced/data path': u'',
|
||||||
u'advanced/default service hour': 11,
|
|
||||||
u'advanced/default color': u'#ffffff',
|
u'advanced/default color': u'#ffffff',
|
||||||
u'advanced/default image': u':/graphics/openlp-splash-screen.png',
|
u'advanced/default image': u':/graphics/openlp-splash-screen.png',
|
||||||
u'advanced/expand service item': False,
|
# 7 stands for now, 0 to 6 is Monday to Sunday.
|
||||||
u'advanced/recent file count': 4,
|
u'advanced/default service day': 7,
|
||||||
u'advanced/default service name': UiStrings().DefaultServiceName,
|
u'advanced/default service enabled': True,
|
||||||
|
u'advanced/default service hour': 11,
|
||||||
u'advanced/default service minute': 0,
|
u'advanced/default service minute': 0,
|
||||||
u'advanced/slide limits': SlideLimits.End,
|
u'advanced/default service name': UiStrings().DefaultServiceName,
|
||||||
u'advanced/print slide text': False,
|
u'advanced/display size': 0,
|
||||||
u'advanced/add page break': False,
|
u'advanced/double click live': False,
|
||||||
|
u'advanced/enable exit confirmation': True,
|
||||||
|
u'advanced/expand service item': False,
|
||||||
|
u'advanced/hide mouse': True,
|
||||||
|
u'advanced/is portable': False,
|
||||||
|
u'advanced/max recent files': 20,
|
||||||
u'advanced/print file meta data': False,
|
u'advanced/print file meta data': False,
|
||||||
u'advanced/print notes': False,
|
u'advanced/print notes': False,
|
||||||
u'advanced/display size': 0,
|
u'advanced/print slide text': False,
|
||||||
|
u'advanced/recent file count': 4,
|
||||||
|
u'advanced/save current plugin': False,
|
||||||
|
u'advanced/slide limits': SlideLimits.End,
|
||||||
|
u'advanced/single click preview': False,
|
||||||
|
u'advanced/x11 bypass wm': X11_BYPASS_DEFAULT,
|
||||||
u'crashreport/last directory': u'',
|
u'crashreport/last directory': u'',
|
||||||
u'displayTags/html_tags': u'',
|
u'displayTags/html_tags': u'',
|
||||||
|
u'general/audio repeat list': False,
|
||||||
|
u'general/auto open': False,
|
||||||
|
u'general/auto preview': False,
|
||||||
|
u'general/audio start paused': True,
|
||||||
|
u'general/auto unblank': False,
|
||||||
|
u'general/blank warning': False,
|
||||||
u'general/ccli number': u'',
|
u'general/ccli number': u'',
|
||||||
u'general/has run wizard': False,
|
u'general/has run wizard': False,
|
||||||
u'general/update check': True,
|
|
||||||
u'general/language': u'[en]',
|
u'general/language': u'[en]',
|
||||||
u'general/songselect password': u'',
|
|
||||||
u'general/recent files': [],
|
|
||||||
u'general/save prompt': False,
|
|
||||||
u'general/auto preview': False,
|
|
||||||
u'general/view mode': u'default',
|
|
||||||
u'general/auto open': False,
|
|
||||||
u'general/enable slide loop': True,
|
|
||||||
u'general/show splash': True,
|
|
||||||
u'general/screen blank': False,
|
|
||||||
# The other display settings (display position and dimensions) are defined in the ScreenList class due to a
|
|
||||||
# circular dependency.
|
|
||||||
u'general/override position': False,
|
|
||||||
u'general/loop delay': 5,
|
|
||||||
u'general/songselect username': u'',
|
|
||||||
u'general/audio repeat list': False,
|
|
||||||
u'general/auto unblank': False,
|
|
||||||
u'general/display on monitor': True,
|
|
||||||
u'general/audio start paused': True,
|
|
||||||
# This defaults to yesterday in order to force the update check to run when you've never run it before.
|
# This defaults to yesterday in order to force the update check to run when you've never run it before.
|
||||||
u'general/last version test': datetime.datetime.now().date() - datetime.timedelta(days=1),
|
u'general/last version test': datetime.datetime.now().date() - datetime.timedelta(days=1),
|
||||||
u'general/blank warning': False,
|
u'general/loop delay': 5,
|
||||||
|
u'general/recent files': [],
|
||||||
|
u'general/save prompt': False,
|
||||||
|
u'general/screen blank': False,
|
||||||
|
u'general/show splash': True,
|
||||||
|
u'general/songselect password': u'',
|
||||||
|
u'general/songselect username': u'',
|
||||||
|
u'general/update check': True,
|
||||||
|
u'general/view mode': u'default',
|
||||||
|
# The other display settings (display position and dimensions) are defined in the ScreenList class due to a
|
||||||
|
# circular dependency.
|
||||||
|
u'general/display on monitor': True,
|
||||||
|
u'general/override position': False,
|
||||||
|
u'media/players': u'webkit',
|
||||||
|
u'media/override player': QtCore.Qt.Unchecked,
|
||||||
u'players/background color': u'#000000',
|
u'players/background color': u'#000000',
|
||||||
u'servicemanager/service theme': u'',
|
|
||||||
u'servicemanager/last file': u'',
|
u'servicemanager/last file': u'',
|
||||||
|
u'servicemanager/service theme': u'',
|
||||||
|
u'SettingsImport/file_date_created': datetime.datetime.now().strftime("%Y-%m-%d %H:%M"),
|
||||||
u'SettingsImport/Make_Changes': u'At_Own_RISK',
|
u'SettingsImport/Make_Changes': u'At_Own_RISK',
|
||||||
u'SettingsImport/type': u'OpenLP_settings_export',
|
u'SettingsImport/type': u'OpenLP_settings_export',
|
||||||
u'SettingsImport/file_date_created': datetime.datetime.now().strftime("%Y-%m-%d %H:%M"),
|
|
||||||
u'SettingsImport/version': u'',
|
u'SettingsImport/version': u'',
|
||||||
u'shortcuts/aboutItem': [QtGui.QKeySequence(u'Ctrl+F1')],
|
u'shortcuts/aboutItem': [QtGui.QKeySequence(u'Ctrl+F1')],
|
||||||
u'shortcuts/audioPauseItem': [],
|
u'shortcuts/audioPauseItem': [],
|
||||||
@ -213,39 +215,38 @@ class Settings(QtCore.QSettings):
|
|||||||
u'shortcuts/viewLivePanel': [QtGui.QKeySequence(u'F12')],
|
u'shortcuts/viewLivePanel': [QtGui.QKeySequence(u'F12')],
|
||||||
u'shortcuts/viewServiceManagerItem': [QtGui.QKeySequence(u'F9')],
|
u'shortcuts/viewServiceManagerItem': [QtGui.QKeySequence(u'F9')],
|
||||||
u'shortcuts/webSiteItem': [],
|
u'shortcuts/webSiteItem': [],
|
||||||
u'themes/theme level': ThemeLevel.Song,
|
|
||||||
u'themes/global theme': u'',
|
u'themes/global theme': u'',
|
||||||
u'themes/last directory': u'',
|
u'themes/last directory': u'',
|
||||||
u'themes/last directory export': u'',
|
u'themes/last directory export': u'',
|
||||||
u'themes/last directory import': u'',
|
u'themes/last directory import': u'',
|
||||||
u'user interface/main window position': QtCore.QPoint(0, 0),
|
u'themes/theme level': ThemeLevel.Song,
|
||||||
u'user interface/preview panel': True,
|
|
||||||
u'user interface/live panel': True,
|
u'user interface/live panel': True,
|
||||||
u'user interface/main window geometry': QtCore.QByteArray(),
|
|
||||||
u'user interface/preview splitter geometry': QtCore.QByteArray(),
|
|
||||||
u'user interface/lock panel': False,
|
|
||||||
u'user interface/mainwindow splitter geometry': QtCore.QByteArray(),
|
|
||||||
u'user interface/live splitter geometry': QtCore.QByteArray(),
|
u'user interface/live splitter geometry': QtCore.QByteArray(),
|
||||||
|
u'user interface/lock panel': False,
|
||||||
|
u'user interface/main window geometry': QtCore.QByteArray(),
|
||||||
|
u'user interface/main window position': QtCore.QPoint(0, 0),
|
||||||
|
u'user interface/main window splitter geometry': QtCore.QByteArray(),
|
||||||
u'user interface/main window state': QtCore.QByteArray(),
|
u'user interface/main window state': QtCore.QByteArray(),
|
||||||
u'media/players': u'webkit',
|
u'user interface/preview panel': True,
|
||||||
u'media/override player': QtCore.Qt.Unchecked,
|
u'user interface/preview splitter geometry': QtCore.QByteArray()
|
||||||
# Old settings (not used anymore). Have to be here, so that old setting.config backups can be imported.
|
|
||||||
u'advanced/stylesheet fix': u'',
|
|
||||||
u'servicemanager/last directory': u''
|
|
||||||
}
|
}
|
||||||
__file_path__ = u''
|
__file_path__ = u''
|
||||||
__obsolete_settings__ = [
|
__obsolete_settings__ = [
|
||||||
|
# Changed during 1.9.x development.
|
||||||
(u'bibles/bookname language', u'bibles/book name language', []),
|
(u'bibles/bookname language', u'bibles/book name language', []),
|
||||||
(u'general/enable slide loop', u'advanced/slide limits', [(SlideLimits.Wrap, True), (SlideLimits.End, False)]),
|
(u'general/enable slide loop', u'advanced/slide limits', [(SlideLimits.Wrap, True), (SlideLimits.End, False)]),
|
||||||
|
(u'songs/ccli number', u'general/ccli number', []),
|
||||||
|
# Changed during 2.1.x development.
|
||||||
|
(u'advanced/stylesheet fix', u'', []),
|
||||||
|
(u'bibles/last directory 1', u'bibles/last directory import', []),
|
||||||
|
(u'media/background color', u'players/background color', []),
|
||||||
(u'themes/last directory', u'themes/last directory import', []),
|
(u'themes/last directory', u'themes/last directory import', []),
|
||||||
(u'themes/last directory 1', u'themes/last directory export', []),
|
(u'themes/last directory 1', u'themes/last directory export', []),
|
||||||
(u'servicemanager/last directory', u'', []),
|
(u'servicemanager/last directory', u'', []),
|
||||||
(u'songs/last directory 1', u'songs/last directory import', []),
|
(u'songs/last directory 1', u'songs/last directory import', []),
|
||||||
(u'bibles/last directory 1', u'bibles/last directory import', []),
|
|
||||||
(u'songusage/last directory 1', u'songusage/last directory export', []),
|
(u'songusage/last directory 1', u'songusage/last directory export', []),
|
||||||
(u'shortcuts/makeLive', u'shortcuts/make_live', []),
|
(u'user interface/mainwindow splitter geometry', u'user interface/main window splitter geometry', []),
|
||||||
(u'advanced/stylesheet fix', u'', []),
|
(u'shortcuts/makeLive', u'shortcuts/make_live', [])
|
||||||
(u'media/background color', u'players/background color', [])
|
|
||||||
]
|
]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -296,6 +297,11 @@ class Settings(QtCore.QSettings):
|
|||||||
if new_key:
|
if new_key:
|
||||||
# Get the value of the old_key.
|
# Get the value of the old_key.
|
||||||
old_value = super(Settings, self).value(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.
|
# Iterate over our rules and check what the old_value should be "converted" to.
|
||||||
for new, old in rules:
|
for new, old in rules:
|
||||||
# If the value matches with the condition (rule), then use the provided value. This is used to
|
# If the value matches with the condition (rule), then use the provided value. This is used to
|
||||||
@ -311,8 +317,6 @@ class Settings(QtCore.QSettings):
|
|||||||
Returns the value for the given ``key``. The returned ``value`` is of the same type as the default value in the
|
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.
|
*Settings.__default_settings__* dict.
|
||||||
|
|
||||||
**Note**, this method only converts a few types and might need to be extended if a certain type is missing!
|
|
||||||
|
|
||||||
``key``
|
``key``
|
||||||
The key to return the value from.
|
The key to return the value from.
|
||||||
"""
|
"""
|
||||||
@ -322,6 +326,21 @@ class Settings(QtCore.QSettings):
|
|||||||
else:
|
else:
|
||||||
default_value = Settings.__default_settings__[key]
|
default_value = Settings.__default_settings__[key]
|
||||||
setting = super(Settings, self).value(key, default_value)
|
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
|
# 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.
|
# PyQt4.QtCore.QPyNullVariant. This type has to be converted to proper 'None' Python type.
|
||||||
if isinstance(setting, QtCore.QPyNullVariant) and setting.isNull():
|
if isinstance(setting, QtCore.QPyNullVariant) and setting.isNull():
|
||||||
|
@ -33,7 +33,7 @@ import logging
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Registry, build_icon, translate, Receiver, UiStrings
|
from openlp.core.lib import Registry, UiStrings, build_icon, translate
|
||||||
from openlp.core.utils.actions import ActionList
|
from openlp.core.utils.actions import ActionList
|
||||||
|
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ def add_welcome_page(parent, image):
|
|||||||
parent.addPage(parent.welcomePage)
|
parent.addPage(parent.welcomePage)
|
||||||
|
|
||||||
|
|
||||||
def create_button_box(dialog, name, standard_buttons, custom_buttons=[]):
|
def create_button_box(dialog, name, standard_buttons, custom_buttons=None):
|
||||||
"""
|
"""
|
||||||
Creates a QDialogButtonBox with the given buttons. The ``accepted()`` and
|
Creates a QDialogButtonBox with the given buttons. The ``accepted()`` and
|
||||||
``rejected()`` signals of the button box are connected with the dialogs
|
``rejected()`` signals of the button box are connected with the dialogs
|
||||||
@ -88,6 +88,8 @@ def create_button_box(dialog, name, standard_buttons, custom_buttons=[]):
|
|||||||
QtGui.QAbstractButton it is added with QDialogButtonBox.ActionRole.
|
QtGui.QAbstractButton it is added with QDialogButtonBox.ActionRole.
|
||||||
Otherwhise the item has to be a tuple of a button and a ButtonRole.
|
Otherwhise the item has to be a tuple of a button and a ButtonRole.
|
||||||
"""
|
"""
|
||||||
|
if custom_buttons is None:
|
||||||
|
custom_buttons = []
|
||||||
buttons = QtGui.QDialogButtonBox.NoButton
|
buttons = QtGui.QDialogButtonBox.NoButton
|
||||||
if u'ok' in standard_buttons:
|
if u'ok' in standard_buttons:
|
||||||
buttons |= QtGui.QDialogButtonBox.Ok
|
buttons |= QtGui.QDialogButtonBox.Ok
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from openlp.core.lib import build_icon, translate, UiStrings
|
from openlp.core.lib import UiStrings, build_icon, translate
|
||||||
from openlp.core.lib.ui import create_button, create_button_box
|
from openlp.core.lib.ui import create_button, create_button_box
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ import sys
|
|||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Registry, SettingsTab, Receiver, Settings, UiStrings, translate, build_icon
|
from openlp.core.lib import Registry, SettingsTab, Receiver, Settings, UiStrings, translate, build_icon
|
||||||
from openlp.core.utils import get_images_filter, AppLocation, format_time
|
from openlp.core.utils import AppLocation, format_time, get_images_filter
|
||||||
from openlp.core.lib import SlideLimits
|
from openlp.core.lib import SlideLimits
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
@ -88,7 +88,7 @@ except AttributeError:
|
|||||||
WEBKIT_VERSION = u'-'
|
WEBKIT_VERSION = u'-'
|
||||||
|
|
||||||
|
|
||||||
from openlp.core.lib import translate, UiStrings, Settings
|
from openlp.core.lib import UiStrings, Settings, translate
|
||||||
from openlp.core.utils import get_application_version
|
from openlp.core.utils import get_application_version
|
||||||
|
|
||||||
from exceptiondialog import Ui_ExceptionDialog
|
from exceptiondialog import Ui_ExceptionDialog
|
||||||
@ -141,9 +141,9 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
|
|||||||
u'pyUNO bridge: %s\n' % UNO_VERSION
|
u'pyUNO bridge: %s\n' % UNO_VERSION
|
||||||
if platform.system() == u'Linux':
|
if platform.system() == u'Linux':
|
||||||
if os.environ.get(u'KDE_FULL_SESSION') == u'true':
|
if os.environ.get(u'KDE_FULL_SESSION') == u'true':
|
||||||
system = system + u'Desktop: KDE SC\n'
|
system += u'Desktop: KDE SC\n'
|
||||||
elif os.environ.get(u'GNOME_DESKTOP_SESSION_ID'):
|
elif os.environ.get(u'GNOME_DESKTOP_SESSION_ID'):
|
||||||
system = system + u'Desktop: GNOME\n'
|
system += u'Desktop: GNOME\n'
|
||||||
return (openlp_version, description, traceback, system, libraries)
|
return (openlp_version, description, traceback, system, libraries)
|
||||||
|
|
||||||
def onSaveReportButtonClicked(self):
|
def onSaveReportButtonClicked(self):
|
||||||
|
@ -41,8 +41,8 @@ from ConfigParser import SafeConfigParser
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate, PluginStatus, Receiver, build_icon, check_directory_exists, Settings, Registry
|
from openlp.core.lib import PluginStatus, Receiver, Settings, Registry, build_icon, check_directory_exists, translate
|
||||||
from openlp.core.utils import get_web_page, AppLocation, get_filesystem_encoding
|
from openlp.core.utils import AppLocation, get_web_page, get_filesystem_encoding
|
||||||
from firsttimewizard import Ui_FirstTimeWizard, FirstTimePage
|
from firsttimewizard import Ui_FirstTimeWizard, FirstTimePage
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@ -368,7 +368,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
|
|||||||
self.max_progress += size
|
self.max_progress += size
|
||||||
if self.max_progress:
|
if self.max_progress:
|
||||||
# Add on 2 for plugins status setting plus a "finished" point.
|
# Add on 2 for plugins status setting plus a "finished" point.
|
||||||
self.max_progress = self.max_progress + 2
|
self.max_progress += 2
|
||||||
self.progressBar.setValue(0)
|
self.progressBar.setValue(0)
|
||||||
self.progressBar.setMinimum(0)
|
self.progressBar.setMinimum(0)
|
||||||
self.progressBar.setMaximum(self.max_progress)
|
self.progressBar.setMaximum(self.max_progress)
|
||||||
|
@ -31,7 +31,7 @@ The UI widgets for the formatting tags window.
|
|||||||
"""
|
"""
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate, UiStrings
|
from openlp.core.lib import UiStrings, translate
|
||||||
from openlp.core.lib.ui import create_button_box
|
from openlp.core.lib.ui import create_button_box
|
||||||
|
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ cannot be changed.
|
|||||||
"""
|
"""
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate, FormattingTags
|
from openlp.core.lib import FormattingTags, translate
|
||||||
from openlp.core.lib.ui import critical_error_message_box
|
from openlp.core.lib.ui import critical_error_message_box
|
||||||
from openlp.core.ui.formattingtagdialog import Ui_FormattingTagDialog
|
from openlp.core.ui.formattingtagdialog import Ui_FormattingTagDialog
|
||||||
|
|
||||||
|
@ -42,8 +42,8 @@ import sys
|
|||||||
from PyQt4 import QtCore, QtGui, QtWebKit, QtOpenGL
|
from PyQt4 import QtCore, QtGui, QtWebKit, QtOpenGL
|
||||||
from PyQt4.phonon import Phonon
|
from PyQt4.phonon import Phonon
|
||||||
|
|
||||||
from openlp.core.lib import Receiver, build_html, ServiceItem, image_to_byte, translate, expand_tags,\
|
from openlp.core.lib import Receiver, ServiceItem, Settings, ImageSource, Registry, build_html, expand_tags, \
|
||||||
Settings, ImageSource, Registry
|
image_to_byte, translate
|
||||||
from openlp.core.lib.theme import BackgroundType
|
from openlp.core.lib.theme import BackgroundType
|
||||||
|
|
||||||
from openlp.core.lib import ScreenList
|
from openlp.core.lib import ScreenList
|
||||||
|
@ -41,13 +41,13 @@ from datetime import datetime
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Renderer, build_icon, OpenLPDockWidget, PluginManager, Receiver, translate, ImageManager, \
|
from openlp.core.lib import Renderer, OpenLPDockWidget, PluginManager, Receiver, ImageManager, PluginStatus, Registry, \
|
||||||
PluginStatus, Registry, Settings, ScreenList
|
Settings, ScreenList, build_icon, check_directory_exists, translate
|
||||||
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, SlideController, PluginForm, \
|
from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, ThemeManager, SlideController, PluginForm, \
|
||||||
MediaDockManager, ShortcutListForm, FormattingTagForm
|
MediaDockManager, ShortcutListForm, FormattingTagForm
|
||||||
from openlp.core.ui.media import MediaController
|
from openlp.core.ui.media import MediaController
|
||||||
from openlp.core.utils import AppLocation, add_actions, LanguageManager, get_application_version, \
|
from openlp.core.utils import AppLocation, LanguageManager, add_actions, get_application_version, \
|
||||||
get_filesystem_encoding
|
get_filesystem_encoding
|
||||||
from openlp.core.utils.actions import ActionList, CategoryOrder
|
from openlp.core.utils.actions import ActionList, CategoryOrder
|
||||||
from openlp.core.ui.firsttimeform import FirstTimeForm
|
from openlp.core.ui.firsttimeform import FirstTimeForm
|
||||||
@ -854,8 +854,15 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
# Add plugin sections.
|
# Add plugin sections.
|
||||||
for plugin in self.plugin_manager.plugins:
|
for plugin in self.plugin_manager.plugins:
|
||||||
setting_sections.extend([plugin.name])
|
setting_sections.extend([plugin.name])
|
||||||
|
# Copy the settings file to the tmp dir, because we do not want to change the original one.
|
||||||
|
temp_directory = os.path.join(unicode(gettempdir()), u'openlp')
|
||||||
|
check_directory_exists(temp_directory)
|
||||||
|
temp_config = os.path.join(temp_directory, os.path.basename(import_file_name))
|
||||||
|
shutil.copyfile(import_file_name, temp_config)
|
||||||
settings = Settings()
|
settings = Settings()
|
||||||
import_settings = Settings(import_file_name, Settings.IniFormat)
|
import_settings = Settings(temp_config, Settings.IniFormat)
|
||||||
|
# Remove/rename old settings to prepare the import.
|
||||||
|
import_settings.remove_obsolete_settings()
|
||||||
# Lets do a basic sanity check. If it contains this string we can
|
# Lets do a basic sanity check. If it contains this string we can
|
||||||
# assume it was created by OpenLP and so we'll load what we can
|
# assume it was created by OpenLP and so we'll load what we can
|
||||||
# from it, and just silently ignore anything we don't recognise
|
# from it, and just silently ignore anything we don't recognise
|
||||||
@ -915,7 +922,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
return
|
return
|
||||||
# Make sure it's a .conf file.
|
# Make sure it's a .conf file.
|
||||||
if not export_file_name.endswith(u'conf'):
|
if not export_file_name.endswith(u'conf'):
|
||||||
export_file_name = export_file_name + u'.conf'
|
export_file_name += u'.conf'
|
||||||
temp_file = os.path.join(unicode(gettempdir(),
|
temp_file = os.path.join(unicode(gettempdir(),
|
||||||
get_filesystem_encoding()), u'openlp', u'exportConf.tmp')
|
get_filesystem_encoding()), u'openlp', u'exportConf.tmp')
|
||||||
self.saveSettings()
|
self.saveSettings()
|
||||||
@ -1232,7 +1239,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
self.restoreState(settings.value(u'main window state'))
|
self.restoreState(settings.value(u'main window state'))
|
||||||
self.liveController.splitter.restoreState(settings.value(u'live splitter geometry'))
|
self.liveController.splitter.restoreState(settings.value(u'live splitter geometry'))
|
||||||
self.previewController.splitter.restoreState(settings.value(u'preview splitter geometry'))
|
self.previewController.splitter.restoreState(settings.value(u'preview splitter geometry'))
|
||||||
self.controlSplitter.restoreState(settings.value(u'mainwindow splitter geometry'))
|
self.controlSplitter.restoreState(settings.value(u'main window splitter geometry'))
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
|
|
||||||
def saveSettings(self):
|
def saveSettings(self):
|
||||||
@ -1253,7 +1260,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
settings.setValue(u'main window geometry', self.saveGeometry())
|
settings.setValue(u'main window geometry', self.saveGeometry())
|
||||||
settings.setValue(u'live splitter geometry', self.liveController.splitter.saveState())
|
settings.setValue(u'live splitter geometry', self.liveController.splitter.saveState())
|
||||||
settings.setValue(u'preview splitter geometry', self.previewController.splitter.saveState())
|
settings.setValue(u'preview splitter geometry', self.previewController.splitter.saveState())
|
||||||
settings.setValue(u'mainwindow splitter geometry', self.controlSplitter.saveState())
|
settings.setValue(u'main window splitter geometry', self.controlSplitter.saveState())
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
|
|
||||||
def updateRecentFilesMenu(self):
|
def updateRecentFilesMenu(self):
|
||||||
|
@ -35,7 +35,7 @@ import os
|
|||||||
import datetime
|
import datetime
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import OpenLPToolbar, Receiver, translate, Settings, Registry, UiStrings
|
from openlp.core.lib import OpenLPToolbar, Receiver, Settings, Registry, UiStrings, translate
|
||||||
from openlp.core.lib.ui import critical_error_message_box
|
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 import MediaState, MediaInfo, MediaType, get_media_players, set_media_players
|
||||||
from openlp.core.ui.media.mediaplayer import MediaPlayer
|
from openlp.core.ui.media.mediaplayer import MediaPlayer
|
||||||
|
@ -36,7 +36,7 @@ from datetime import datetime
|
|||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
from PyQt4.phonon import Phonon
|
from PyQt4.phonon import Phonon
|
||||||
|
|
||||||
from openlp.core.lib import translate, Settings
|
from openlp.core.lib import Settings, translate
|
||||||
|
|
||||||
from openlp.core.ui.media import MediaState
|
from openlp.core.ui.media import MediaState
|
||||||
from openlp.core.ui.media.mediaplayer import MediaPlayer
|
from openlp.core.ui.media.mediaplayer import MediaPlayer
|
||||||
|
@ -31,7 +31,7 @@ The :mod:`~openlp.core.ui.media.playertab` module holds the configuration tab fo
|
|||||||
"""
|
"""
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Registry, SettingsTab, translate, Receiver, Settings, UiStrings
|
from openlp.core.lib import Registry, SettingsTab, Receiver, Settings, UiStrings, translate
|
||||||
from openlp.core.lib.ui import create_button
|
from openlp.core.lib.ui import create_button
|
||||||
from openlp.core.ui.media import get_media_players, set_media_players
|
from openlp.core.ui.media import get_media_players, set_media_players
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ import sys
|
|||||||
|
|
||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate, Settings
|
from openlp.core.lib import Settings, translate
|
||||||
from openlp.core.ui.media import MediaState
|
from openlp.core.ui.media import MediaState
|
||||||
from openlp.core.ui.media.mediaplayer import MediaPlayer
|
from openlp.core.ui.media.mediaplayer import MediaPlayer
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ from PyQt4 import QtGui
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from openlp.core.lib import translate, Settings
|
from openlp.core.lib import Settings, translate
|
||||||
from openlp.core.ui.media import MediaState
|
from openlp.core.ui.media import MediaState
|
||||||
from openlp.core.ui.media.mediaplayer import MediaPlayer
|
from openlp.core.ui.media.mediaplayer import MediaPlayer
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ The UI widgets of the plugin view dialog
|
|||||||
#"""
|
#"""
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate, UiStrings
|
from openlp.core.lib import UiStrings, translate
|
||||||
from openlp.core.lib.ui import create_button_box
|
from openlp.core.lib.ui import create_button_box
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ The UI widgets of the print service dialog.
|
|||||||
"""
|
"""
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import build_icon, translate, SpellTextEdit, UiStrings
|
from openlp.core.lib import SpellTextEdit, UiStrings, build_icon, translate
|
||||||
|
|
||||||
|
|
||||||
class ZoomSize(object):
|
class ZoomSize(object):
|
||||||
|
@ -36,7 +36,7 @@ import os
|
|||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
from lxml import html
|
from lxml import html
|
||||||
|
|
||||||
from openlp.core.lib import translate, get_text_file_string, Receiver, Settings, UiStrings, Registry
|
from openlp.core.lib import Receiver, Settings, UiStrings, Registry, translate, get_text_file_string
|
||||||
from openlp.core.ui.printservicedialog import Ui_PrintServiceDialog, ZoomSize
|
from openlp.core.ui.printservicedialog import Ui_PrintServiceDialog, ZoomSize
|
||||||
from openlp.core.utils import AppLocation
|
from openlp.core.utils import AppLocation
|
||||||
|
|
||||||
|
@ -42,8 +42,8 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import OpenLPToolbar, ServiceItem, Receiver, build_icon, ItemCapabilities, \
|
from openlp.core.lib import OpenLPToolbar, ServiceItem, Receiver, ItemCapabilities, Settings, PluginStatus, Registry, \
|
||||||
translate, str_to_bool, check_directory_exists, Settings, PluginStatus, Registry, UiStrings
|
UiStrings, build_icon, translate, str_to_bool, check_directory_exists
|
||||||
from openlp.core.lib.theme import ThemeLevel
|
from openlp.core.lib.theme import ThemeLevel
|
||||||
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
|
||||||
|
@ -31,7 +31,7 @@ The :mod:`~openlp.core.ui.servicenoteform` module contains the `ServiceNoteForm`
|
|||||||
"""
|
"""
|
||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate, SpellTextEdit, Registry
|
from openlp.core.lib import SpellTextEdit, Registry, translate
|
||||||
from openlp.core.lib.ui import create_button_box
|
from openlp.core.lib.ui import create_button_box
|
||||||
|
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ import logging
|
|||||||
|
|
||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Receiver, build_icon, PluginStatus, Registry
|
from openlp.core.lib import Receiver, PluginStatus, Registry, build_icon
|
||||||
from openlp.core.ui import AdvancedTab, GeneralTab, ThemesTab
|
from openlp.core.ui import AdvancedTab, GeneralTab, ThemesTab
|
||||||
from openlp.core.ui.media import PlayerTab
|
from openlp.core.ui.media import PlayerTab
|
||||||
from settingsdialog import Ui_SettingsDialog
|
from settingsdialog import Ui_SettingsDialog
|
||||||
|
@ -36,8 +36,8 @@ from collections import deque
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import OpenLPToolbar, Receiver, ItemCapabilities, translate, build_icon, build_html, \
|
from openlp.core.lib import OpenLPToolbar, Receiver, ItemCapabilities, ServiceItem, ImageSource, SlideLimits, \
|
||||||
ServiceItem, ImageSource, SlideLimits, ServiceItemAction, Settings, Registry, UiStrings, ScreenList
|
ServiceItemAction, Settings, Registry, UiStrings, ScreenList, build_icon, build_html, translate
|
||||||
from openlp.core.ui import HideMode, MainDisplay, Display, DisplayControllerType
|
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.utils.actions import ActionList, CategoryOrder
|
||||||
@ -230,7 +230,7 @@ class SlideController(DisplayController):
|
|||||||
self.playSlidesOnce = create_action(self, u'playSlidesOnce', text=UiStrings().PlaySlidesToEnd,
|
self.playSlidesOnce = create_action(self, u'playSlidesOnce', text=UiStrings().PlaySlidesToEnd,
|
||||||
icon=u':/media/media_time.png', checked=False, shortcuts=[],
|
icon=u':/media/media_time.png', checked=False, shortcuts=[],
|
||||||
category=self.category, triggers=self.onPlaySlidesOnce)
|
category=self.category, triggers=self.onPlaySlidesOnce)
|
||||||
if Settings().value(self.parent().generalSettingsSection + u'/enable slide loop'):
|
if Settings().value(self.parent().advancedSettingsSection + u'/slide limits') == SlideLimits.Wrap:
|
||||||
self.playSlidesMenu.setDefaultAction(self.playSlidesLoop)
|
self.playSlidesMenu.setDefaultAction(self.playSlidesLoop)
|
||||||
else:
|
else:
|
||||||
self.playSlidesMenu.setDefaultAction(self.playSlidesOnce)
|
self.playSlidesMenu.setDefaultAction(self.playSlidesOnce)
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
"""
|
"""
|
||||||
The splash screen
|
The splash screen
|
||||||
"""
|
"""
|
||||||
from openlp.core.lib import Receiver
|
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ The UI widgets for the time dialog
|
|||||||
"""
|
"""
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate, UiStrings
|
from openlp.core.lib import UiStrings, translate
|
||||||
from openlp.core.lib.ui import create_button_box
|
from openlp.core.lib.ui import create_button_box
|
||||||
|
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ from PyQt4 import QtGui
|
|||||||
|
|
||||||
from starttimedialog import Ui_StartTimeDialog
|
from starttimedialog import Ui_StartTimeDialog
|
||||||
|
|
||||||
from openlp.core.lib import translate, UiStrings, Registry
|
from openlp.core.lib import UiStrings, Registry, translate
|
||||||
from openlp.core.lib.ui import critical_error_message_box
|
from openlp.core.lib.ui import critical_error_message_box
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ import os
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Receiver, translate, UiStrings, Registry
|
from openlp.core.lib import Receiver, UiStrings, Registry, translate
|
||||||
from openlp.core.lib.theme import BackgroundType, BackgroundGradientType
|
from openlp.core.lib.theme import BackgroundType, BackgroundGradientType
|
||||||
from openlp.core.lib.ui import critical_error_message_box
|
from openlp.core.lib.ui import critical_error_message_box
|
||||||
from openlp.core.ui import ThemeLayoutForm
|
from openlp.core.ui import ThemeLayoutForm
|
||||||
|
@ -38,9 +38,9 @@ import re
|
|||||||
from xml.etree.ElementTree import ElementTree, XML
|
from xml.etree.ElementTree import ElementTree, XML
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import OpenLPToolbar, get_text_file_string, build_icon, Receiver, SettingsManager, translate, \
|
from openlp.core.lib import ImageSource, OpenLPToolbar, Receiver, Registry, SettingsManager, Settings, UiStrings, \
|
||||||
check_item_selected, check_directory_exists, create_thumb, validate_thumb, ImageSource, Settings, Registry, \
|
get_text_file_string, build_icon, translate, check_item_selected, check_directory_exists, create_thumb, \
|
||||||
UiStrings
|
validate_thumb
|
||||||
from openlp.core.lib.theme import ThemeXML, BackgroundType, VerticalType, BackgroundGradientType
|
from openlp.core.lib.theme import ThemeXML, BackgroundType, VerticalType, BackgroundGradientType
|
||||||
from openlp.core.lib.ui import critical_error_message_box, create_widget_action
|
from openlp.core.lib.ui import critical_error_message_box, create_widget_action
|
||||||
from openlp.core.theme import Theme
|
from openlp.core.theme import Theme
|
||||||
|
@ -31,7 +31,7 @@ The Themes configuration tab
|
|||||||
"""
|
"""
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Receiver, Registry, Settings, SettingsTab, translate, UiStrings
|
from openlp.core.lib import Registry, Settings, SettingsTab, UiStrings, translate
|
||||||
from openlp.core.lib.theme import ThemeLevel
|
from openlp.core.lib.theme import ThemeLevel
|
||||||
from openlp.core.lib.ui import find_and_set_in_combo_box
|
from openlp.core.lib.ui import find_and_set_in_combo_box
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ The Create/Edit theme wizard
|
|||||||
"""
|
"""
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate, build_icon, UiStrings
|
from openlp.core.lib import UiStrings, build_icon, translate
|
||||||
from openlp.core.lib.theme import HorizontalType, BackgroundType, BackgroundGradientType
|
from openlp.core.lib.theme import HorizontalType, BackgroundType, BackgroundGradientType
|
||||||
from openlp.core.lib.ui import add_welcome_page, create_valign_selection_widgets
|
from openlp.core.lib.ui import add_welcome_page, create_valign_selection_widgets
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ import os
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import build_icon, Receiver, Registry, Settings, translate, UiStrings
|
from openlp.core.lib import Receiver, Registry, Settings, UiStrings, build_icon, translate
|
||||||
from openlp.core.lib.ui import add_welcome_page
|
from openlp.core.lib.ui import add_welcome_page
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
@ -36,7 +36,7 @@ import sys
|
|||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.utils import AppLocation
|
from openlp.core.utils import AppLocation
|
||||||
from openlp.core.lib import translate, Settings
|
from openlp.core.lib import Settings, translate
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -29,9 +29,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Plugin, StringContent, build_icon, translate, Settings
|
from openlp.core.lib import Plugin, Settings, StringContent, build_icon, translate
|
||||||
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.ui import create_action, UiStrings
|
||||||
from openlp.core.lib.theme import VerticalType
|
from openlp.core.lib.theme import VerticalType
|
||||||
|
@ -29,8 +29,7 @@
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import SettingsTab, translate, Receiver, Settings, UiStrings
|
from openlp.core.lib import SettingsTab, Receiver, Settings, UiStrings, translate
|
||||||
from openlp.core.ui import AlertLocation
|
|
||||||
from openlp.core.lib.ui import create_valign_selection_widgets
|
from openlp.core.lib.ui import create_valign_selection_widgets
|
||||||
|
|
||||||
class AlertsTab(SettingsTab):
|
class AlertsTab(SettingsTab):
|
||||||
|
@ -31,8 +31,8 @@ import logging
|
|||||||
|
|
||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Plugin, StringContent, build_icon, translate, Settings
|
from openlp.core.lib import Plugin, StringContent, build_icon, translate
|
||||||
from openlp.core.lib.ui import create_action, UiStrings
|
from openlp.core.lib.ui import UiStrings, create_action
|
||||||
from openlp.core.utils.actions import ActionList
|
from openlp.core.utils.actions import ActionList
|
||||||
from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem, LayoutStyle, DisplayStyle, \
|
from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem, LayoutStyle, DisplayStyle, \
|
||||||
LanguageSelection
|
LanguageSelection
|
||||||
|
@ -34,7 +34,7 @@ import os
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate, Settings, UiStrings
|
from openlp.core.lib import Settings, UiStrings, translate
|
||||||
from openlp.core.lib.db import delete_database
|
from openlp.core.lib.db import delete_database
|
||||||
from openlp.core.lib.ui import critical_error_message_box
|
from openlp.core.lib.ui import critical_error_message_box
|
||||||
from openlp.core.ui.wizard import OpenLPWizard, WizardStrings
|
from openlp.core.ui.wizard import OpenLPWizard, WizardStrings
|
||||||
|
@ -36,7 +36,7 @@ from tempfile import gettempdir
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Receiver, translate, check_directory_exists, Settings, UiStrings
|
from openlp.core.lib import Receiver, Settings, UiStrings, translate, check_directory_exists
|
||||||
from openlp.core.lib.ui import critical_error_message_box
|
from openlp.core.lib.ui import critical_error_message_box
|
||||||
from openlp.core.ui.wizard import OpenLPWizard, WizardStrings
|
from openlp.core.ui.wizard import OpenLPWizard, WizardStrings
|
||||||
from openlp.core.utils import AppLocation, delete_file, get_filesystem_encoding
|
from openlp.core.utils import AppLocation, delete_file, get_filesystem_encoding
|
||||||
|
@ -32,7 +32,7 @@ import re
|
|||||||
|
|
||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Registry, translate, UiStrings
|
from openlp.core.lib import Registry, UiStrings, translate
|
||||||
from openlp.core.lib.ui import critical_error_message_box
|
from openlp.core.lib.ui import critical_error_message_box
|
||||||
from editbibledialog import Ui_EditBibleDialog
|
from editbibledialog import Ui_EditBibleDialog
|
||||||
from openlp.plugins.bibles.lib import BibleStrings
|
from openlp.plugins.bibles.lib import BibleStrings
|
||||||
|
@ -33,7 +33,7 @@ plugin.
|
|||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from openlp.core.lib import translate, Settings
|
from openlp.core.lib import Settings, translate
|
||||||
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
@ -31,7 +31,7 @@ import logging
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Receiver, SettingsTab, translate, Settings, UiStrings
|
from openlp.core.lib import Receiver, SettingsTab, Settings, UiStrings, translate
|
||||||
from openlp.core.lib.ui import find_and_set_in_combo_box
|
from openlp.core.lib.ui import find_and_set_in_combo_box
|
||||||
from openlp.plugins.bibles.lib import LayoutStyle, DisplayStyle, update_reference_separators, \
|
from openlp.plugins.bibles.lib import LayoutStyle, DisplayStyle, update_reference_separators, \
|
||||||
get_reference_separator, LanguageSelection
|
get_reference_separator, LanguageSelection
|
||||||
|
@ -62,7 +62,7 @@ import logging
|
|||||||
import chardet
|
import chardet
|
||||||
import csv
|
import csv
|
||||||
|
|
||||||
from openlp.core.lib import Receiver, translate
|
from openlp.core.lib import translate
|
||||||
from openlp.plugins.bibles.lib.db import BibleDB, BiblesResourcesDB
|
from openlp.plugins.bibles.lib.db import BibleDB, BiblesResourcesDB
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
@ -34,7 +34,7 @@ import re
|
|||||||
import sqlite3
|
import sqlite3
|
||||||
|
|
||||||
from PyQt4 import QtCore
|
from PyQt4 import QtCore
|
||||||
from sqlalchemy import Column, ForeignKey, or_, Table, types, func
|
from sqlalchemy import Column, ForeignKey, Table, or_, types, func
|
||||||
from sqlalchemy.orm import class_mapper, mapper, relation
|
from sqlalchemy.orm import class_mapper, mapper, relation
|
||||||
from sqlalchemy.orm.exc import UnmappedClassError
|
from sqlalchemy.orm.exc import UnmappedClassError
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ from HTMLParser import HTMLParseError
|
|||||||
|
|
||||||
from BeautifulSoup import BeautifulSoup, NavigableString, Tag
|
from BeautifulSoup import BeautifulSoup, NavigableString, Tag
|
||||||
|
|
||||||
from openlp.core.lib import Receiver, Registry,translate
|
from openlp.core.lib import Registry, translate
|
||||||
from openlp.core.lib.ui import critical_error_message_box
|
from openlp.core.lib.ui import critical_error_message_box
|
||||||
from openlp.core.utils import get_web_page
|
from openlp.core.utils import get_web_page
|
||||||
from openlp.plugins.bibles.lib import SearchResults
|
from openlp.plugins.bibles.lib import SearchResults
|
||||||
@ -203,8 +203,7 @@ class BGExtract(object):
|
|||||||
if clean_verse_num:
|
if clean_verse_num:
|
||||||
verse_text = raw_verse_num.next
|
verse_text = raw_verse_num.next
|
||||||
part = raw_verse_num.next.next
|
part = raw_verse_num.next.next
|
||||||
while not (isinstance(part, Tag) and
|
while not (isinstance(part, Tag) and part.get(u'class') == u'versenum'):
|
||||||
part.get(u'class') == u'versenum'):
|
|
||||||
# While we are still in the same verse grab all the text.
|
# While we are still in the same verse grab all the text.
|
||||||
if isinstance(part, NavigableString):
|
if isinstance(part, NavigableString):
|
||||||
verse_text += part
|
verse_text += part
|
||||||
@ -328,12 +327,10 @@ class BSExtract(object):
|
|||||||
``chapter``
|
``chapter``
|
||||||
Chapter number
|
Chapter number
|
||||||
"""
|
"""
|
||||||
log.debug(u'BSExtract.get_bible_chapter("%s", "%s", "%s")', version,
|
log.debug(u'BSExtract.get_bible_chapter("%s", "%s", "%s")', version, book_name, chapter)
|
||||||
book_name, chapter)
|
|
||||||
url_version = urllib.quote(version.encode("utf-8"))
|
url_version = urllib.quote(version.encode("utf-8"))
|
||||||
url_book_name = urllib.quote(book_name.encode("utf-8"))
|
url_book_name = urllib.quote(book_name.encode("utf-8"))
|
||||||
chapter_url = u'http://m.bibleserver.com/text/%s/%s%d' % \
|
chapter_url = u'http://m.bibleserver.com/text/%s/%s%d' % (url_version, url_book_name, chapter)
|
||||||
(url_version, url_book_name, chapter)
|
|
||||||
header = (u'Accept-Language', u'en')
|
header = (u'Accept-Language', u'en')
|
||||||
soup = get_soup_for_bible_ref(chapter_url, header)
|
soup = get_soup_for_bible_ref(chapter_url, header)
|
||||||
if not soup:
|
if not soup:
|
||||||
@ -363,8 +360,7 @@ class BSExtract(object):
|
|||||||
"""
|
"""
|
||||||
log.debug(u'BSExtract.get_books_from_http("%s")', version)
|
log.debug(u'BSExtract.get_books_from_http("%s")', version)
|
||||||
urlversion = urllib.quote(version.encode("utf-8"))
|
urlversion = urllib.quote(version.encode("utf-8"))
|
||||||
chapter_url = u'http://m.bibleserver.com/overlay/selectBook?'\
|
chapter_url = u'http://m.bibleserver.com/overlay/selectBook?translation=%s' % (urlversion)
|
||||||
'translation=%s' % (urlversion)
|
|
||||||
soup = get_soup_for_bible_ref(chapter_url)
|
soup = get_soup_for_bible_ref(chapter_url)
|
||||||
if not soup:
|
if not soup:
|
||||||
return None
|
return None
|
||||||
@ -374,9 +370,7 @@ class BSExtract(object):
|
|||||||
send_error_message(u'parse')
|
send_error_message(u'parse')
|
||||||
return None
|
return None
|
||||||
content = content.findAll(u'li')
|
content = content.findAll(u'li')
|
||||||
return [
|
return [book.contents[0].contents[0] for book in content]
|
||||||
book.contents[0].contents[0] for book in content
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
class CWExtract(object):
|
class CWExtract(object):
|
||||||
@ -401,13 +395,11 @@ class CWExtract(object):
|
|||||||
``chapter``
|
``chapter``
|
||||||
Chapter number
|
Chapter number
|
||||||
"""
|
"""
|
||||||
log.debug(u'CWExtract.get_bible_chapter("%s", "%s", "%s")', version,
|
log.debug(u'CWExtract.get_bible_chapter("%s", "%s", "%s")', version, book_name, chapter)
|
||||||
book_name, chapter)
|
|
||||||
url_book_name = book_name.replace(u' ', u'-')
|
url_book_name = book_name.replace(u' ', u'-')
|
||||||
url_book_name = url_book_name.lower()
|
url_book_name = url_book_name.lower()
|
||||||
url_book_name = urllib.quote(url_book_name.encode("utf-8"))
|
url_book_name = urllib.quote(url_book_name.encode("utf-8"))
|
||||||
chapter_url = u'http://www.biblestudytools.com/%s/%s/%s.html' % \
|
chapter_url = u'http://www.biblestudytools.com/%s/%s/%s.html' % (version, url_book_name, chapter)
|
||||||
(version, url_book_name, chapter)
|
|
||||||
soup = get_soup_for_bible_ref(chapter_url)
|
soup = get_soup_for_bible_ref(chapter_url)
|
||||||
if not soup:
|
if not soup:
|
||||||
return None
|
return None
|
||||||
@ -427,18 +419,18 @@ class CWExtract(object):
|
|||||||
for part in verse.contents:
|
for part in verse.contents:
|
||||||
self.application.process_events()
|
self.application.process_events()
|
||||||
if isinstance(part, NavigableString):
|
if isinstance(part, NavigableString):
|
||||||
verse_text = verse_text + part
|
verse_text += part
|
||||||
elif part and part.attrMap and \
|
elif part and part.attrMap and \
|
||||||
(part.attrMap[u'class'] == u'WordsOfChrist' or part.attrMap[u'class'] == u'strongs'):
|
(part.attrMap[u'class'] == u'WordsOfChrist' or part.attrMap[u'class'] == u'strongs'):
|
||||||
for subpart in part.contents:
|
for subpart in part.contents:
|
||||||
self.application.process_events()
|
self.application.process_events()
|
||||||
if isinstance(subpart, NavigableString):
|
if isinstance(subpart, NavigableString):
|
||||||
verse_text = verse_text + subpart
|
verse_text += subpart
|
||||||
elif subpart and subpart.attrMap and subpart.attrMap[u'class'] == u'strongs':
|
elif subpart and subpart.attrMap and subpart.attrMap[u'class'] == u'strongs':
|
||||||
for subsub in subpart.contents:
|
for subsub in subpart.contents:
|
||||||
self.application.process_events()
|
self.application.process_events()
|
||||||
if isinstance(subsub, NavigableString):
|
if isinstance(subsub, NavigableString):
|
||||||
verse_text = verse_text + subsub
|
verse_text += subsub
|
||||||
self.application.process_events()
|
self.application.process_events()
|
||||||
# Fix up leading and trailing spaces, multiple spaces, and spaces
|
# Fix up leading and trailing spaces, multiple spaces, and spaces
|
||||||
# between text and , and .
|
# between text and , and .
|
||||||
@ -456,8 +448,7 @@ class CWExtract(object):
|
|||||||
The version of the bible like NIV for New International Version
|
The version of the bible like NIV for New International Version
|
||||||
"""
|
"""
|
||||||
log.debug(u'CWExtract.get_books_from_http("%s")', version)
|
log.debug(u'CWExtract.get_books_from_http("%s")', version)
|
||||||
chapter_url = u'http://www.biblestudytools.com/%s/'\
|
chapter_url = u'http://www.biblestudytools.com/%s/' % (version)
|
||||||
% (version)
|
|
||||||
soup = get_soup_for_bible_ref(chapter_url)
|
soup = get_soup_for_bible_ref(chapter_url)
|
||||||
if not soup:
|
if not soup:
|
||||||
return None
|
return None
|
||||||
@ -521,9 +512,7 @@ class HTTPBible(BibleDB):
|
|||||||
``True`` on success, ``False`` on failure.
|
``True`` on success, ``False`` on failure.
|
||||||
"""
|
"""
|
||||||
self.wizard.progressBar.setMaximum(68)
|
self.wizard.progressBar.setMaximum(68)
|
||||||
self.wizard.incrementProgressBar(translate(
|
self.wizard.incrementProgressBar(translate('BiblesPlugin.HTTPBible', 'Registering Bible and loading books...'))
|
||||||
'BiblesPlugin.HTTPBible',
|
|
||||||
'Registering Bible and loading books...'))
|
|
||||||
self.save_meta(u'download_source', self.download_source)
|
self.save_meta(u'download_source', self.download_source)
|
||||||
self.save_meta(u'download_name', self.download_name)
|
self.save_meta(u'download_name', self.download_name)
|
||||||
if self.proxy_server:
|
if self.proxy_server:
|
||||||
@ -545,19 +534,16 @@ class HTTPBible(BibleDB):
|
|||||||
log.exception(u'Importing books from %s - download name: "%s" '\
|
log.exception(u'Importing books from %s - download name: "%s" '\
|
||||||
'failed' % (self.download_source, self.download_name))
|
'failed' % (self.download_source, self.download_name))
|
||||||
return False
|
return False
|
||||||
self.wizard.progressBar.setMaximum(len(books)+2)
|
self.wizard.progressBar.setMaximum(len(books) + 2)
|
||||||
self.wizard.incrementProgressBar(translate(
|
self.wizard.incrementProgressBar(translate( 'BiblesPlugin.HTTPBible', 'Registering Language...'))
|
||||||
'BiblesPlugin.HTTPBible', 'Registering Language...'))
|
bible = BiblesResourcesDB.get_webbible(self.download_name, self.download_source.lower())
|
||||||
bible = BiblesResourcesDB.get_webbible(self.download_name,
|
|
||||||
self.download_source.lower())
|
|
||||||
if bible[u'language_id']:
|
if bible[u'language_id']:
|
||||||
language_id = bible[u'language_id']
|
language_id = bible[u'language_id']
|
||||||
self.save_meta(u'language_id', language_id)
|
self.save_meta(u'language_id', language_id)
|
||||||
else:
|
else:
|
||||||
language_id = self.get_language(bible_name)
|
language_id = self.get_language(bible_name)
|
||||||
if not language_id:
|
if not language_id:
|
||||||
log.exception(u'Importing books from %s " '\
|
log.exception(u'Importing books from %s failed' % self.filename)
|
||||||
'failed' % self.filename)
|
|
||||||
return False
|
return False
|
||||||
for book in books:
|
for book in books:
|
||||||
if self.stop_import_flag:
|
if self.stop_import_flag:
|
||||||
@ -565,8 +551,7 @@ class HTTPBible(BibleDB):
|
|||||||
self.wizard.incrementProgressBar(translate(
|
self.wizard.incrementProgressBar(translate(
|
||||||
'BiblesPlugin.HTTPBible', 'Importing %s...',
|
'BiblesPlugin.HTTPBible', 'Importing %s...',
|
||||||
'Importing <book name>...') % book)
|
'Importing <book name>...') % book)
|
||||||
book_ref_id = self.get_book_ref_id_by_name(book, len(books),
|
book_ref_id = self.get_book_ref_id_by_name(book, len(books), language_id)
|
||||||
language_id)
|
|
||||||
if not book_ref_id:
|
if not book_ref_id:
|
||||||
log.exception(u'Importing books from %s - download name: "%s" '\
|
log.exception(u'Importing books from %s - download name: "%s" '\
|
||||||
'failed' % (self.download_source, self.download_name))
|
'failed' % (self.download_source, self.download_name))
|
||||||
@ -626,8 +611,7 @@ class HTTPBible(BibleDB):
|
|||||||
self.application.process_events()
|
self.application.process_events()
|
||||||
# Check to see if book/chapter exists.
|
# Check to see if book/chapter exists.
|
||||||
db_book = self.get_book(book_name)
|
db_book = self.get_book(book_name)
|
||||||
self.create_chapter(db_book.id, search_results.chapter,
|
self.create_chapter(db_book.id, search_results.chapter, search_results.verselist)
|
||||||
search_results.verselist)
|
|
||||||
self.application.process_events()
|
self.application.process_events()
|
||||||
self.application.set_normal_cursor()
|
self.application.set_normal_cursor()
|
||||||
self.application.process_events()
|
self.application.process_events()
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from openlp.core.lib import Registry, Receiver, SettingsManager, translate, Settings
|
from openlp.core.lib import Registry, SettingsManager, Settings, translate
|
||||||
from openlp.core.utils import AppLocation, delete_file
|
from openlp.core.utils import AppLocation, delete_file
|
||||||
from openlp.plugins.bibles.lib import parse_reference, get_reference_separator, LanguageSelection
|
from openlp.plugins.bibles.lib import parse_reference, get_reference_separator, LanguageSelection
|
||||||
from openlp.plugins.bibles.lib.db import BibleDB, BibleMeta
|
from openlp.plugins.bibles.lib.db import BibleDB, BibleMeta
|
||||||
|
@ -31,8 +31,8 @@ import logging
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Registry, MediaManagerItem, Receiver, ItemCapabilities, translate, create_separated_list, \
|
from openlp.core.lib import Registry, MediaManagerItem, Receiver, ItemCapabilities, ServiceItemContext, Settings, \
|
||||||
ServiceItemContext, Settings, UiStrings
|
UiStrings, create_separated_list, translate
|
||||||
from openlp.core.lib.searchedit import SearchEdit
|
from openlp.core.lib.searchedit import SearchEdit
|
||||||
from openlp.core.lib.ui import set_case_insensitive_completer, create_horizontal_adjusting_combo_box, \
|
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
|
critical_error_message_box, find_and_set_in_combo_box, build_icon
|
||||||
|
@ -31,7 +31,6 @@ import logging
|
|||||||
import sqlite
|
import sqlite
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from openlp.core.lib import Receiver
|
|
||||||
from openlp.core.ui.wizard import WizardStrings
|
from openlp.core.ui.wizard import WizardStrings
|
||||||
from openlp.plugins.bibles.lib.db import BibleDB, BiblesResourcesDB
|
from openlp.plugins.bibles.lib.db import BibleDB, BiblesResourcesDB
|
||||||
|
|
||||||
|
@ -72,12 +72,12 @@ class VerseReferenceList(object):
|
|||||||
prev = index - 1
|
prev = index - 1
|
||||||
if self.verse_list[prev][u'version'] != verse[u'version']:
|
if self.verse_list[prev][u'version'] != verse[u'version']:
|
||||||
result = u'%s (%s)' % (result, self.verse_list[prev][u'version'])
|
result = u'%s (%s)' % (result, self.verse_list[prev][u'version'])
|
||||||
result = result + u', '
|
result += u', '
|
||||||
if self.verse_list[prev][u'book'] != verse[u'book']:
|
if self.verse_list[prev][u'book'] != verse[u'book']:
|
||||||
result = u'%s%s %s:' % (result, verse[u'book'], verse[u'chapter'])
|
result = u'%s%s %s:' % (result, verse[u'book'], verse[u'chapter'])
|
||||||
elif self.verse_list[prev][u'chapter'] != verse[u'chapter']:
|
elif self.verse_list[prev][u'chapter'] != verse[u'chapter']:
|
||||||
result = u'%s%s:' % (result, verse[u'chapter'])
|
result = u'%s%s:' % (result, verse[u'chapter'])
|
||||||
result = result + str(verse[u'start'])
|
result += str(verse[u'start'])
|
||||||
if verse[u'start'] != verse[u'end']:
|
if verse[u'start'] != verse[u'end']:
|
||||||
result = u'%s-%s' % (result, verse[u'end'])
|
result = u'%s-%s' % (result, verse[u'end'])
|
||||||
if len(self.version_list) > 1:
|
if len(self.version_list) > 1:
|
||||||
@ -89,8 +89,8 @@ class VerseReferenceList(object):
|
|||||||
for index, version in enumerate(self.version_list):
|
for index, version in enumerate(self.version_list):
|
||||||
if index > 0:
|
if index > 0:
|
||||||
if result[-1] not in [u';', u',', u'.']:
|
if result[-1] not in [u';', u',', u'.']:
|
||||||
result = result + u';'
|
result += u';'
|
||||||
result = result + u' '
|
result += u' '
|
||||||
result = u'%s%s, %s' % (result, version[u'version'], version[u'copyright'])
|
result = u'%s%s, %s' % (result, version[u'version'], version[u'copyright'])
|
||||||
if version[u'permission'].strip():
|
if version[u'permission'].strip():
|
||||||
result = result + u', ' + version[u'permission']
|
result = result + u', ' + version[u'permission']
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from openlp.core.lib import build_icon, translate, UiStrings
|
from openlp.core.lib import UiStrings, build_icon, translate
|
||||||
from openlp.core.lib.ui import create_button_box, create_button
|
from openlp.core.lib.ui import create_button_box, create_button
|
||||||
|
|
||||||
class Ui_CustomEditDialog(object):
|
class Ui_CustomEditDialog(object):
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate, SpellTextEdit, build_icon, UiStrings
|
from openlp.core.lib import SpellTextEdit, UiStrings, translate
|
||||||
from openlp.core.lib.ui import create_button, create_button_box
|
from openlp.core.lib.ui import create_button, create_button_box
|
||||||
|
|
||||||
class Ui_CustomSlideEditDialog(object):
|
class Ui_CustomSlideEditDialog(object):
|
||||||
|
@ -33,7 +33,7 @@ for the Custom Slides plugin, which is inserted into the configuration dialog.
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import SettingsTab, translate, Settings
|
from openlp.core.lib import SettingsTab, Settings, translate
|
||||||
|
|
||||||
class CustomTab(SettingsTab):
|
class CustomTab(SettingsTab):
|
||||||
"""
|
"""
|
||||||
|
@ -32,8 +32,8 @@ import logging
|
|||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
from sqlalchemy.sql import or_, func, and_
|
from sqlalchemy.sql import or_, func, and_
|
||||||
|
|
||||||
from openlp.core.lib import Registry, MediaManagerItem, Receiver, ItemCapabilities, check_item_selected, translate, \
|
from openlp.core.lib import Registry, MediaManagerItem, Receiver, ItemCapabilities, ServiceItemContext, Settings, \
|
||||||
ServiceItemContext, Settings, PluginStatus, UiStrings
|
PluginStatus, UiStrings, check_item_selected, translate
|
||||||
from openlp.plugins.custom.forms import EditCustomForm
|
from openlp.plugins.custom.forms import EditCustomForm
|
||||||
from openlp.plugins.custom.lib import CustomXMLParser, CustomXMLBuilder
|
from openlp.plugins.custom.lib import CustomXMLParser, CustomXMLBuilder
|
||||||
from openlp.plugins.custom.lib.db import CustomSlide
|
from openlp.plugins.custom.lib.db import CustomSlide
|
||||||
|
@ -31,7 +31,7 @@ from PyQt4 import QtCore, QtGui
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from openlp.core.lib import Plugin, StringContent, build_icon, translate, Receiver, ImageSource, Settings
|
from openlp.core.lib import Plugin, StringContent, Receiver, ImageSource, Settings, build_icon, translate
|
||||||
from openlp.plugins.images.lib import ImageMediaItem, ImageTab
|
from openlp.plugins.images.lib import ImageMediaItem, ImageTab
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import SettingsTab, translate, Receiver, Settings, UiStrings
|
from openlp.core.lib import SettingsTab, Receiver, Settings, UiStrings, translate
|
||||||
|
|
||||||
class ImageTab(SettingsTab):
|
class ImageTab(SettingsTab):
|
||||||
"""
|
"""
|
||||||
|
@ -32,9 +32,9 @@ import os
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import MediaManagerItem, build_icon, ItemCapabilities, SettingsManager, translate, \
|
from openlp.core.lib import MediaManagerItem, ItemCapabilities, Receiver, SettingsManager, ServiceItemContext, \
|
||||||
check_item_selected, check_directory_exists, Receiver, create_thumb, validate_thumb, ServiceItemContext, Settings, \
|
Settings, UiStrings, build_icon, check_item_selected, check_directory_exists, create_thumb, translate, \
|
||||||
UiStrings
|
validate_thumb
|
||||||
from openlp.core.lib.ui import critical_error_message_box
|
from openlp.core.lib.ui import critical_error_message_box
|
||||||
from openlp.core.utils import AppLocation, delete_file, locale_compare, get_images_filter
|
from openlp.core.utils import AppLocation, delete_file, locale_compare, get_images_filter
|
||||||
|
|
||||||
|
@ -32,9 +32,8 @@ import os
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import MediaManagerItem, build_icon, ItemCapabilities, SettingsManager, translate, \
|
from openlp.core.lib import ItemCapabilities, MediaManagerItem,MediaType, Receiver, ServiceItem, ServiceItemContext, \
|
||||||
check_item_selected, Receiver, MediaType, ServiceItem, ServiceItemContext, Settings, UiStrings, \
|
Settings, UiStrings, build_icon, check_item_selected, check_directory_exists, translate
|
||||||
check_directory_exists
|
|
||||||
from openlp.core.lib.ui import critical_error_message_box, create_horizontal_adjusting_combo_box
|
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 import DisplayController, Display, DisplayControllerType
|
||||||
from openlp.core.ui.media import get_media_players, set_media_players
|
from openlp.core.ui.media import get_media_players, set_media_players
|
||||||
|
@ -27,11 +27,9 @@
|
|||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Receiver, Settings, SettingsTab, translate, UiStrings
|
from openlp.core.lib import Receiver, Settings, SettingsTab, UiStrings, translate
|
||||||
from openlp.core.lib.ui import create_button
|
|
||||||
from openlp.core.ui.media import get_media_players, set_media_players
|
|
||||||
|
|
||||||
class MediaQCheckBox(QtGui.QCheckBox):
|
class MediaQCheckBox(QtGui.QCheckBox):
|
||||||
"""
|
"""
|
||||||
|
@ -31,7 +31,7 @@ import logging
|
|||||||
|
|
||||||
from PyQt4 import QtCore
|
from PyQt4 import QtCore
|
||||||
|
|
||||||
from openlp.core.lib import Plugin, StringContent, build_icon, translate, Settings, Registry
|
from openlp.core.lib import Plugin, Registry, StringContent, Settings, build_icon, translate
|
||||||
from openlp.plugins.media.lib import MediaMediaItem, MediaTab
|
from openlp.plugins.media.lib import MediaMediaItem, MediaTab
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
@ -189,7 +189,7 @@ class ImpressController(PresentationController):
|
|||||||
while list.hasMoreElements():
|
while list.hasMoreElements():
|
||||||
doc = list.nextElement()
|
doc = list.nextElement()
|
||||||
if doc.getImplementationName() != u'com.sun.star.comp.framework.BackingComp':
|
if doc.getImplementationName() != u'com.sun.star.comp.framework.BackingComp':
|
||||||
cnt = cnt + 1
|
cnt += 1
|
||||||
if cnt > 0:
|
if cnt > 0:
|
||||||
log.debug(u'OpenOffice not terminated as docs are still open')
|
log.debug(u'OpenOffice not terminated as docs are still open')
|
||||||
else:
|
else:
|
||||||
@ -399,7 +399,7 @@ class ImpressDocument(PresentationDocument):
|
|||||||
i = 1
|
i = 1
|
||||||
while not self.control and i < 150:
|
while not self.control and i < 150:
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
i = i + 1
|
i += 1
|
||||||
self.control = self.presentation.getController()
|
self.control = self.presentation.getController()
|
||||||
else:
|
else:
|
||||||
self.control.activate()
|
self.control.activate()
|
||||||
|
@ -32,8 +32,8 @@ import os
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import MediaManagerItem, build_icon, SettingsManager, translate, check_item_selected, Receiver, \
|
from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, ServiceItemContext, Settings, UiStrings, \
|
||||||
ItemCapabilities, create_thumb, validate_thumb, ServiceItemContext, Settings, UiStrings
|
build_icon, check_item_selected, create_thumb, translate, validate_thumb
|
||||||
from openlp.core.lib.ui import critical_error_message_box, create_horizontal_adjusting_combo_box
|
from openlp.core.lib.ui import critical_error_message_box, create_horizontal_adjusting_combo_box
|
||||||
from openlp.core.utils import locale_compare
|
from openlp.core.utils import locale_compare
|
||||||
from openlp.plugins.presentations.lib import MessageListener
|
from openlp.plugins.presentations.lib import MessageListener
|
||||||
@ -269,7 +269,7 @@ class PresentationMediaItem(MediaManagerItem):
|
|||||||
if img:
|
if img:
|
||||||
while img:
|
while img:
|
||||||
service_item.add_from_command(path, name, img)
|
service_item.add_from_command(path, name, img)
|
||||||
i = i + 1
|
i += 1
|
||||||
img = doc.get_thumbnail_path(i, True)
|
img = doc.get_thumbnail_path(i, True)
|
||||||
doc.close_presentation()
|
doc.close_presentation()
|
||||||
return True
|
return True
|
||||||
|
@ -177,7 +177,7 @@ class Controller(object):
|
|||||||
if not self.doc.is_active():
|
if not self.doc.is_active():
|
||||||
return
|
return
|
||||||
if self.doc.slidenumber < self.doc.get_slide_count():
|
if self.doc.slidenumber < self.doc.get_slide_count():
|
||||||
self.doc.slidenumber = self.doc.slidenumber + 1
|
self.doc.slidenumber += 1
|
||||||
self.poll()
|
self.poll()
|
||||||
return
|
return
|
||||||
if not self.activate():
|
if not self.activate():
|
||||||
@ -203,7 +203,7 @@ class Controller(object):
|
|||||||
if not self.doc.is_active():
|
if not self.doc.is_active():
|
||||||
return
|
return
|
||||||
if self.doc.slidenumber > 1:
|
if self.doc.slidenumber > 1:
|
||||||
self.doc.slidenumber = self.doc.slidenumber - 1
|
self.doc.slidenumber -= 1
|
||||||
self.poll()
|
self.poll()
|
||||||
return
|
return
|
||||||
if not self.activate():
|
if not self.activate():
|
||||||
|
@ -71,35 +71,35 @@ class PPTViewer(QtGui.QWidget):
|
|||||||
row = 0
|
row = 0
|
||||||
grid.addWidget(folder_label, 0, 0)
|
grid.addWidget(folder_label, 0, 0)
|
||||||
grid.addWidget(self.folderEdit, 0, 1)
|
grid.addWidget(self.folderEdit, 0, 1)
|
||||||
row = row + 1
|
row += 1
|
||||||
grid.addWidget(x_label, row, 0)
|
grid.addWidget(x_label, row, 0)
|
||||||
grid.addWidget(self.xEdit, row, 1)
|
grid.addWidget(self.xEdit, row, 1)
|
||||||
grid.addWidget(y_label, row, 2)
|
grid.addWidget(y_label, row, 2)
|
||||||
grid.addWidget(self.yEdit, row, 3)
|
grid.addWidget(self.yEdit, row, 3)
|
||||||
row = row + 1
|
row += 1
|
||||||
grid.addWidget(width_label, row, 0)
|
grid.addWidget(width_label, row, 0)
|
||||||
grid.addWidget(self.widthEdit, row, 1)
|
grid.addWidget(self.widthEdit, row, 1)
|
||||||
grid.addWidget(height_label, row, 2)
|
grid.addWidget(height_label, row, 2)
|
||||||
grid.addWidget(self.heightEdit, row, 3)
|
grid.addWidget(self.heightEdit, row, 3)
|
||||||
row = row + 1
|
row += 1
|
||||||
grid.addWidget(ppt_label, row, 0)
|
grid.addWidget(ppt_label, row, 0)
|
||||||
grid.addWidget(self.pptEdit, row, 1)
|
grid.addWidget(self.pptEdit, row, 1)
|
||||||
grid.addWidget(ppt_dlg_btn, row, 2)
|
grid.addWidget(ppt_dlg_btn, row, 2)
|
||||||
grid.addWidget(ppt_btn, row, 3)
|
grid.addWidget(ppt_btn, row, 3)
|
||||||
row = row + 1
|
row += 1
|
||||||
grid.addWidget(slide_label, row, 0)
|
grid.addWidget(slide_label, row, 0)
|
||||||
grid.addWidget(self.slideEdit, row, 1)
|
grid.addWidget(self.slideEdit, row, 1)
|
||||||
grid.addWidget(slide_btn, row, 2)
|
grid.addWidget(slide_btn, row, 2)
|
||||||
row = row + 1
|
row += 1
|
||||||
grid.addWidget(prev, row, 0)
|
grid.addWidget(prev, row, 0)
|
||||||
grid.addWidget(next, row, 1)
|
grid.addWidget(next, row, 1)
|
||||||
row = row + 1
|
row += 1
|
||||||
grid.addWidget(blank, row, 0)
|
grid.addWidget(blank, row, 0)
|
||||||
grid.addWidget(unblank, row, 1)
|
grid.addWidget(unblank, row, 1)
|
||||||
row = row + 1
|
row += 1
|
||||||
grid.addWidget(restart, row, 0)
|
grid.addWidget(restart, row, 0)
|
||||||
grid.addWidget(close, row, 1)
|
grid.addWidget(close, row, 1)
|
||||||
row = row + 1
|
row += 1
|
||||||
grid.addWidget(stop, row, 0)
|
grid.addWidget(stop, row, 0)
|
||||||
grid.addWidget(resume, row, 1)
|
grid.addWidget(resume, row, 1)
|
||||||
self.connect(ppt_btn, QtCore.SIGNAL(u'clicked()'), self.openClick)
|
self.connect(ppt_btn, QtCore.SIGNAL(u'clicked()'), self.openClick)
|
||||||
|
@ -33,7 +33,7 @@ import shutil
|
|||||||
|
|
||||||
from PyQt4 import QtCore
|
from PyQt4 import QtCore
|
||||||
|
|
||||||
from openlp.core.lib import Receiver, Registry, check_directory_exists, create_thumb, validate_thumb, Settings
|
from openlp.core.lib import Receiver, Registry, Settings, check_directory_exists, create_thumb, validate_thumb
|
||||||
from openlp.core.utils import AppLocation
|
from openlp.core.utils import AppLocation
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
@ -27,9 +27,9 @@
|
|||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Receiver, Settings, SettingsTab, translate, UiStrings
|
from openlp.core.lib import Receiver, Settings, SettingsTab, UiStrings, translate
|
||||||
|
|
||||||
class PresentationTab(SettingsTab):
|
class PresentationTab(SettingsTab):
|
||||||
"""
|
"""
|
||||||
|
@ -138,7 +138,9 @@ class HttpResponse(object):
|
|||||||
'Content-Type': 'text/html; charset="utf-8"\r\n'
|
'Content-Type': 'text/html; charset="utf-8"\r\n'
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, content='', headers={}, code=None):
|
def __init__(self, content='', headers=None, code=None):
|
||||||
|
if headers is None:
|
||||||
|
headers = {}
|
||||||
self.content = content
|
self.content = content
|
||||||
for key, value in headers.iteritems():
|
for key, value in headers.iteritems():
|
||||||
self.headers[key] = value
|
self.headers[key] = value
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui, QtNetwork
|
from PyQt4 import QtCore, QtGui, QtNetwork
|
||||||
|
|
||||||
from openlp.core.lib import Registry, Settings, SettingsTab, translate
|
from openlp.core.lib import Registry, Settings, SettingsTab, Receiver, translate
|
||||||
|
|
||||||
|
|
||||||
ZERO_URL = u'0.0.0.0'
|
ZERO_URL = u'0.0.0.0'
|
||||||
@ -133,7 +133,7 @@ class RemoteTab(SettingsTab):
|
|||||||
ipAddress = self.addressEdit.text()
|
ipAddress = self.addressEdit.text()
|
||||||
url = u'http://%s:%s/' % (ipAddress, self.portSpinBox.value())
|
url = u'http://%s:%s/' % (ipAddress, self.portSpinBox.value())
|
||||||
self.remoteUrl.setText(u'<a href="%s">%s</a>' % (url, url))
|
self.remoteUrl.setText(u'<a href="%s">%s</a>' % (url, url))
|
||||||
url = url + u'stage'
|
url += u'stage'
|
||||||
self.stageUrl.setText(u'<a href="%s">%s</a>' % (url, url))
|
self.stageUrl.setText(u'<a href="%s">%s</a>' % (url, url))
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import build_icon, translate, UiStrings
|
from openlp.core.lib import UiStrings, build_icon, translate
|
||||||
from openlp.core.lib.ui import create_button_box, create_button
|
from openlp.core.lib.ui import create_button_box, create_button
|
||||||
from openlp.plugins.songs.lib.ui import SongStrings
|
from openlp.plugins.songs.lib.ui import SongStrings
|
||||||
|
|
||||||
|
@ -38,8 +38,8 @@ import shutil
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import PluginStatus, Receiver, MediaType, translate, create_separated_list, \
|
from openlp.core.lib import Registry, PluginStatus, Receiver, MediaType, translate, create_separated_list, \
|
||||||
check_directory_exists, Registry, UiStrings
|
check_directory_exists, UiStrings
|
||||||
from openlp.core.lib.ui import set_case_insensitive_completer, critical_error_message_box, \
|
from openlp.core.lib.ui import set_case_insensitive_completer, critical_error_message_box, \
|
||||||
find_and_set_in_combo_box
|
find_and_set_in_combo_box
|
||||||
from openlp.core.utils import AppLocation
|
from openlp.core.utils import AppLocation
|
||||||
@ -184,7 +184,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
Load the media files into a combobox.
|
Load the media files into a combobox.
|
||||||
"""
|
"""
|
||||||
self.audioAddFromMediaButton.setVisible(False)
|
self.audioAddFromMediaButton.setVisible(False)
|
||||||
for plugin in self.parent().pluginManager.plugins:
|
for plugin in self.plugin_manager.plugins:
|
||||||
if plugin.name == u'media' and plugin.status == PluginStatus.Active:
|
if plugin.name == u'media' and plugin.status == PluginStatus.Active:
|
||||||
self.audioAddFromMediaButton.setVisible(True)
|
self.audioAddFromMediaButton.setVisible(True)
|
||||||
self.mediaForm.populateFiles(plugin.mediaItem.getList(MediaType.Audio))
|
self.mediaForm.populateFiles(plugin.mediaItem.getList(MediaType.Audio))
|
||||||
@ -907,6 +907,16 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
except:
|
except:
|
||||||
log.exception(u'Problem processing song Lyrics \n%s', sxml.dump_xml())
|
log.exception(u'Problem processing song Lyrics \n%s', sxml.dump_xml())
|
||||||
|
|
||||||
|
def _get_plugin_manager(self):
|
||||||
|
"""
|
||||||
|
Adds the plugin manager to the class dynamically
|
||||||
|
"""
|
||||||
|
if not hasattr(self, u'_plugin_manager'):
|
||||||
|
self._plugin_manager = Registry().get(u'plugin_manager')
|
||||||
|
return self._plugin_manager
|
||||||
|
|
||||||
|
plugin_manager = property(_get_plugin_manager)
|
||||||
|
|
||||||
def _get_theme_manager(self):
|
def _get_theme_manager(self):
|
||||||
"""
|
"""
|
||||||
Adds the theme manager to the class dynamically
|
Adds the theme manager to the class dynamically
|
||||||
@ -916,3 +926,4 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
return self._theme_manager
|
return self._theme_manager
|
||||||
|
|
||||||
theme_manager = property(_get_theme_manager)
|
theme_manager = property(_get_theme_manager)
|
||||||
|
|
||||||
|
@ -29,8 +29,8 @@
|
|||||||
|
|
||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from openlp.core.lib import build_icon, translate, SpellTextEdit
|
from openlp.core.lib import SpellTextEdit, build_icon, translate
|
||||||
from openlp.core.lib.ui import create_button_box, UiStrings
|
from openlp.core.lib.ui import UiStrings, create_button_box
|
||||||
from openlp.plugins.songs.lib import VerseType
|
from openlp.plugins.songs.lib import VerseType
|
||||||
|
|
||||||
class Ui_EditVerseDialog(object):
|
class Ui_EditVerseDialog(object):
|
||||||
|
@ -32,8 +32,7 @@ import logging
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib.ui import critical_error_message_box
|
from openlp.plugins.songs.lib import VerseType
|
||||||
from openlp.plugins.songs.lib import VerseType, translate
|
|
||||||
|
|
||||||
from editversedialog import Ui_EditVerseDialog
|
from editversedialog import Ui_EditVerseDialog
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ import logging
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import build_icon, Receiver, translate, create_separated_list, UiStrings
|
from openlp.core.lib import Receiver, UiStrings, create_separated_list, build_icon, translate
|
||||||
from openlp.core.lib.ui import critical_error_message_box
|
from openlp.core.lib.ui import critical_error_message_box
|
||||||
from openlp.core.ui.wizard import OpenLPWizard, WizardStrings
|
from openlp.core.ui.wizard import OpenLPWizard, WizardStrings
|
||||||
from openlp.plugins.songs.lib import natcmp
|
from openlp.plugins.songs.lib import natcmp
|
||||||
|
@ -35,7 +35,7 @@ import os
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Settings, translate, UiStrings
|
from openlp.core.lib import Settings, UiStrings, translate
|
||||||
from openlp.core.lib.ui import critical_error_message_box
|
from openlp.core.lib.ui import critical_error_message_box
|
||||||
from openlp.core.ui.wizard import OpenLPWizard, WizardStrings
|
from openlp.core.ui.wizard import OpenLPWizard, WizardStrings
|
||||||
from openlp.plugins.songs.lib.importer import SongFormat, SongFormatSelect
|
from openlp.plugins.songs.lib.importer import SongFormat, SongFormatSelect
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import build_icon, UiStrings
|
from openlp.core.lib import UiStrings, build_icon
|
||||||
from openlp.core.lib.ui import create_button_box
|
from openlp.core.lib.ui import create_button_box
|
||||||
from openlp.plugins.songs.lib.ui import SongStrings
|
from openlp.plugins.songs.lib.ui import SongStrings
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ import logging
|
|||||||
from PyQt4 import QtGui, QtCore
|
from PyQt4 import QtGui, QtCore
|
||||||
from sqlalchemy.sql import and_
|
from sqlalchemy.sql import and_
|
||||||
|
|
||||||
from openlp.core.lib import Receiver, translate, UiStrings
|
from openlp.core.lib import Receiver, UiStrings, translate
|
||||||
from openlp.core.lib.ui import critical_error_message_box
|
from openlp.core.lib.ui import critical_error_message_box
|
||||||
from openlp.plugins.songs.forms import AuthorsForm, TopicsForm, SongBookForm
|
from openlp.plugins.songs.forms import AuthorsForm, TopicsForm, SongBookForm
|
||||||
from openlp.plugins.songs.lib.db import Author, Book, Topic, Song
|
from openlp.plugins.songs.lib.db import Author, Book, Topic, Song
|
||||||
|
@ -571,6 +571,8 @@ def strip_rtf(text, default_encoding=None):
|
|||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
encoding, default_encoding = get_encoding(font, font_table, default_encoding, failed=failed)
|
encoding, default_encoding = get_encoding(font, font_table, default_encoding, failed=failed)
|
||||||
|
if not encoding:
|
||||||
|
return None
|
||||||
out.append(chr(charcode).decode(encoding))
|
out.append(chr(charcode).decode(encoding))
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
failed = True
|
failed = True
|
||||||
|
@ -162,7 +162,7 @@ class EasySlidesImport(SongImport):
|
|||||||
region = self._extractRegion(line)
|
region = self._extractRegion(line)
|
||||||
regionlines[region] = 1 + regionlines.get(region, 0)
|
regionlines[region] = 1 + regionlines.get(region, 0)
|
||||||
elif line[0] == u'[':
|
elif line[0] == u'[':
|
||||||
separatorlines = separatorlines + 1
|
separatorlines += 1
|
||||||
# if the song has separators
|
# if the song has separators
|
||||||
separators = (separatorlines > 0)
|
separators = (separatorlines > 0)
|
||||||
# the number of different regions in song - 1
|
# the number of different regions in song - 1
|
||||||
@ -200,7 +200,7 @@ class EasySlidesImport(SongImport):
|
|||||||
# separators are used, so empty line means slide break
|
# separators are used, so empty line means slide break
|
||||||
# inside verse
|
# inside verse
|
||||||
if self._listHas(verses, [reg, vt, vn, inst]):
|
if self._listHas(verses, [reg, vt, vn, inst]):
|
||||||
inst = inst + 1
|
inst += 1
|
||||||
else:
|
else:
|
||||||
# separators are not used, so empty line starts a new verse
|
# separators are not used, so empty line starts a new verse
|
||||||
vt = u'V'
|
vt = u'V'
|
||||||
|
@ -174,7 +174,10 @@ class EasyWorshipSongImport(SongImport):
|
|||||||
self.addAuthor(author_name.strip())
|
self.addAuthor(author_name.strip())
|
||||||
if words:
|
if words:
|
||||||
# Format the lyrics
|
# Format the lyrics
|
||||||
words, self.encoding = strip_rtf(words, self.encoding)
|
result = strip_rtf(words, self.encoding)
|
||||||
|
if result is None:
|
||||||
|
return
|
||||||
|
words, self.encoding = result
|
||||||
verse_type = VerseType.Tags[VerseType.Verse]
|
verse_type = VerseType.Tags[VerseType.Verse]
|
||||||
for verse in SLIDE_BREAK_REGEX.split(words):
|
for verse in SLIDE_BREAK_REGEX.split(words):
|
||||||
verse = verse.strip()
|
verse = verse.strip()
|
||||||
|
@ -35,8 +35,10 @@ import shutil
|
|||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
from sqlalchemy.sql import or_
|
from sqlalchemy.sql import or_
|
||||||
|
|
||||||
from openlp.core.lib import Registry, MediaManagerItem, Receiver, ItemCapabilities, translate, check_item_selected, \
|
|
||||||
PluginStatus, create_separated_list, check_directory_exists, ServiceItemContext, Settings, UiStrings
|
from openlp.core.lib import Registry, MediaManagerItem, Receiver, ItemCapabilities, PluginStatus, ServiceItemContext, \
|
||||||
|
Settings, \
|
||||||
|
UiStrings, translate, check_item_selected, create_separated_list, check_directory_exists
|
||||||
from openlp.core.lib.ui import create_widget_action
|
from openlp.core.lib.ui import create_widget_action
|
||||||
from openlp.core.utils import AppLocation
|
from openlp.core.utils import AppLocation
|
||||||
from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, SongImportForm, SongExportForm
|
from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, SongImportForm, SongExportForm
|
||||||
|
@ -107,7 +107,10 @@ class SongProImport(SongImport):
|
|||||||
self.finish()
|
self.finish()
|
||||||
return
|
return
|
||||||
if u'rtf1' in text:
|
if u'rtf1' in text:
|
||||||
text, self.encoding = strip_rtf(text, self.encoding)
|
result = strip_rtf(text, self.encoding)
|
||||||
|
if result is None:
|
||||||
|
return
|
||||||
|
text, self.encoding = result
|
||||||
text = text.rstrip()
|
text = text.rstrip()
|
||||||
if not text:
|
if not text:
|
||||||
return
|
return
|
||||||
|
@ -203,7 +203,7 @@ class SongShowPlusImport(SongImport):
|
|||||||
if verse_name not in self.otherList:
|
if verse_name not in self.otherList:
|
||||||
if ignore_unique:
|
if ignore_unique:
|
||||||
return None
|
return None
|
||||||
self.otherCount = self.otherCount + 1
|
self.otherCount += 1
|
||||||
self.otherList[verse_name] = str(self.otherCount)
|
self.otherList[verse_name] = str(self.otherCount)
|
||||||
verse_tag = VerseType.Tags[VerseType.Other]
|
verse_tag = VerseType.Tags[VerseType.Other]
|
||||||
verse_number = self.otherList[verse_name]
|
verse_number = self.otherList[verse_name]
|
||||||
|
@ -121,7 +121,7 @@ class SundayPlusImport(SongImport):
|
|||||||
end = data.find(')', i) + 1
|
end = data.find(')', i) + 1
|
||||||
value = data[i:end]
|
value = data[i:end]
|
||||||
# If we are in the main group.
|
# If we are in the main group.
|
||||||
if cell == False:
|
if not cell:
|
||||||
if name == 'title':
|
if name == 'title':
|
||||||
self.title = self.decode(self.unescape(value))
|
self.title = self.decode(self.unescape(value))
|
||||||
elif name == 'Author':
|
elif name == 'Author':
|
||||||
@ -148,7 +148,10 @@ class SundayPlusImport(SongImport):
|
|||||||
verse_type = HOTKEY_TO_VERSE_TYPE[value]
|
verse_type = HOTKEY_TO_VERSE_TYPE[value]
|
||||||
if name == 'rtf':
|
if name == 'rtf':
|
||||||
value = self.unescape(value)
|
value = self.unescape(value)
|
||||||
verse, self.encoding = strip_rtf(value, self.encoding)
|
result = strip_rtf(value, self.encoding)
|
||||||
|
if result is None:
|
||||||
|
return
|
||||||
|
verse, self.encoding = result
|
||||||
lines = verse.strip().split('\n')
|
lines = verse.strip().split('\n')
|
||||||
# If any line inside any verse contains CCLI or
|
# If any line inside any verse contains CCLI or
|
||||||
# only Public Domain, we treat this as special data:
|
# only Public Domain, we treat this as special data:
|
||||||
|
@ -36,7 +36,7 @@ import logging
|
|||||||
LOG_FILENAME = 'test_import_file.log'
|
LOG_FILENAME = 'test_import_file.log'
|
||||||
logging.basicConfig(filename=LOG_FILENAME,level=logging.INFO)
|
logging.basicConfig(filename=LOG_FILENAME,level=logging.INFO)
|
||||||
|
|
||||||
from test_opensongimport import wizard_stub, progbar_stub
|
from test_opensongimport import wizard_stub
|
||||||
|
|
||||||
def test(filenames):
|
def test(filenames):
|
||||||
manager = Manager(u'songs', init_schema)
|
manager = Manager(u'songs', init_schema)
|
||||||
|
@ -30,18 +30,14 @@
|
|||||||
from openlp.plugins.songs.lib.opensongimport import OpenSongImport
|
from openlp.plugins.songs.lib.opensongimport import OpenSongImport
|
||||||
from openlp.plugins.songs.lib.db import init_schema
|
from openlp.plugins.songs.lib.db import init_schema
|
||||||
from openlp.core.lib.db import Manager
|
from openlp.core.lib.db import Manager
|
||||||
from glob import glob
|
|
||||||
from zipfile import ZipFile
|
|
||||||
import os
|
import os
|
||||||
from traceback import print_exc
|
|
||||||
import sys
|
|
||||||
import codecs
|
import codecs
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
LOG_FILENAME = 'import.log'
|
LOG_FILENAME = 'import.log'
|
||||||
logging.basicConfig(filename=LOG_FILENAME,level=logging.INFO)
|
logging.basicConfig(filename=LOG_FILENAME,level=logging.INFO)
|
||||||
|
|
||||||
from test_opensongimport import wizard_stub, progbar_stub
|
from test_opensongimport import wizard_stub
|
||||||
|
|
||||||
# Useful test function for importing a variety of different files
|
# Useful test function for importing a variety of different files
|
||||||
# Uncomment below depending on what problem trying to make occur!
|
# Uncomment below depending on what problem trying to make occur!
|
||||||
|
@ -69,7 +69,7 @@ import re
|
|||||||
from lxml import etree, objectify
|
from lxml import etree, objectify
|
||||||
|
|
||||||
from openlp.core.lib import FormattingTags, translate
|
from openlp.core.lib import FormattingTags, translate
|
||||||
from openlp.plugins.songs.lib import clean_song, VerseType
|
from openlp.plugins.songs.lib import VerseType, clean_song
|
||||||
from openlp.plugins.songs.lib.db import Author, Book, Song, Topic
|
from openlp.plugins.songs.lib.db import Author, Book, Song, Topic
|
||||||
from openlp.core.utils import get_application_version
|
from openlp.core.utils import get_application_version
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ import sqlite3
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Plugin, StringContent, build_icon, translate, UiStrings
|
from openlp.core.lib import Plugin, StringContent, UiStrings, build_icon, translate
|
||||||
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 import get_filesystem_encoding
|
from openlp.core.utils import get_filesystem_encoding
|
||||||
|
@ -32,7 +32,7 @@ from datetime import datetime
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import build_icon, Plugin, Receiver, Settings, StringContent, translate
|
from openlp.core.lib import Plugin, Receiver, Settings, StringContent, build_icon, translate
|
||||||
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.core.utils.actions import ActionList
|
||||||
|
@ -1,70 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 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 #
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
import urllib
|
|
||||||
import sys
|
|
||||||
from optparse import OptionParser
|
|
||||||
|
|
||||||
def sendData(options):
|
|
||||||
addr = 'http://%s:%s/send/%s?q=%s' % (options.address, options.port,
|
|
||||||
options.event, options.message)
|
|
||||||
try:
|
|
||||||
urllib.urlopen(addr)
|
|
||||||
print u'Message sent ', addr
|
|
||||||
except:
|
|
||||||
print u'Error thrown ', sys.exc_info()[1]
|
|
||||||
|
|
||||||
def main():
|
|
||||||
usage = "usage: %prog [-a address] [-p port] [-e event] [-m message]"
|
|
||||||
parser = OptionParser(usage=usage)
|
|
||||||
parser.add_option("-p", "--port", default=4316,
|
|
||||||
help="IP Port number %default ")
|
|
||||||
parser.add_option("-a", "--address",
|
|
||||||
help="Recipient address ",
|
|
||||||
default="localhost")
|
|
||||||
parser.add_option("-e", "--event",
|
|
||||||
help="Action to be performed",
|
|
||||||
default="alerts_text")
|
|
||||||
parser.add_option("-m", "--message",
|
|
||||||
help="Message to be passed for the action",
|
|
||||||
default="")
|
|
||||||
|
|
||||||
(options, args) = parser.parse_args()
|
|
||||||
if args:
|
|
||||||
parser.print_help()
|
|
||||||
parser.error("incorrect number of arguments")
|
|
||||||
elif options.address is None:
|
|
||||||
parser.print_help()
|
|
||||||
parser.error("IP address missing")
|
|
||||||
else:
|
|
||||||
sendData(options)
|
|
||||||
|
|
||||||
if __name__ == u'__main__':
|
|
||||||
main()
|
|
@ -53,8 +53,6 @@ This is done easily via the ``-d``, ``-p`` and ``-u`` options::
|
|||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
import urllib2
|
import urllib2
|
||||||
import re
|
|
||||||
from shutil import copy
|
|
||||||
from getpass import getpass
|
from getpass import getpass
|
||||||
import base64
|
import base64
|
||||||
import json
|
import json
|
||||||
@ -62,7 +60,6 @@ import webbrowser
|
|||||||
|
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
from PyQt4 import QtCore
|
from PyQt4 import QtCore
|
||||||
from BeautifulSoup import BeautifulSoup
|
|
||||||
|
|
||||||
SERVER_URL = u'http://www.transifex.net/api/2/project/openlp/'
|
SERVER_URL = u'http://www.transifex.net/api/2/project/openlp/'
|
||||||
IGNORED_PATHS = [u'scripts']
|
IGNORED_PATHS = [u'scripts']
|
||||||
@ -162,7 +159,7 @@ def print_verbose(text):
|
|||||||
"""
|
"""
|
||||||
global verbose_mode, quiet_mode
|
global verbose_mode, quiet_mode
|
||||||
if not quiet_mode and verbose_mode:
|
if not quiet_mode and verbose_mode:
|
||||||
print u' %s' % text
|
print(u' %s' % text)
|
||||||
|
|
||||||
def run(command):
|
def run(command):
|
||||||
"""
|
"""
|
||||||
@ -269,8 +266,7 @@ def prepare_project():
|
|||||||
def update_translations():
|
def update_translations():
|
||||||
print_quiet(u'Update the translation files')
|
print_quiet(u'Update the translation files')
|
||||||
if not os.path.exists(os.path.join(os.path.abspath(u'..'), u'openlp.pro')):
|
if not os.path.exists(os.path.join(os.path.abspath(u'..'), u'openlp.pro')):
|
||||||
print u'You have not generated a project file yet, please run this ' + \
|
print(u'You have not generated a project file yet, please run this script with the -p option.')
|
||||||
u'script with the -p option.'
|
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
os.chdir(os.path.abspath(u'..'))
|
os.chdir(os.path.abspath(u'..'))
|
||||||
@ -280,10 +276,8 @@ def update_translations():
|
|||||||
def generate_binaries():
|
def generate_binaries():
|
||||||
print_quiet(u'Generate the related *.qm files')
|
print_quiet(u'Generate the related *.qm files')
|
||||||
if not os.path.exists(os.path.join(os.path.abspath(u'..'), u'openlp.pro')):
|
if not os.path.exists(os.path.join(os.path.abspath(u'..'), u'openlp.pro')):
|
||||||
print u'You have not generated a project file yet, please run this ' + \
|
print(u'You have not generated a project file yet, please run this script with the -p option. It is also ' +
|
||||||
u'script with the -p option. It is also recommended that you ' + \
|
u'recommended that you this script with the -u option to update the translation files as well.')
|
||||||
u'this script with the -u option to update the translation ' + \
|
|
||||||
u'files as well.'
|
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
os.chdir(os.path.abspath(u'..'))
|
os.chdir(os.path.abspath(u'..'))
|
||||||
@ -383,6 +377,6 @@ def main():
|
|||||||
|
|
||||||
if __name__ == u'__main__':
|
if __name__ == u'__main__':
|
||||||
if os.path.split(os.path.abspath(u'.'))[1] != u'scripts':
|
if os.path.split(os.path.abspath(u'.'))[1] != u'scripts':
|
||||||
print u'You need to run this script from the scripts directory.'
|
print(u'You need to run this script from the scripts directory.')
|
||||||
else:
|
else:
|
||||||
main()
|
main()
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
"""
|
"""
|
||||||
Package to test the openlp.core.ui package.
|
Package to test the openlp.core.ui package.
|
||||||
"""
|
"""
|
||||||
import sys
|
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
|
|
||||||
from mock import MagicMock, patch
|
from mock import MagicMock, patch
|
||||||
|
Loading…
Reference in New Issue
Block a user