forked from openlp/openlp
Fix some pep issues in the changed files
This commit is contained in:
parent
d5780b9f78
commit
2c5475e8fa
@ -263,7 +263,8 @@ class Plugin(QtCore.QObject, RegistryProperties):
|
||||
else:
|
||||
self.media_item.on_add_click()
|
||||
|
||||
def about(self):
|
||||
@staticmethod
|
||||
def about():
|
||||
"""
|
||||
Show a dialog when the user clicks on the 'About' button in the plugin manager.
|
||||
"""
|
||||
|
@ -74,6 +74,7 @@ class CustomPlugin(Plugin):
|
||||
Called to find out if the custom plugin is currently using a theme.
|
||||
|
||||
Returns count of the times the theme is used.
|
||||
:param theme: Theme to be queried
|
||||
"""
|
||||
return len(self.db_manager.get_all_objects(CustomSlide, CustomSlide.theme_name == theme))
|
||||
|
||||
|
@ -23,9 +23,8 @@
|
||||
from PyQt5 import QtGui
|
||||
|
||||
import logging
|
||||
import os
|
||||
|
||||
from openlp.core.common import Registry, Settings, translate
|
||||
from openlp.core.common import Settings, translate
|
||||
from openlp.core.lib import Plugin, StringContent, ImageSource, build_icon
|
||||
from openlp.core.lib.db import Manager
|
||||
from openlp.plugins.images.lib import ImageMediaItem, ImageTab
|
||||
|
@ -28,7 +28,7 @@ import logging
|
||||
|
||||
from PyQt5 import QtCore
|
||||
|
||||
from openlp.core.common import AppLocation, Settings, translate
|
||||
from openlp.core.common import AppLocation, translate
|
||||
from openlp.core.lib import Plugin, StringContent, build_icon
|
||||
from openlp.plugins.presentations.lib import PresentationController, PresentationMediaItem, PresentationTab
|
||||
|
||||
@ -71,6 +71,7 @@ class PresentationPlugin(Plugin):
|
||||
def create_settings_tab(self, parent):
|
||||
"""
|
||||
Create the settings Tab.
|
||||
:param parent: parent UI Element
|
||||
"""
|
||||
visible_name = self.get_string(StringContent.VisibleName)
|
||||
self.settings_tab = PresentationTab(parent, self.name, visible_name['title'], self.controllers, self.icon_path)
|
||||
@ -112,6 +113,7 @@ class PresentationPlugin(Plugin):
|
||||
def register_controllers(self, controller):
|
||||
"""
|
||||
Register each presentation controller (Impress, PPT etc) and store for later use.
|
||||
:param controller: controller to register
|
||||
"""
|
||||
self.controllers[controller.name] = controller
|
||||
|
||||
|
@ -40,7 +40,7 @@ class MediaPluginTest(TestCase, TestMixin):
|
||||
|
||||
@patch(u'openlp.plugins.media.mediaplugin.Plugin.initialise')
|
||||
@patch(u'openlp.plugins.media.mediaplugin.Settings')
|
||||
def initialise_test(self, MockedSettings, mocked_initialise):
|
||||
def initialise_test(self, mocked_settings, mocked_initialise):
|
||||
"""
|
||||
Test that the initialise() method overwrites the built-in one, but still calls it
|
||||
"""
|
||||
@ -48,7 +48,7 @@ class MediaPluginTest(TestCase, TestMixin):
|
||||
media_plugin = MediaPlugin()
|
||||
mocked_settings = MagicMock()
|
||||
mocked_settings.get_files_from_config.return_value = True # Not the real value, just need something "true-ish"
|
||||
MockedSettings.return_value = mocked_settings
|
||||
mocked_settings.return_value = mocked_settings
|
||||
|
||||
# WHEN: initialise() is called
|
||||
media_plugin.initialise()
|
||||
|
@ -25,6 +25,7 @@ This module contains tests for the Songusage plugin.
|
||||
from unittest import TestCase
|
||||
from openlp.plugins.songusage.songusageplugin import SongUsagePlugin
|
||||
|
||||
|
||||
class TestSongUsage(TestCase):
|
||||
|
||||
def test_about_text(self):
|
||||
|
Loading…
Reference in New Issue
Block a user