Revert songs.upgrade, move pjlink_list from class to __init__

This commit is contained in:
Ken Roberts 2017-06-09 22:57:00 -07:00
parent 79ad031272
commit b0af7fdd2e
2 changed files with 6 additions and 17 deletions

View File

@ -279,10 +279,6 @@ class ProjectorManager(OpenLPMixin, RegistryMixin, QtWidgets.QWidget, UiProjecto
"""
Manage the projectors.
"""
projector_list = []
pjlink_udp = PJLinkUDP()
pjlink_udp.projector_list = projector_list
def __init__(self, parent=None, projectordb=None):
"""
Basic initialization.
@ -294,7 +290,9 @@ class ProjectorManager(OpenLPMixin, RegistryMixin, QtWidgets.QWidget, UiProjecto
super().__init__(parent)
self.settings_section = 'projector'
self.projectordb = projectordb
self.projector_list = self.__class__.projector_list
self.projector_list = []
self.pjlink_udp = PJLinkUDP()
self.pjlink_udp.projector_list = self.projector_list
self.source_select_form = None
def bootstrap_initialise(self):

View File

@ -32,7 +32,7 @@ from openlp.core.common.db import drop_columns
from openlp.core.lib.db import get_upgrade_op
log = logging.getLogger(__name__)
__version__ = 7
__version__ = 6
# TODO: When removing an upgrade path the ftw-data needs updating to the minimum supported version
@ -120,9 +120,10 @@ def upgrade_6(session, metadata):
"""
Version 6 upgrade
This version corrects the errors in upgrade 4
This version corrects the errors in upgrades 4 and 5
"""
op = get_upgrade_op(session)
metadata.reflect()
# Move upgrade 4 to here and correct it (authors_songs table, not songs table)
authors_songs = Table('authors_songs', metadata, autoload=True)
if 'author_type' not in [col.name for col in authors_songs.c.values()]:
@ -138,17 +139,7 @@ def upgrade_6(session, metadata):
op.execute('INSERT INTO authors_songs_tmp SELECT author_id, song_id, "" FROM authors_songs')
op.drop_table('authors_songs')
op.rename_table('authors_songs_tmp', 'authors_songs')
def upgrade_7(session, metadata):
"""
Version 7 upgrade
Corrects table error in upgrade 5
"""
# Move upgrade 5 here to correct it
op = get_upgrade_op(session)
metadata.reflect()
if 'songs_songbooks' not in [t.name for t in metadata.tables.values()]:
# Create the mapping table (songs <-> songbooks)
op.create_table(