← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~googol-hush/openlp/trivial into lp:openlp

 

Andreas Preikschat has proposed merging lp:~googol-hush/openlp/trivial into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~googol-hush/openlp/trivial/+merge/52923

Hello

- Moved the version to the Plugin class. If a plugin does not provide a "version" the default will be used.
- clean ups
-- 
https://code.launchpad.net/~googol-hush/openlp/trivial/+merge/52923
Your team OpenLP Core is requested to review the proposed merge of lp:~googol-hush/openlp/trivial into lp:openlp.
=== modified file 'openlp/core/lib/__init__.py'
--- openlp/core/lib/__init__.py	2011-02-25 17:05:01 +0000
+++ openlp/core/lib/__init__.py	2011-03-10 21:01:11 +0000
@@ -248,9 +248,8 @@
     ``height``
         The new image height.
 
-     ``background``
+    ``background``
         The background colour defaults to black.
-
     """
     log.debug(u'resize_image - start')
     if isinstance(image, QtGui.QImage):

=== modified file 'openlp/core/lib/plugin.py'
--- openlp/core/lib/plugin.py	2011-02-24 05:47:38 +0000
+++ openlp/core/lib/plugin.py	2011-03-10 21:01:11 +0000
@@ -114,8 +114,8 @@
     """
     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 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 @@
         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

=== modified file 'openlp/core/ui/aboutdialog.py'
--- openlp/core/ui/aboutdialog.py	2011-03-05 08:44:13 +0000
+++ openlp/core/ui/aboutdialog.py	2011-03-10 21:01:11 +0000
@@ -226,7 +226,7 @@
             'Portions copyright \xa9 2004-2011 '
             'Tim Bentley, Jonathan Corwin, Michael Gorven, Scott Guerrieri,\n'
             'Meinert Jordan, Andreas Preikschat, Christian Richter, Philip\n'
-            'Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, Carstenn'
+            'Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, Carsten\n'
             'Tinggaard, Frode Woldsund')
         licence = translate('OpenLP.AboutForm',
             'This program is free software; you can redistribute it and/or '

=== modified file 'openlp/plugins/alerts/alertsplugin.py'
--- openlp/plugins/alerts/alertsplugin.py	2011-02-24 05:47:38 +0000
+++ openlp/plugins/alerts/alertsplugin.py	2011-03-10 21:01:11 +0000
@@ -40,7 +40,7 @@
     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')

=== modified file 'openlp/plugins/bibles/bibleplugin.py'
--- openlp/plugins/bibles/bibleplugin.py	2011-02-24 05:47:38 +0000
+++ openlp/plugins/bibles/bibleplugin.py	2011-03-10 21:01:11 +0000
@@ -37,7 +37,7 @@
     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'

=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py	2011-03-05 12:03:37 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py	2011-03-10 21:01:11 +0000
@@ -449,8 +449,7 @@
         if restore:
             old_text = unicode(combo.currentText())
         combo.clear()
-        for i in range(range_from, range_to + 1):
-            combo.addItem(unicode(i))
+        combo.addItems([unicode(i) for i in range(range_from, range_to + 1)])
         if restore and combo.findText(old_text) != -1:
             combo.setCurrentIndex(combo.findText(old_text))
 
@@ -704,8 +703,7 @@
             service_item.theme = None
         else:
             service_item.theme = self.settings.bible_theme
-        for slide in raw_slides:
-            service_item.add_from_text(slide[:30], slide)
+        [service_item.add_from_text(slide[:30], slide) for slide in raw_slides]
         return True
 
     def formatTitle(self, start_item, old_item):
@@ -744,8 +742,7 @@
         else:
             verse_range = start_chapter + verse_separator + start_verse + \
                 range_separator + old_chapter + verse_separator + old_verse
-        title = u'%s %s (%s)' % (start_book, verse_range, bibles)
-        return title
+        return u'%s %s (%s)' % (start_book, verse_range, bibles)
 
     def checkTitle(self, item, old_item):
         """

=== modified file 'openlp/plugins/custom/customplugin.py'
--- openlp/plugins/custom/customplugin.py	2011-02-24 05:47:38 +0000
+++ openlp/plugins/custom/customplugin.py	2011-03-10 21:01:11 +0000
@@ -47,7 +47,7 @@
     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)

=== modified file 'openlp/plugins/images/imageplugin.py'
--- openlp/plugins/images/imageplugin.py	2011-02-24 05:47:38 +0000
+++ openlp/plugins/images/imageplugin.py	2011-03-10 21:01:11 +0000
@@ -35,8 +35,7 @@
     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)

=== modified file 'openlp/plugins/media/mediaplugin.py'
--- openlp/plugins/media/mediaplugin.py	2011-02-25 17:05:01 +0000
+++ openlp/plugins/media/mediaplugin.py	2011-03-10 21:01:11 +0000
@@ -38,7 +38,7 @@
     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'

=== modified file 'openlp/plugins/presentations/presentationplugin.py'
--- openlp/plugins/presentations/presentationplugin.py	2011-02-24 05:47:38 +0000
+++ openlp/plugins/presentations/presentationplugin.py	2011-03-10 21:01:11 +0000
@@ -51,7 +51,7 @@
         """
         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)

=== modified file 'openlp/plugins/remotes/remoteplugin.py'
--- openlp/plugins/remotes/remoteplugin.py	2011-02-24 05:47:38 +0000
+++ openlp/plugins/remotes/remoteplugin.py	2011-03-10 21:01:11 +0000
@@ -38,7 +38,7 @@
         """
         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

=== modified file 'openlp/plugins/songs/songsplugin.py'
--- openlp/plugins/songs/songsplugin.py	2011-03-06 16:28:26 +0000
+++ openlp/plugins/songs/songsplugin.py	2011-03-10 21:01:11 +0000
@@ -53,8 +53,7 @@
         """
         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'

=== modified file 'openlp/plugins/songusage/songusageplugin.py'
--- openlp/plugins/songusage/songusageplugin.py	2011-02-24 05:47:38 +0000
+++ openlp/plugins/songusage/songusageplugin.py	2011-03-10 21:01:11 +0000
@@ -42,7 +42,7 @@
     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


Follow ups