From ac365e5b6a735ce41620cd7e22e35e5f0f4d9580 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 26 Nov 2011 21:26:50 +0000 Subject: [PATCH] Cleanups --- openlp/core/lib/listwidgetwithdnd.py | 4 ++-- openlp/core/ui/maindisplay.py | 1 - openlp/core/ui/mainwindow.py | 8 ++++---- openlp/core/ui/themelayoutdialog.py | 1 - openlp/core/ui/themelayoutform.py | 3 --- openlp/plugins/alerts/lib/alertstab.py | 2 +- openlp/plugins/bibles/lib/versereferencelist.py | 3 ++- openlp/plugins/custom/forms/editcustomform.py | 3 ++- openlp/plugins/presentations/lib/mediaitem.py | 3 ++- openlp/plugins/songs/forms/editsongform.py | 10 ++++++---- openlp/plugins/songs/lib/upgrade.py | 1 - openlp/plugins/songusage/lib/upgrade.py | 1 - 12 files changed, 19 insertions(+), 21 deletions(-) diff --git a/openlp/core/lib/listwidgetwithdnd.py b/openlp/core/lib/listwidgetwithdnd.py index 69fb23092..31be1f5be 100644 --- a/openlp/core/lib/listwidgetwithdnd.py +++ b/openlp/core/lib/listwidgetwithdnd.py @@ -104,7 +104,7 @@ class ListWidgetWithDnD(QtGui.QListWidget): elif os.path.isdir(localFile): listing = os.listdir(localFile) for file in listing: - files.append(os.path.join(localFile,file)) - Receiver.send_message(u'%s_dnd' % self.mimeDataText,files) + files.append(os.path.join(localFile, file)) + Receiver.send_message(u'%s_dnd' % self.mimeDataText, files) else: event.ignore() diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 2a16867e5..c4f0903c7 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -29,7 +29,6 @@ The :mod:`maindisplay` module provides the functionality to display screens and play multimedia within OpenLP. """ import logging -import os from PyQt4 import QtCore, QtGui, QtWebKit from PyQt4.phonon import Phonon diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 47570cd8a..ed1a9318c 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -35,15 +35,14 @@ from datetime import datetime from PyQt4 import QtCore, QtGui from openlp.core.lib import Renderer, build_icon, OpenLPDockWidget, \ - PluginManager, Receiver, translate, ImageManager, PluginStatus, \ - SettingsManager + PluginManager, Receiver, translate, ImageManager, PluginStatus from openlp.core.lib.ui import UiStrings, base_action, checkable_action, \ icon_action, shortcut_action from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \ ThemeManager, SlideController, PluginForm, MediaDockManager, \ ShortcutListForm, FormattingTagForm from openlp.core.utils import AppLocation, add_actions, LanguageManager, \ - get_application_version, delete_file + get_application_version from openlp.core.utils.actions import ActionList, CategoryOrder from openlp.core.ui.firsttimeform import FirstTimeForm from openlp.core.ui import ScreenList @@ -503,7 +502,8 @@ class Ui_MainWindow(object): self.toolsFirstTimeWizard.setText( translate('OpenLP.MainWindow', 'Re-run First Time Wizard')) self.toolsFirstTimeWizard.setStatusTip(translate('OpenLP.MainWindow', - 'Re-run the First Time Wizard, importing songs, Bibles and themes.')) + 'Re-run the First Time Wizard, importing songs, Bibles and ' + 'themes.')) self.updateThemeImages.setText( translate('OpenLP.MainWindow', 'Update Theme Images')) self.updateThemeImages.setStatusTip( diff --git a/openlp/core/ui/themelayoutdialog.py b/openlp/core/ui/themelayoutdialog.py index 5be08ad65..56bfe79bb 100644 --- a/openlp/core/ui/themelayoutdialog.py +++ b/openlp/core/ui/themelayoutdialog.py @@ -28,7 +28,6 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate -from openlp.core.lib.ui import create_accept_reject_button_box class Ui_ThemeLayoutDialog(object): diff --git a/openlp/core/ui/themelayoutform.py b/openlp/core/ui/themelayoutform.py index 6f77d31da..57d8bd952 100644 --- a/openlp/core/ui/themelayoutform.py +++ b/openlp/core/ui/themelayoutform.py @@ -29,9 +29,6 @@ from PyQt4 import QtGui, QtCore from themelayoutdialog import Ui_ThemeLayoutDialog -from openlp.core.lib import translate -from openlp.core.lib.ui import UiStrings, critical_error_message_box - class ThemeLayoutForm(QtGui.QDialog, Ui_ThemeLayoutDialog): """ The exception dialog diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index bd879fef3..90e06caab 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -192,7 +192,7 @@ class AlertsTab(SettingsTab): settings.setValue(u'location', QtCore.QVariant(self.location)) settings.endGroup() if self.changed: - Receiver.send_message(u'update_display_css') + Receiver.send_message(u'update_display_css') self.changed = False def updateDisplay(self): diff --git a/openlp/plugins/bibles/lib/versereferencelist.py b/openlp/plugins/bibles/lib/versereferencelist.py index 471fc6a66..a1727655e 100644 --- a/openlp/plugins/bibles/lib/versereferencelist.py +++ b/openlp/plugins/bibles/lib/versereferencelist.py @@ -72,7 +72,8 @@ class VerseReferenceList(object): continue prev = index - 1 if self.verse_list[prev][u'version'] != verse[u'version']: - result = u'%s (%s)' % (result, self.verse_list[prev][u'version']) + result = u'%s (%s)' % (result, + self.verse_list[prev][u'version']) result = result + u', ' if self.verse_list[prev][u'book'] != verse[u'book']: result = u'%s%s %s:' % (result, verse[u'book'], diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index 0eadf6021..a85daa38b 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -30,7 +30,8 @@ import logging from PyQt4 import QtCore, QtGui from openlp.core.lib import Receiver, translate -from openlp.core.lib.ui import critical_error_message_box, find_and_set_in_combo_box +from openlp.core.lib.ui import critical_error_message_box, \ + find_and_set_in_combo_box from openlp.plugins.custom.lib import CustomXMLBuilder, CustomXMLParser from openlp.plugins.custom.lib.db import CustomSlide from editcustomdialog import Ui_CustomEditDialog diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index e1dd57271..6dc57373a 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -285,7 +285,8 @@ class PresentationMediaItem(MediaManagerItem): critical_error_message_box( translate('PresentationPlugin.MediaItem', 'Missing Presentation'), - unicode(translate('PresentationPlugin.MediaItem', + unicode(translate( + 'PresentationPlugin.MediaItem', 'The Presentation %s is incomplete,' ' please reload.')) % filename) return False diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 1c254406c..9164ef2a9 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -331,8 +331,10 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.topicsListView.addItem(topic_name) self.audioListWidget.clear() for media in self.song.media_files: - media_file = QtGui.QListWidgetItem(os.path.split(media.file_name)[1]) - media_file.setData(QtCore.Qt.UserRole, QtCore.QVariant(media.file_name)) + media_file = QtGui.QListWidgetItem( + os.path.split(media.file_name)[1]) + media_file.setData(QtCore.Qt.UserRole, + QtCore.QVariant(media.file_name)) self.audioListWidget.addItem(media_file) self.titleEdit.setFocus(QtCore.Qt.OtherFocusReason) # Hide or show the preview button. @@ -721,7 +723,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): """ if self.mediaForm.exec_(): for filename in self.mediaForm.getSelectedFiles(): - item = QtGui.QListWidgetItem(os.path.split(unicode(filename))[1]) + item = QtGui.QListWidgetItem( + os.path.split(unicode(filename))[1]) item.setData(QtCore.Qt.UserRole, filename) self.audioListWidget.addItem(item) @@ -876,7 +879,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): os.remove(audio) except: log.exception('Could not remove file: %s', audio) - pass if not files: try: os.rmdir(save_path) diff --git a/openlp/plugins/songs/lib/upgrade.py b/openlp/plugins/songs/lib/upgrade.py index 21988c267..c1ce65702 100644 --- a/openlp/plugins/songs/lib/upgrade.py +++ b/openlp/plugins/songs/lib/upgrade.py @@ -31,7 +31,6 @@ backend for the Songs plugin from sqlalchemy import Column, Table, types from sqlalchemy.sql.expression import func -from migrate import changeset from migrate.changeset.constraint import ForeignKeyConstraint __version__ = 2 diff --git a/openlp/plugins/songusage/lib/upgrade.py b/openlp/plugins/songusage/lib/upgrade.py index 50ca32fcd..e9a508b76 100644 --- a/openlp/plugins/songusage/lib/upgrade.py +++ b/openlp/plugins/songusage/lib/upgrade.py @@ -30,7 +30,6 @@ backend for the SongsUsage plugin """ from sqlalchemy import Column, Table, types -from migrate import changeset __version__ = 1