forked from openlp/openlp
Fix errors detected by pylint. Among them a fix for traceback when adding an item to the servicemanager.
bzr-revno: 2858
This commit is contained in:
commit
68dc577f77
@ -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)
|
||||
|
@ -239,7 +239,7 @@ class PrintServiceForm(QtWidgets.QDialog, Ui_PrintServiceDialog, RegistryPropert
|
||||
footer_html = footer_html.partition('<br>')[2]
|
||||
if footer_html:
|
||||
footer_html = html.escape(footer_html.replace('<br>', '\n'))
|
||||
self._add_element('div', footer_html.replace('\n', '<br>'), parent=div, classId='itemFooter')
|
||||
self._add_element('div', footer_html.replace('\n', '<br>'), parent=div, class_id='itemFooter')
|
||||
# Add service items' notes.
|
||||
if self.notes_check_box.isChecked():
|
||||
if item.notes:
|
||||
|
@ -352,7 +352,7 @@ class PathEdit(QtWidgets.QWidget):
|
||||
:rtype: None
|
||||
"""
|
||||
if self._path != path:
|
||||
self.path = path
|
||||
self._path = path
|
||||
self.pathChanged.emit(path)
|
||||
|
||||
|
||||
|
@ -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 / '{name}{suffix}'.format(name=name, suffix=self.suffix))
|
||||
|
||||
def get_bibles(self):
|
||||
"""
|
||||
|
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user