← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~meths/openlp/trivialfixes into lp:openlp

 

Jon Tibble has proposed merging lp:~meths/openlp/trivialfixes into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)


Lots of cleanups
-- 
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/40002
Your team OpenLP Core is requested to review the proposed merge of lp:~meths/openlp/trivialfixes into lp:openlp.
=== modified file 'openlp/core/lib/pluginmanager.py'
--- openlp/core/lib/pluginmanager.py	2010-09-27 18:15:55 +0000
+++ openlp/core/lib/pluginmanager.py	2010-11-03 18:41:37 +0000
@@ -156,9 +156,11 @@
                 if plugin.settings_tab:
                     log.debug(u'Inserting settings tab item from %s' %
                         visible_title[u'title'])
-                    settingsform.addTab(visible_title[u'title'], plugin.settings_tab)
+                    settingsform.addTab(visible_title[u'title'],
+                        plugin.settings_tab)
                 else:
-                    log.debug(u'No tab settings in %s' % visible_title[u'title'])
+                    log.debug(
+                        u'No tab settings in %s' % visible_title[u'title'])
 
     def hook_import_menu(self, import_menu):
         """

=== modified file 'openlp/core/lib/renderer.py'
--- openlp/core/lib/renderer.py	2010-11-01 19:33:33 +0000
+++ openlp/core/lib/renderer.py	2010-11-03 18:41:37 +0000
@@ -29,11 +29,10 @@
 """
 import logging
 
-from PyQt4 import QtGui, QtCore, QtWebKit
-
-from openlp.core.lib import resize_image, expand_tags, \
-    build_lyrics_format_css, build_lyrics_outline_css, image_to_byte
-
+from PyQt4 import QtWebKit
+
+from openlp.core.lib import expand_tags, build_lyrics_format_css, \
+    build_lyrics_outline_css
 
 log = logging.getLogger(__name__)
 

=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py	2010-10-24 06:26:07 +0000
+++ openlp/core/lib/serviceitem.py	2010-11-03 18:41:37 +0000
@@ -32,9 +32,7 @@
 import os
 import uuid
 
-from PyQt4 import QtGui
-
-from openlp.core.lib import build_icon, resize_image, clean_tags, expand_tags
+from openlp.core.lib import build_icon, clean_tags, expand_tags
 
 log = logging.getLogger(__name__)
 

=== modified file 'openlp/core/lib/theme.py'
--- openlp/core/lib/theme.py	2010-10-29 06:44:38 +0000
+++ openlp/core/lib/theme.py	2010-11-03 18:41:37 +0000
@@ -386,10 +386,11 @@
                 for e in element.attrib.iteritems():
                     if master == u'font_' and e[0] == u'type':
                         master += e[1] + u'_'
-                    elif master == u'display_' and (element.tag == u'shadow' \
-                        or element.tag == u'outline' ):
+                    elif master == u'display_' and (element.tag == u'shadow'
+                        or element.tag == u'outline'):
                         self._create_attr(master, element.tag, element.text)
-                        self._create_attr(master, element.tag + u'_'+ e[0], e[1])
+                        self._create_attr(master, element.tag + u'_'+ e[0],
+                            e[1])
                     else:
                         field = master + e[0]
                         self._create_attr(master, e[0], e[1])

=== modified file 'openlp/core/ui/advancedtab.py'
--- openlp/core/ui/advancedtab.py	2010-10-08 19:32:07 +0000
+++ openlp/core/ui/advancedtab.py	2010-11-03 18:41:37 +0000
@@ -83,7 +83,8 @@
         self.uiLayout.addWidget(self.doubleClickLiveCheckBox)
         self.leftLayout.addWidget(self.uiGroupBox)
         self.expandServiceItemCheckBox = QtGui.QCheckBox(self.uiGroupBox)
-        self.expandServiceItemCheckBox.setObjectName(u'expandServiceItemCheckBox')
+        self.expandServiceItemCheckBox.setObjectName(
+            u'expandServiceItemCheckBox')
         self.uiLayout.addWidget(self.expandServiceItemCheckBox)
 #        self.sharedDirGroupBox = QtGui.QGroupBox(self.leftWidget)
 #        self.sharedDirGroupBox.setObjectName(u'sharedDirGroupBox')

=== modified file 'openlp/core/ui/filerenamedialog.py'
--- openlp/core/ui/filerenamedialog.py	2010-09-26 14:01:27 +0000
+++ openlp/core/ui/filerenamedialog.py	2010-11-03 18:41:37 +0000
@@ -34,7 +34,8 @@
         FileRenameDialog.resize(400, 87)
         self.buttonBox = QtGui.QDialogButtonBox(FileRenameDialog)
         self.buttonBox.setGeometry(QtCore.QRect(210, 50, 171, 25))
-        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
+        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel |
+            QtGui.QDialogButtonBox.Ok)
         self.buttonBox.setObjectName("buttonBox")
         self.widget = QtGui.QWidget(FileRenameDialog)
         self.widget.setGeometry(QtCore.QRect(10, 10, 381, 35))

=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py	2010-10-24 06:26:07 +0000
+++ openlp/core/ui/maindisplay.py	2010-11-03 18:41:37 +0000
@@ -30,8 +30,7 @@
 from PyQt4 import QtCore, QtGui, QtWebKit
 from PyQt4.phonon import Phonon
 
-from openlp.core.lib import Receiver, resize_image, build_html, ServiceItem, \
-    image_to_byte
+from openlp.core.lib import Receiver, build_html, ServiceItem, image_to_byte
 from openlp.core.ui import HideMode
 
 log = logging.getLogger(__name__)

=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py	2010-10-30 10:17:25 +0000
+++ openlp/core/ui/mainwindow.py	2010-11-03 18:41:37 +0000
@@ -270,7 +270,8 @@
         self.SettingsPluginListItem.setIcon(
             build_icon(u':/system/settings_plugin_list.png'))
         self.SettingsPluginListItem.setObjectName(u'SettingsPluginListItem')
-        MainWindow.actionList.add_action(self.SettingsPluginListItem, u'Settings')
+        MainWindow.actionList.add_action(self.SettingsPluginListItem,
+            u'Settings')
         #i18n Language Items
         self.AutoLanguageItem = QtGui.QAction(MainWindow)
         self.AutoLanguageItem.setObjectName(u'AutoLanguageItem')
@@ -296,7 +297,8 @@
         self.SettingsConfigureItem.setIcon(
             build_icon(u':/system/system_settings.png'))
         self.SettingsConfigureItem.setObjectName(u'SettingsConfigureItem')
-        MainWindow.actionList.add_action(self.SettingsShortcutsItem, u'Settings')
+        MainWindow.actionList.add_action(self.SettingsShortcutsItem,
+            u'Settings')
         self.HelpDocumentationItem = QtGui.QAction(MainWindow)
         self.HelpDocumentationItem.setIcon(
             build_icon(u':/system/system_help_contents.png'))

=== modified file 'openlp/core/ui/pluginform.py'
--- openlp/core/ui/pluginform.py	2010-09-27 18:15:55 +0000
+++ openlp/core/ui/pluginform.py	2010-11-03 18:41:37 +0000
@@ -107,7 +107,8 @@
         if self.pluginListWidget.currentItem() is None:
             self._clearDetails()
             return
-        plugin_name_plural = self.pluginListWidget.currentItem().text().split(u' ')[0]
+        plugin_name_plural = \
+            self.pluginListWidget.currentItem().text().split(u' ')[0]
         self.activePlugin = None
         for plugin in self.parent.plugin_manager.plugins:
             name_string = plugin.getString(StringContent.Name)

=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py	2010-10-29 14:25:20 +0000
+++ openlp/core/ui/servicemanager.py	2010-11-03 18:41:37 +0000
@@ -306,7 +306,7 @@
         self.editAction.setVisible(False)
         self.maintainAction.setVisible(False)
         self.notesAction.setVisible(False)
-        if serviceItem[u'service_item'].is_capable(ItemCapabilities.AllowsEdit) \
+        if serviceItem[u'service_item'].is_capable(ItemCapabilities.AllowsEdit)\
             and hasattr(serviceItem[u'service_item'], u'editId'):
             self.editAction.setVisible(True)
         if serviceItem[u'service_item']\
@@ -441,7 +441,8 @@
             if setSelected:
                 setSelected = False
                 serviceIterator.value().setSelected(True)
-            elif serviceIterator.value() and serviceIterator.value().isSelected():
+            elif serviceIterator.value() and \
+                serviceIterator.value().isSelected():
                 serviceIterator.value().setSelected(False)
                 setSelected = True
             serviceIterator += 1
@@ -761,7 +762,8 @@
                         serviceitem.set_from_service(item, self.servicePath)
                         self.validateItem(serviceitem)
                         self.addServiceItem(serviceitem)
-                        if serviceitem.is_capable(ItemCapabilities.OnLoadUpdate):
+                        if serviceitem.is_capable(
+                            ItemCapabilities.OnLoadUpdate):
                             Receiver.send_message(u'%s_service_load' %
                                 serviceitem.name.lower(), serviceitem)
                     try:

=== modified file 'openlp/core/ui/shortcutlistform.py'
--- openlp/core/ui/shortcutlistform.py	2010-10-28 06:36:18 +0000
+++ openlp/core/ui/shortcutlistform.py	2010-11-03 18:41:37 +0000
@@ -69,7 +69,7 @@
         if event.modifiers() & Qt.AltModifier == Qt.AltModifier:
             key_string = u'Alt+' + key_string
         if event.modifiers() & Qt.ShiftModifier == Qt.ShiftModifier:
-            key_string = u'Shift+' + key_string;
+            key_string = u'Shift+' + key_string
         key_sequence = QtGui.QKeySequence(key_string)
         existing_key = QtGui.QKeySequence("Ctrl+Shift+F8")
         if key_sequence == existing_key:

=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py	2010-11-03 17:33:08 +0000
+++ openlp/core/ui/slidecontroller.py	2010-11-03 18:41:37 +0000
@@ -26,7 +26,6 @@
 
 import logging
 import os
-import time
 
 from PyQt4 import QtCore, QtGui
 from PyQt4.phonon import Phonon
@@ -796,7 +795,8 @@
         if row > -1 and row < self.PreviewListWidget.rowCount():
             if self.serviceItem.is_command():
                 if self.isLive:
-                    Receiver.send_message(u'%s_slide' % self.serviceItem.name.lower(),
+                    Receiver.send_message(
+                        u'%s_slide' % self.serviceItem.name.lower(),
                         [self.serviceItem, self.isLive, row])
                 self.updatePreview()
             else:

=== modified file 'openlp/core/utils/actions.py'
--- openlp/core/utils/actions.py	2010-10-28 06:36:18 +0000
+++ openlp/core/utils/actions.py	2010-11-03 18:41:37 +0000
@@ -79,7 +79,7 @@
         """
         return self.__next__()
 
-    def has_key(key):
+    def has_key(self, key):
         for weight, action in self.actions:
             if action.text() == key:
                 return True
@@ -144,7 +144,7 @@
                 return True
         return False
 
-    def append(self, name, actions=[]):
+    def append(self, name, actions=None):
         weight = 0
         if len(self.categories) > 0:
             weight = self.categories[-1].weight + 1
@@ -153,7 +153,7 @@
         else:
             self.add(name, weight)
 
-    def add(self, name, weight=0, actions=[]):
+    def add(self, name, weight=0, actions=None):
         category = ActionCategory(name, weight)
         if actions:
             for action in actions:

=== modified file 'openlp/plugins/alerts/alertsplugin.py'
--- openlp/plugins/alerts/alertsplugin.py	2010-10-27 15:30:30 +0000
+++ openlp/plugins/alerts/alertsplugin.py	2010-11-03 18:41:37 +0000
@@ -85,7 +85,11 @@
         self.liveController.alertTab = self.alertsTab
 
     def finalise(self):
+        """
+        Tidy up on exit
+        """
         log.info(u'Alerts Finalising')
+        self.manager.finalise()
         Plugin.finalise(self)
         self.toolsAlertItem.setVisible(False)
 
@@ -117,11 +121,3 @@
         self.textStrings[StringContent.VisibleName] = {
             u'title': translate('AlertsPlugin', 'Alerts')
         }
-
-    def finalise(self):
-        """
-        Time to tidy up on exit
-        """
-        log.info(u'Alerts Finalising')
-        self.manager.finalise()
-        Plugin.finalise(self)

=== modified file 'openlp/plugins/bibles/bibleplugin.py'
--- openlp/plugins/bibles/bibleplugin.py	2010-10-27 15:30:30 +0000
+++ openlp/plugins/bibles/bibleplugin.py	2010-11-03 18:41:37 +0000
@@ -52,7 +52,11 @@
         self.exportBibleItem.setVisible(True)
 
     def finalise(self):
+        """
+        Tidy up on exit
+        """
         log.info(u'Plugin Finalise')
+        self.manager.finalise()
         Plugin.finalise(self)
         self.importBibleItem.setVisible(False)
         self.exportBibleItem.setVisible(False)
@@ -172,11 +176,3 @@
             u'tooltip': translate('BiblesPlugin',
                 'Add the selected Bible to the service')
         }
-
-    def finalise(self):
-        """
-        Time to tidy up on exit
-        """
-        log.info(u'Bible Finalising')
-        self.manager.finalise()
-        Plugin.finalise(self)

=== modified file 'openlp/plugins/presentations/presentationplugin.py'
--- openlp/plugins/presentations/presentationplugin.py	2010-10-05 16:09:48 +0000
+++ openlp/plugins/presentations/presentationplugin.py	2010-11-03 18:41:37 +0000
@@ -61,7 +61,8 @@
         Create the settings Tab
         """
         visible_name = self.getString(StringContent.VisibleName)
-        return PresentationTab(self.name, visible_name[u'title'], self.controllers)
+        return PresentationTab(self.name, visible_name[u'title'],
+            self.controllers)
 
     def initialise(self):
         """
@@ -188,4 +189,4 @@
             u'title': translate('PresentationPlugin', 'Service'),
             u'tooltip': translate('PresentationPlugin', 
                 'Add the selected Presentation to the service')
-        }
\ No newline at end of file
+        }

=== modified file 'openlp/plugins/songs/lib/cclifileimport.py'
--- openlp/plugins/songs/lib/cclifileimport.py	2010-10-10 21:13:10 +0000
+++ openlp/plugins/songs/lib/cclifileimport.py	2010-11-03 18:41:37 +0000
@@ -203,9 +203,9 @@
 
         SongSelect .txt file format::
 
-            Song Title                          # Contains the song title
+            Song Title                  # Contains the song title
             <Empty line>
-            Verse type and number               # e.g. Verse 1, Chorus 1
+            Verse type and number       # e.g. Verse 1, Chorus 1
             Verse lyrics
             <Empty line>
             <Empty line>
@@ -213,12 +213,16 @@
             Verse lyrics
             <Empty line>
             <Empty line>
-            Song CCLI number                    # e.g. CCLI Number (e.g.CCLI-Liednummer: 2672885)
-            Song copyright                      # e.g. © 1999 Integrity's Hosanna! Music | LenSongs Publishing
-            Song authors                        # e.g. Lenny LeBlanc | Paul Baloche
-            Licencing info                      # e.g. For use solely with the SongSelect Terms of Use.
+            Song CCLI number
+                # e.g. CCLI Number (e.g.CCLI-Liednummer: 2672885)
+            Song copyright
+                # e.g. © 1999 Integrity's Hosanna! Music | LenSongs Publishing
+            Song authors                # e.g. Lenny LeBlanc | Paul Baloche
+            Licencing info
+                # e.g. For use solely with the SongSelect Terms of Use.
             All rights Reserved.  www.ccli.com
-            CCLI Licence number of user         # e.g. CCL-Liedlizenznummer: 14 / CCLI License No. 14
+            CCLI Licence number of user
+                # e.g. CCL-Liedlizenznummer: 14 / CCLI License No. 14
 
         """
         log.debug(u'TXT file text: %s', textList)

=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py	2010-10-29 14:25:20 +0000
+++ openlp/plugins/songs/lib/mediaitem.py	2010-11-03 18:41:37 +0000
@@ -389,7 +389,8 @@
         service_item.audit = [
             song.title, author_audit, song.copyright, unicode(song.ccli_number)
         ]
-        service_item.data_string = {u'title':song.search_title,  u'authors':author_list}
+        service_item.data_string = {u'title':song.search_title,
+            u'authors':author_list}
         return True
 
     def serviceLoad(self, item):
@@ -409,7 +410,7 @@
                     count = 0
                     for author in song.authors:
                         if author.display_name in author_list:
-                           count += 1
+                            count += 1
                     if count == len(author_list):
                         editId = song.id
                         uuid = item._uuid

=== modified file 'openlp/plugins/songs/lib/olp1import.py'
--- openlp/plugins/songs/lib/olp1import.py	2010-09-19 08:47:00 +0000
+++ openlp/plugins/songs/lib/olp1import.py	2010-11-03 18:41:37 +0000
@@ -74,7 +74,8 @@
             decoded = unicode(raw, codec)
             self.last_encoding = codec
         except UnicodeDecodeError:
-            log.exception(u'Error in detecting openlp.org 1.x database encoding.')
+            log.exception(
+                u'Error in detecting openlp.org 1.x database encoding.')
             try:
                 decoded = unicode(raw, self.last_encoding)
             except UnicodeDecodeError:
@@ -152,7 +153,8 @@
                         break
                     for track in tracks:
                         if track[0] == track_id[0]:
-                            self.add_media_file(self.decode_string(track[1], guess))
+                            self.add_media_file(self.decode_string(track[1],
+                                guess))
                             break
             if self.stop_import_flag:
                 success = False

=== modified file 'openlp/plugins/songs/lib/opensongimport.py'
--- openlp/plugins/songs/lib/opensongimport.py	2010-09-19 08:47:00 +0000
+++ openlp/plugins/songs/lib/opensongimport.py	2010-11-03 18:41:37 +0000
@@ -229,14 +229,16 @@
                 # drop the square brackets
                 right_bracket = thisline.find(u']')
                 content = thisline[1:right_bracket].upper()
-                # have we got any digits? If so, versenumber is everything from the digits
+                # have we got any digits?
+                # If so, versenumber is everything from the digits
                 # to the end (even if there are some alpha chars on the end)
                 match = re.match(u'(.*)(\d+.*)', content)
                 if match is not None:
                     versetype = match.group(1)
                     versenum = match.group(2)
                 else:
-                    # otherwise we assume number 1 and take the whole prefix as versetype
+                    # otherwise we assume number 1 and take the whole prefix as
+                    # the versetype
                     versetype = content
                     versenum = u'1'
                 continue
@@ -301,6 +303,7 @@
                 # Assume it's no.1 if there's no digits
                 tag = tag + u'1'
             if not versetags.has_key(tag):
-                log.info(u'Got order %s but not in versetags, dropping this item from presentation order', tag)
+                log.info(u'Got order %s but not in versetags, dropping this'
+                    u'item from presentation order', tag)
             else:
                 self.verse_order_list.append(tag)

=== modified file 'openlp/plugins/songs/lib/songimport.py'
--- openlp/plugins/songs/lib/songimport.py	2010-09-27 18:34:40 +0000
+++ openlp/plugins/songs/lib/songimport.py	2010-11-03 18:41:37 +0000
@@ -296,7 +296,8 @@
         song.lyrics = unicode(sxml.extract_xml(), u'utf-8')
         for i, current_verse_tag in enumerate(self.verse_order_list):
             if verses_changed_to_other.has_key(current_verse_tag):
-                self.verse_order_list[i] = verses_changed_to_other[current_verse_tag]
+                self.verse_order_list[i] = \
+                    verses_changed_to_other[current_verse_tag]
         song.verse_order = u' '.join(self.verse_order_list)
         song.copyright = self.copyright
         song.comments = self.comments

=== modified file 'openlp/plugins/songs/lib/songstab.py'
--- openlp/plugins/songs/lib/songstab.py	2010-10-06 20:30:49 +0000
+++ openlp/plugins/songs/lib/songstab.py	2010-11-03 18:41:37 +0000
@@ -56,8 +56,10 @@
         self.SongUpdateOnEditCheckBox = QtGui.QCheckBox(self.SongsModeGroupBox)
         self.SongUpdateOnEditCheckBox.setObjectName(u'SongUpdateOnEditCheckBox')
         self.SongsModeLayout.addWidget(self.SongUpdateOnEditCheckBox)
-        self.SongAddFromServiceCheckBox = QtGui.QCheckBox(self.SongsModeGroupBox)
-        self.SongAddFromServiceCheckBox.setObjectName(u'SongAddFromServiceCheckBox')
+        self.SongAddFromServiceCheckBox = QtGui.QCheckBox(
+            self.SongsModeGroupBox)
+        self.SongAddFromServiceCheckBox.setObjectName(
+            u'SongAddFromServiceCheckBox')
         self.SongsModeLayout.addWidget(self.SongAddFromServiceCheckBox)
         self.SongsLayout.setWidget(
             0, QtGui.QFormLayout.LabelRole, self.SongsModeGroupBox)
@@ -83,7 +85,8 @@
             'Display verses on live tool bar'))
         self.SongUpdateOnEditCheckBox.setText(
             translate('SongsPlugin.SongsTab', 'Update service from song edit'))
-        self.SongAddFromServiceCheckBox.setText(translate('SongsPlugin.SongsTab',
+        self.SongAddFromServiceCheckBox.setText(
+            translate('SongsPlugin.SongsTab',
             'Add missing songs when opening service'))
 
     def onSearchAsTypeCheckBoxChanged(self, check_state):
@@ -132,6 +135,8 @@
         settings.beginGroup(self.settingsSection)
         settings.setValue(u'search as type', QtCore.QVariant(self.song_search))
         settings.setValue(u'display songbar', QtCore.QVariant(self.song_bar))
-        settings.setValue(u'update service on edit', QtCore.QVariant(self.update_edit))
-        settings.setValue(u'add song from service', QtCore.QVariant(self.update_load))
+        settings.setValue(u'update service on edit',
+            QtCore.QVariant(self.update_edit))
+        settings.setValue(u'add song from service',
+            QtCore.QVariant(self.update_load))
         settings.endGroup()

=== modified file 'openlp/plugins/songusage/songusageplugin.py'
--- openlp/plugins/songusage/songusageplugin.py	2010-10-28 12:10:25 +0000
+++ openlp/plugins/songusage/songusageplugin.py	2010-11-03 18:41:37 +0000
@@ -29,7 +29,8 @@
 
 from PyQt4 import QtCore, QtGui
 
-from openlp.core.lib import Plugin, StringContent, Receiver, build_icon, translate
+from openlp.core.lib import Plugin, StringContent, Receiver, build_icon, \
+    translate
 from openlp.core.lib.db import Manager
 from openlp.plugins.songusage.forms import SongUsageDetailForm, \
     SongUsageDeleteForm
@@ -123,7 +124,12 @@
         self.SongUsageMenu.menuAction().setVisible(True)
 
     def finalise(self):
+        """
+        Tidy up on exit
+        """
         log.info(u'Plugin Finalise')
+        self.manager.finalise()
+        Plugin.finalise(self)
         self.SongUsageMenu.menuAction().setVisible(False)
         #stop any events being processed
         self.SongUsageActive = False
@@ -176,11 +182,3 @@
         self.textStrings[StringContent.VisibleName] = {
             u'title': translate('SongUsagePlugin', 'SongUsage')
         }
-
-    def finalise(self):
-        """
-        Time to tidy up on exit
-        """
-        log.info(u'SongUsage Finalising')
-        self.manager.finalise()
-        Plugin.finalise(self)


Follow ups