forked from openlp/openlp
redundant code
This commit is contained in:
parent
7fb04a956b
commit
8374c2d449
@ -248,9 +248,8 @@ def resize_image(image, width, height, background=QtCore.Qt.black):
|
||||
``height``
|
||||
The new image height.
|
||||
|
||||
``background``
|
||||
``background``
|
||||
The background colour defaults to black.
|
||||
|
||||
"""
|
||||
log.debug(u'resize_image - start')
|
||||
if isinstance(image, QtGui.QImage):
|
||||
|
@ -114,8 +114,8 @@ class Plugin(QtCore.QObject):
|
||||
"""
|
||||
log.info(u'loaded')
|
||||
|
||||
def __init__(self, name, version=None, pluginHelpers=None,
|
||||
mediaItemClass=None, settingsTabClass=None):
|
||||
def __init__(self, name, pluginHelpers=None, mediaItemClass=None,
|
||||
settingsTabClass=None, version=None):
|
||||
"""
|
||||
This is the constructor for the plugin object. This provides an easy
|
||||
way for descendent plugins to populate common data. This method *must*
|
||||
@ -123,7 +123,7 @@ class Plugin(QtCore.QObject):
|
||||
|
||||
class MyPlugin(Plugin):
|
||||
def __init__(self):
|
||||
Plugin.__init__(self, u'MyPlugin', u'0.1')
|
||||
Plugin.__init__(self, u'MyPlugin', version=u'0.1')
|
||||
|
||||
``name``
|
||||
Defaults to *None*. The name of the plugin.
|
||||
@ -145,8 +145,7 @@ class Plugin(QtCore.QObject):
|
||||
self.textStrings = {}
|
||||
self.setPluginTextStrings()
|
||||
self.nameStrings = self.textStrings[StringContent.Name]
|
||||
if version:
|
||||
self.version = version
|
||||
self.version = version if version else u'1.9.4'
|
||||
self.settingsSection = self.name.lower()
|
||||
self.icon = None
|
||||
self.mediaItemClass = mediaItemClass
|
||||
|
@ -40,7 +40,7 @@ class AlertsPlugin(Plugin):
|
||||
log.info(u'Alerts Plugin loaded')
|
||||
|
||||
def __init__(self, plugin_helpers):
|
||||
Plugin.__init__(self, u'Alerts', u'1.9.4', plugin_helpers,
|
||||
Plugin.__init__(self, u'Alerts', plugin_helpers,
|
||||
settingsTabClass=AlertsTab)
|
||||
self.weight = -3
|
||||
self.icon = build_icon(u':/plugins/plugin_alerts.png')
|
||||
|
@ -37,7 +37,7 @@ class BiblePlugin(Plugin):
|
||||
log.info(u'Bible Plugin loaded')
|
||||
|
||||
def __init__(self, plugin_helpers):
|
||||
Plugin.__init__(self, u'Bibles', u'1.9.4', plugin_helpers,
|
||||
Plugin.__init__(self, u'Bibles', plugin_helpers,
|
||||
BibleMediaItem, BiblesTab)
|
||||
self.weight = -9
|
||||
self.icon_path = u':/plugins/plugin_bibles.png'
|
||||
|
@ -47,7 +47,7 @@ class CustomPlugin(Plugin):
|
||||
log.info(u'Custom Plugin loaded')
|
||||
|
||||
def __init__(self, plugin_helpers):
|
||||
Plugin.__init__(self, u'Custom', u'1.9.4', plugin_helpers,
|
||||
Plugin.__init__(self, u'Custom', plugin_helpers,
|
||||
CustomMediaItem, CustomTab)
|
||||
self.weight = -5
|
||||
self.manager = Manager(u'custom', init_schema)
|
||||
|
@ -35,8 +35,7 @@ class ImagePlugin(Plugin):
|
||||
log.info(u'Image Plugin loaded')
|
||||
|
||||
def __init__(self, plugin_helpers):
|
||||
Plugin.__init__(self, u'Images', u'1.9.4', plugin_helpers,
|
||||
ImageMediaItem)
|
||||
Plugin.__init__(self, u'Images', plugin_helpers, ImageMediaItem)
|
||||
self.weight = -7
|
||||
self.icon_path = u':/plugins/plugin_images.png'
|
||||
self.icon = build_icon(self.icon_path)
|
||||
|
@ -38,7 +38,7 @@ class MediaPlugin(Plugin):
|
||||
log.info(u'%s MediaPlugin loaded', __name__)
|
||||
|
||||
def __init__(self, plugin_helpers):
|
||||
Plugin.__init__(self, u'Media', u'1.9.4', plugin_helpers,
|
||||
Plugin.__init__(self, u'Media', plugin_helpers,
|
||||
MediaMediaItem, MediaTab)
|
||||
self.weight = -6
|
||||
self.icon_path = u':/plugins/plugin_media.png'
|
||||
|
@ -51,7 +51,7 @@ class PresentationPlugin(Plugin):
|
||||
"""
|
||||
log.debug(u'Initialised')
|
||||
self.controllers = {}
|
||||
Plugin.__init__(self, u'Presentations', u'1.9.4', plugin_helpers)
|
||||
Plugin.__init__(self, u'Presentations', plugin_helpers)
|
||||
self.weight = -8
|
||||
self.icon_path = u':/plugins/plugin_presentations.png'
|
||||
self.icon = build_icon(self.icon_path)
|
||||
|
@ -38,7 +38,7 @@ class RemotesPlugin(Plugin):
|
||||
"""
|
||||
remotes constructor
|
||||
"""
|
||||
Plugin.__init__(self, u'Remotes', u'1.9.4', plugin_helpers,
|
||||
Plugin.__init__(self, u'Remotes', plugin_helpers,
|
||||
settingsTabClass=RemoteTab)
|
||||
self.icon = build_icon(u':/plugins/plugin_remote.png')
|
||||
self.weight = -1
|
||||
|
@ -53,8 +53,7 @@ class SongsPlugin(Plugin):
|
||||
"""
|
||||
Create and set up the Songs plugin.
|
||||
"""
|
||||
Plugin.__init__(self, u'Songs', u'1.9.4', plugin_helpers,
|
||||
SongMediaItem, SongsTab)
|
||||
Plugin.__init__(self, u'Songs', plugin_helpers, SongMediaItem, SongsTab)
|
||||
self.weight = -10
|
||||
self.manager = Manager(u'songs', init_schema)
|
||||
self.icon_path = u':/plugins/plugin_songs.png'
|
||||
|
@ -42,7 +42,7 @@ class SongUsagePlugin(Plugin):
|
||||
log.info(u'SongUsage Plugin loaded')
|
||||
|
||||
def __init__(self, plugin_helpers):
|
||||
Plugin.__init__(self, u'SongUsage', u'1.9.4', plugin_helpers)
|
||||
Plugin.__init__(self, u'SongUsage', plugin_helpers)
|
||||
self.weight = -4
|
||||
self.icon = build_icon(u':/plugins/plugin_songusage.png')
|
||||
self.manager = None
|
||||
|
Loading…
Reference in New Issue
Block a user