From bd99cee8fd694a8020951a4e6b6cf22fb3df0517 Mon Sep 17 00:00:00 2001 From: Philip Ridout Date: Sat, 16 Feb 2019 08:57:11 +0000 Subject: [PATCH] minor changes --- openlp/core/ui/firsttimeform.py | 7 ------- tests/functional/openlp_core/ui/test_firsttimeform.py | 1 - tests/interfaces/openlp_core/ui/test_firsttimeform.py | 1 - 3 files changed, 9 deletions(-) diff --git a/openlp/core/ui/firsttimeform.py b/openlp/core/ui/firsttimeform.py index 499b83675..ef223e8f1 100644 --- a/openlp/core/ui/firsttimeform.py +++ b/openlp/core/ui/firsttimeform.py @@ -173,9 +173,6 @@ class FirstTimeForm(QtWidgets.QWizard, UiFirstTimeWizard, RegistryProperties): try: web_config = get_web_page('{host}{name}'.format(host=self.web, name='download_3.0.json'), headers={'User-Agent': user_agent}) - # web_config = Path( - # 'C:\\Users\\sroom\\Documents\\Phill Ridout\\play_ground\\openlp\\ftw-json\\download_3.0.json' - # ).read_text(encoding='utf-8') # TODO: Remove!!!!! except ConnectionError: QtWidgets.QMessageBox.critical(self, translate('OpenLP.FirstTimeWizard', 'Network Error'), translate('OpenLP.FirstTimeWizard', 'There was a network error attempting ' @@ -192,18 +189,15 @@ class FirstTimeForm(QtWidgets.QWizard, UiFirstTimeWizard, RegistryProperties): config = json.loads(web_config) meta = config['_meta'] self.web = meta['base_url'] - self.songs_url = self.web + meta['songs_dir'] + '/' self.bibles_url = self.web + meta['bibles_dir'] + '/' self.themes_url = self.web + meta['themes_dir'] + '/' - for song in config['songs'].values(): self.application.process_events() item = QtWidgets.QListWidgetItem(song['title'], self.songs_list_widget) item.setData(QtCore.Qt.UserRole, (song['file_name'], song['sha256'])) item.setCheckState(QtCore.Qt.Unchecked) item.setFlags(item.flags() | QtCore.Qt.ItemIsUserCheckable) - for lang in config['bibles'].values(): self.application.process_events() lang_item = QtWidgets.QTreeWidgetItem(self.bibles_tree_widget, [lang['title']]) @@ -215,7 +209,6 @@ class FirstTimeForm(QtWidgets.QWizard, UiFirstTimeWizard, RegistryProperties): item.setFlags(item.flags() | QtCore.Qt.ItemIsUserCheckable) self.bibles_tree_widget.expandAll() self.application.process_events() - for theme in config['themes'].values(): ThemeListWidgetItem(self.themes_url, theme, self, self.themes_list_widget) self.application.process_events() diff --git a/tests/functional/openlp_core/ui/test_firsttimeform.py b/tests/functional/openlp_core/ui/test_firsttimeform.py index bd4717084..220e1fff6 100644 --- a/tests/functional/openlp_core/ui/test_firsttimeform.py +++ b/tests/functional/openlp_core/ui/test_firsttimeform.py @@ -48,7 +48,6 @@ class TestThemeListWidgetItem(TestCase): def setUp(self): self.sample_theme_data = {'file_name': 'BlueBurst.otz', 'sha256': 'sha_256_hash', 'thumbnail': 'BlueBurst.png', 'title': 'Blue Burst'} - download_worker_patcher = patch('openlp.core.ui.firsttimeform.DownloadWorker') self.addCleanup(download_worker_patcher.stop) self.mocked_download_worker = download_worker_patcher.start() diff --git a/tests/interfaces/openlp_core/ui/test_firsttimeform.py b/tests/interfaces/openlp_core/ui/test_firsttimeform.py index 77d82c7ff..febef440e 100644 --- a/tests/interfaces/openlp_core/ui/test_firsttimeform.py +++ b/tests/interfaces/openlp_core/ui/test_firsttimeform.py @@ -36,7 +36,6 @@ class TestThemeListWidgetItem(TestCase, TestMixin): def setUp(self): self.sample_theme_data = {'file_name': 'BlueBurst.otz', 'sha256': 'sha_256_hash', 'thumbnail': 'BlueBurst.png', 'title': 'Blue Burst'} - Registry.create() self.registry = Registry() mocked_app = MagicMock()