From f0c03ad2cba40cd6f268811e828758c928f54c3e Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Wed, 26 May 2010 00:07:50 +0100 Subject: [PATCH] Cleanups --- openlp/core/lib/__init__.py | 9 ++++++++- openlp/core/theme/__init__.py | 2 +- openlp/core/utils/__init__.py | 3 ++- openlp/plugins/songs/lib/classes.py | 3 ++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 47a5c51cd..e5f45b188 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -132,6 +132,9 @@ def contextMenu(base, icon, text): return action def contextMenuSeparator(base): + """ + Add a separator to a context menu + """ action = QtGui.QAction(u'', base) action.setSeparator(True) return action @@ -150,7 +153,8 @@ def resize_image(image, width, height): realw = preview.width() realh = preview.height() # and move it to the centre of the preview space - newImage = QtGui.QImage(width, height, QtGui.QImage.Format_ARGB32_Premultiplied) + newImage = QtGui.QImage( + width, height, QtGui.QImage.Format_ARGB32_Premultiplied) newImage.fill(QtCore.Qt.black) painter = QtGui.QPainter(newImage) painter.drawImage((width - realw) / 2, (height - realh) / 2, preview) @@ -158,6 +162,9 @@ def resize_image(image, width, height): class ThemeLevel(object): + """ + Provides an enumeration for the level a theme applies to + """ Global = 1 Service = 2 Song = 3 diff --git a/openlp/core/theme/__init__.py b/openlp/core/theme/__init__.py index 0975e977b..037392e8e 100644 --- a/openlp/core/theme/__init__.py +++ b/openlp/core/theme/__init__.py @@ -23,4 +23,4 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -from theme import Theme +from openlp.core.theme.theme import Theme diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index 5df5d397a..8cbf7657a 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -186,4 +186,5 @@ def add_actions(target, actions): from languagemanager import LanguageManager -__all__ = [u'AppLocation', u'check_latest_version', u'add_actions', u'LanguageManager'] +__all__ = [u'AppLocation', u'check_latest_version', u'add_actions', + u'LanguageManager'] diff --git a/openlp/plugins/songs/lib/classes.py b/openlp/plugins/songs/lib/classes.py index 171bbdc48..115943814 100644 --- a/openlp/plugins/songs/lib/classes.py +++ b/openlp/plugins/songs/lib/classes.py @@ -50,7 +50,8 @@ class Book(BaseModel): Book model """ def __repr__(self): - return u'' % (str(self.id), self.name, self.publisher) + return u'' % ( + str(self.id), self.name, self.publisher) class Song(BaseModel): """