From 3454f95ddf8eb3368b60538d1d416ba40310edc8 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 6 Jan 2011 20:48:22 +0000 Subject: [PATCH 1/2] Cleanups --- openlp.pyw | 2 +- openlp/core/lib/searchedit.py | 2 +- openlp/plugins/alerts/forms/alertform.py | 8 ++++---- openlp/plugins/bibles/lib/db.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/openlp.pyw b/openlp.pyw index f3455962d..a1a616462 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -182,7 +182,7 @@ class OpenLP(QtGui.QApplication): screens = ScreenList() # Decide how many screens we have and their size for screen in xrange(0, self.desktop().numScreens()): - size = self.desktop().screenGeometry(screen); + size = self.desktop().screenGeometry(screen) screens.add_screen({u'number': screen, u'size': size, u'primary': (self.desktop().primaryScreen() == screen)}) diff --git a/openlp/core/lib/searchedit.py b/openlp/core/lib/searchedit.py index 07279aea5..c69e1f15b 100644 --- a/openlp/core/lib/searchedit.py +++ b/openlp/core/lib/searchedit.py @@ -78,7 +78,7 @@ class SearchEdit(QtGui.QLineEdit): else: self.setStyleSheet(u'QLineEdit { padding-right: %spx; } ' % \ rightPadding) - msz = self.minimumSizeHint(); + msz = self.minimumSizeHint() self.setMinimumSize( max(msz.width(), self.clearButton.width() + (frameWidth * 2) + 2), diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index bd03b9171..1d6a566fd 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -177,8 +177,8 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): 'parameter to be replaced.\nDo you want to continue anyway?'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No | QtGui.QMessageBox.Yes)) == QtGui.QMessageBox.No: - self.parameterEdit.setFocus() - return False + self.parameterEdit.setFocus() + return False # The ParameterEdit field is not empty, but we have not found '<>' # in the alert text. elif text.find(u'<>') == -1 and self.parameterEdit.text() and \ @@ -188,8 +188,8 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): ' contain \'<>\'.\nDo want to continue anyway?'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No | QtGui.QMessageBox.Yes)) == QtGui.QMessageBox.No: - self.parameterEdit.setFocus() - return False + self.parameterEdit.setFocus() + return False text = text.replace(u'<>', unicode(self.parameterEdit.text())) self.parent.alertsmanager.displayAlert(text) return True diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index 62068437a..9f4376da1 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -28,7 +28,7 @@ import logging import chardet import re -from PyQt4 import QtCore, QtGui +from PyQt4 import QtCore from sqlalchemy import Column, ForeignKey, or_, Table, types from sqlalchemy.orm import class_mapper, mapper, relation from sqlalchemy.orm.exc import UnmappedClassError From 120ec38557f7f441f00598daeb1908bdc6cf5517 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 6 Jan 2011 23:47:28 +0000 Subject: [PATCH 2/2] and cleanups --- openlp/plugins/bibles/lib/http.py | 2 +- openlp/plugins/bibles/lib/manager.py | 2 +- openlp/plugins/images/lib/mediaitem.py | 3 +-- openlp/plugins/media/lib/mediaitem.py | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index 6f26434de..ef663dfbe 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -230,7 +230,7 @@ class BGExtract(object): Receiver.send_message(u'openlp_process_events') footnotes = soup.findAll(u'sup', u'footnote') if footnotes: - [footnote.extract() for footnote in footnotes] + [footnote.extract() for footnote in footnotes] cleanup = [(re.compile('\s+'), lambda match: ' ')] verses = BeautifulSoup(str(soup), markupMassage=cleanup) content = verses.find(u'div', u'result-text-style-normal') diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index 15f171608..8e1dadd0e 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -26,7 +26,7 @@ import logging -from PyQt4 import QtCore, QtGui +from PyQt4 import QtCore from openlp.core.lib import Receiver, SettingsManager, translate from openlp.core.utils import AppLocation diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 89e27e2fb..9f6d6c6df 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -30,8 +30,7 @@ import os from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ - context_menu_action, ItemCapabilities, SettingsManager, translate, \ - check_item_selected, Receiver + ItemCapabilities, SettingsManager, translate, check_item_selected, Receiver from openlp.core.utils import AppLocation, get_images_filter log = logging.getLogger(__name__) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index fd8c6c97d..cc75dfc2b 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -31,7 +31,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ ItemCapabilities, SettingsManager, translate, check_item_selected, \ - context_menu_action, Receiver + Receiver log = logging.getLogger(__name__)