From b0af7fdd2ea4fbf76a2010bacddbcb4fc3fd4730 Mon Sep 17 00:00:00 2001 From: Ken Roberts Date: Fri, 9 Jun 2017 22:57:00 -0700 Subject: [PATCH] Revert songs.upgrade, move pjlink_list from class to __init__ --- openlp/core/ui/projector/manager.py | 8 +++----- openlp/plugins/songs/lib/upgrade.py | 15 +++------------ 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/openlp/core/ui/projector/manager.py b/openlp/core/ui/projector/manager.py index d14da30e4..fdaf0c577 100644 --- a/openlp/core/ui/projector/manager.py +++ b/openlp/core/ui/projector/manager.py @@ -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): diff --git a/openlp/plugins/songs/lib/upgrade.py b/openlp/plugins/songs/lib/upgrade.py index b14e98321..5b55d7985 100644 --- a/openlp/plugins/songs/lib/upgrade.py +++ b/openlp/plugins/songs/lib/upgrade.py @@ -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(