forked from openlp/openlp
Further fixes
This commit is contained in:
parent
75c9391d8e
commit
fb20f9243f
@ -28,9 +28,9 @@ from PyQt4 import QtCore, QtGui
|
|||||||
|
|
||||||
class HistoryComboBox(QtGui.QComboBox):
|
class HistoryComboBox(QtGui.QComboBox):
|
||||||
"""
|
"""
|
||||||
The :class:`~openlp.core.common.historycombobox.HistoryComboBox` widget emulates the QLineEdit ``returnPressed`` signal
|
The :class:`~openlp.core.common.historycombobox.HistoryComboBox` widget emulates the QLineEdit ``returnPressed``
|
||||||
for when the :kbd:`Enter` or :kbd:`Return` keys are pressed, and saves anything that is typed into the edit box into
|
signal for when the :kbd:`Enter` or :kbd:`Return` keys are pressed, and saves anything that is typed into the edit
|
||||||
its list.
|
box into its list.
|
||||||
"""
|
"""
|
||||||
returnPressed = QtCore.pyqtSignal()
|
returnPressed = QtCore.pyqtSignal()
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ log = logging.getLogger(__name__)
|
|||||||
__version__ = 1
|
__version__ = 1
|
||||||
|
|
||||||
|
|
||||||
|
# TODO: When removing an upgrade path the ftw-data needs updating to the minimum supported version
|
||||||
def upgrade_1(session, metadata):
|
def upgrade_1(session, metadata):
|
||||||
"""
|
"""
|
||||||
Version 1 upgrade.
|
Version 1 upgrade.
|
||||||
@ -38,6 +39,7 @@ def upgrade_1(session, metadata):
|
|||||||
"""
|
"""
|
||||||
metadata_table = metadata.tables['metadata']
|
metadata_table = metadata.tables['metadata']
|
||||||
# Copy "Version" to "name" ("version" used by upgrade system)
|
# Copy "Version" to "name" ("version" used by upgrade system)
|
||||||
|
try:
|
||||||
session.execute(insert(metadata_table).values(
|
session.execute(insert(metadata_table).values(
|
||||||
key='name',
|
key='name',
|
||||||
value=select(
|
value=select(
|
||||||
@ -46,7 +48,10 @@ def upgrade_1(session, metadata):
|
|||||||
).as_scalar()
|
).as_scalar()
|
||||||
))
|
))
|
||||||
session.execute(delete(metadata_table).where(metadata_table.c.key == 'Version'))
|
session.execute(delete(metadata_table).where(metadata_table.c.key == 'Version'))
|
||||||
|
except:
|
||||||
|
log.exception('Exception when upgrading Version')
|
||||||
# Copy "Copyright" to "copyright"
|
# Copy "Copyright" to "copyright"
|
||||||
|
try:
|
||||||
session.execute(insert(metadata_table).values(
|
session.execute(insert(metadata_table).values(
|
||||||
key='copyright',
|
key='copyright',
|
||||||
value=select(
|
value=select(
|
||||||
@ -55,7 +60,10 @@ def upgrade_1(session, metadata):
|
|||||||
).as_scalar()
|
).as_scalar()
|
||||||
))
|
))
|
||||||
session.execute(delete(metadata_table).where(metadata_table.c.key == 'Copyright'))
|
session.execute(delete(metadata_table).where(metadata_table.c.key == 'Copyright'))
|
||||||
|
except:
|
||||||
|
log.exception('Exception when upgrading Copyright')
|
||||||
# Copy "Permissions" to "permissions"
|
# Copy "Permissions" to "permissions"
|
||||||
|
try:
|
||||||
session.execute(insert(metadata_table).values(
|
session.execute(insert(metadata_table).values(
|
||||||
key='permissions',
|
key='permissions',
|
||||||
value=select(
|
value=select(
|
||||||
@ -64,7 +72,10 @@ def upgrade_1(session, metadata):
|
|||||||
).as_scalar()
|
).as_scalar()
|
||||||
))
|
))
|
||||||
session.execute(delete(metadata_table).where(metadata_table.c.key == 'Permissions'))
|
session.execute(delete(metadata_table).where(metadata_table.c.key == 'Permissions'))
|
||||||
|
except:
|
||||||
|
log.exception('Exception when upgrading Permissions')
|
||||||
# Copy "Bookname language" to "book_name_language"
|
# Copy "Bookname language" to "book_name_language"
|
||||||
|
try:
|
||||||
value_count = session.execute(
|
value_count = session.execute(
|
||||||
select(
|
select(
|
||||||
[func.count(metadata_table.c.value)],
|
[func.count(metadata_table.c.value)],
|
||||||
@ -80,7 +91,10 @@ def upgrade_1(session, metadata):
|
|||||||
).as_scalar()
|
).as_scalar()
|
||||||
))
|
))
|
||||||
session.execute(delete(metadata_table).where(metadata_table.c.key == 'Bookname language'))
|
session.execute(delete(metadata_table).where(metadata_table.c.key == 'Bookname language'))
|
||||||
|
except:
|
||||||
|
log.exception('Exception when upgrading Bookname language')
|
||||||
# Copy "download source" to "download_source"
|
# Copy "download source" to "download_source"
|
||||||
|
try:
|
||||||
value_count = session.execute(
|
value_count = session.execute(
|
||||||
select(
|
select(
|
||||||
[func.count(metadata_table.c.value)],
|
[func.count(metadata_table.c.value)],
|
||||||
@ -97,7 +111,10 @@ def upgrade_1(session, metadata):
|
|||||||
).as_scalar()
|
).as_scalar()
|
||||||
))
|
))
|
||||||
session.execute(delete(metadata_table).where(metadata_table.c.key == 'download source'))
|
session.execute(delete(metadata_table).where(metadata_table.c.key == 'download source'))
|
||||||
|
except:
|
||||||
|
log.exception('Exception when upgrading download source')
|
||||||
# Copy "download name" to "download_name"
|
# Copy "download name" to "download_name"
|
||||||
|
try:
|
||||||
value_count = session.execute(
|
value_count = session.execute(
|
||||||
select(
|
select(
|
||||||
[func.count(metadata_table.c.value)],
|
[func.count(metadata_table.c.value)],
|
||||||
@ -114,7 +131,10 @@ def upgrade_1(session, metadata):
|
|||||||
).as_scalar()
|
).as_scalar()
|
||||||
))
|
))
|
||||||
session.execute(delete(metadata_table).where(metadata_table.c.key == 'download name'))
|
session.execute(delete(metadata_table).where(metadata_table.c.key == 'download name'))
|
||||||
|
except:
|
||||||
|
log.exception('Exception when upgrading download name')
|
||||||
# Copy "proxy server" to "proxy_server"
|
# Copy "proxy server" to "proxy_server"
|
||||||
|
try:
|
||||||
value_count = session.execute(
|
value_count = session.execute(
|
||||||
select(
|
select(
|
||||||
[func.count(metadata_table.c.value)],
|
[func.count(metadata_table.c.value)],
|
||||||
@ -131,7 +151,10 @@ def upgrade_1(session, metadata):
|
|||||||
).as_scalar()
|
).as_scalar()
|
||||||
))
|
))
|
||||||
session.execute(delete(metadata_table).where(metadata_table.c.key == 'proxy server'))
|
session.execute(delete(metadata_table).where(metadata_table.c.key == 'proxy server'))
|
||||||
|
except:
|
||||||
|
log.exception('Exception when upgrading proxy server')
|
||||||
# Copy "proxy username" to "proxy_username"
|
# Copy "proxy username" to "proxy_username"
|
||||||
|
try:
|
||||||
value_count = session.execute(
|
value_count = session.execute(
|
||||||
select(
|
select(
|
||||||
[func.count(metadata_table.c.value)],
|
[func.count(metadata_table.c.value)],
|
||||||
@ -148,7 +171,10 @@ def upgrade_1(session, metadata):
|
|||||||
).as_scalar()
|
).as_scalar()
|
||||||
))
|
))
|
||||||
session.execute(delete(metadata_table).where(metadata_table.c.key == 'proxy username'))
|
session.execute(delete(metadata_table).where(metadata_table.c.key == 'proxy username'))
|
||||||
|
except:
|
||||||
|
log.exception('Exception when upgrading proxy username')
|
||||||
# Copy "proxy password" to "proxy_password"
|
# Copy "proxy password" to "proxy_password"
|
||||||
|
try:
|
||||||
value_count = session.execute(
|
value_count = session.execute(
|
||||||
select(
|
select(
|
||||||
[func.count(metadata_table.c.value)],
|
[func.count(metadata_table.c.value)],
|
||||||
@ -165,5 +191,10 @@ def upgrade_1(session, metadata):
|
|||||||
).as_scalar()
|
).as_scalar()
|
||||||
))
|
))
|
||||||
session.execute(delete(metadata_table).where(metadata_table.c.key == 'proxy password'))
|
session.execute(delete(metadata_table).where(metadata_table.c.key == 'proxy password'))
|
||||||
|
except:
|
||||||
|
log.exception('Exception when upgrading proxy password')
|
||||||
|
try:
|
||||||
session.execute(delete(metadata_table).where(metadata_table.c.key == 'dbversion'))
|
session.execute(delete(metadata_table).where(metadata_table.c.key == 'dbversion'))
|
||||||
|
except:
|
||||||
|
log.exception('Exception when deleting dbversion')
|
||||||
session.commit()
|
session.commit()
|
||||||
|
@ -35,6 +35,7 @@ log = logging.getLogger(__name__)
|
|||||||
__version__ = 4
|
__version__ = 4
|
||||||
|
|
||||||
|
|
||||||
|
# TODO: When removing an upgrade path the ftw-data needs updating to the minimum supported version
|
||||||
def upgrade_1(session, metadata):
|
def upgrade_1(session, metadata):
|
||||||
"""
|
"""
|
||||||
Version 1 upgrade.
|
Version 1 upgrade.
|
||||||
|
Loading…
Reference in New Issue
Block a user