From 41d876be5250d80b3ebaac23905e720c7874dd16 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Fri, 12 Apr 2019 21:16:00 +0200 Subject: [PATCH 1/2] Fix errors detected by pylint. --- openlp/core/lib/mediamanageritem.py | 2 +- openlp/core/ui/printserviceform.py | 2 +- openlp/core/widgets/edits.py | 2 +- openlp/plugins/bibles/lib/manager.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 53d26f5ed..17aa451ba 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -595,7 +595,7 @@ class MediaManagerItem(QtWidgets.QWidget, RegistryProperties): :param remote: Triggered from remote :param position: Position to place item """ - service_item = self.build_service_item(item, True, remote=remote, context=ServiceItemContext.Service) + service_item = self.build_service_item(item, remote=remote, context=ServiceItemContext.Service) if service_item: service_item.from_plugin = False self.service_manager.add_service_item(service_item, replace=replace, position=position) diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 68186c2ff..a961be7da 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -239,7 +239,7 @@ class PrintServiceForm(QtWidgets.QDialog, Ui_PrintServiceDialog, RegistryPropert footer_html = footer_html.partition('
')[2] if footer_html: footer_html = html.escape(footer_html.replace('
', '\n')) - self._add_element('div', footer_html.replace('\n', '
'), parent=div, classId='itemFooter') + self._add_element('div', footer_html.replace('\n', '
'), parent=div, class_id='itemFooter') # Add service items' notes. if self.notes_check_box.isChecked(): if item.notes: diff --git a/openlp/core/widgets/edits.py b/openlp/core/widgets/edits.py index b80c61ee6..a90aa2cd0 100644 --- a/openlp/core/widgets/edits.py +++ b/openlp/core/widgets/edits.py @@ -352,7 +352,7 @@ class PathEdit(QtWidgets.QWidget): :rtype: None """ if self._path != path: - self.path = path + self._path = path self.pathChanged.emit(path) diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index d638512b2..e7809f498 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -187,7 +187,7 @@ class BibleManager(LogMixin, RegistryProperties): bible = self.db_cache[name] bible.session.close_all() bible.session = None - return delete_file(bible.path, bible.file_path) + return delete_file(bible.path) def get_bibles(self): """ From f669b8cd7eb12ee42c452e49e27903777b601ac6 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Sat, 13 Apr 2019 10:24:15 +0200 Subject: [PATCH 2/2] Followup fix... --- openlp/plugins/bibles/lib/manager.py | 2 +- tests/functional/openlp_plugins/bibles/test_manager.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index e7809f498..e40e3e1de 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -187,7 +187,7 @@ class BibleManager(LogMixin, RegistryProperties): bible = self.db_cache[name] bible.session.close_all() bible.session = None - return delete_file(bible.path) + return delete_file(bible.path / '{name}{suffix}'.format(name=name, suffix=self.suffix)) def get_bibles(self): """ diff --git a/tests/functional/openlp_plugins/bibles/test_manager.py b/tests/functional/openlp_plugins/bibles/test_manager.py index 39a693446..4a0031b52 100644 --- a/tests/functional/openlp_plugins/bibles/test_manager.py +++ b/tests/functional/openlp_plugins/bibles/test_manager.py @@ -67,4 +67,4 @@ class TestManager(TestCase): assert result is True mocked_close_all.assert_called_once_with() assert mocked_bible.session is None - mocked_delete_file.assert_called_once_with(Path('bibles'), 'KJV.sqlite') + mocked_delete_file.assert_called_once_with(Path('bibles') / 'KJV.sqlite')