diff --git a/openlp.pyw b/openlp.pyw index 2132c99fd..941ae1e38 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -25,8 +25,8 @@ import sys import logging -import logging.handlers +from logging.handlers import RotatingFileHandler from optparse import OptionParser from PyQt4 import QtCore, QtGui @@ -94,10 +94,9 @@ def main(): action="store_true", help="set logging to DEBUG level") # Set up logging filename = u'openlp.log' - logfile = logging.handlers.RotatingFileHandler( - filename, maxBytes=200000, backupCount=5) - logfile.setFormatter( - logging.Formatter(u'%(asctime)s %(name)-15s %(levelname)-8s %(message)s')) + logfile = RotatingFileHandler(filename, maxBytes=200000, backupCount=5) + logfile.setFormatter(logging.Formatter( + u'%(asctime)s %(name)-15s %(levelname)-8s %(message)s')) log.addHandler(logfile) # Parse command line options and deal with them. (options, args) = parser.parse_args() diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index e8aab6bfb..8552b66f9 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -44,8 +44,8 @@ def translate(context, text): ``text`` The text to put into the translation tables for translation. """ - return QtGui.QApplication.translate(context, text, None, - QtGui.QApplication.UnicodeUTF8) + return QtGui.QApplication.translate( + context, text, None, QtGui.QApplication.UnicodeUTF8) def file_to_xml(xmlfile): """ @@ -84,15 +84,15 @@ def buildIcon(icon): elif type(icon) is types.StringType or type(icon) is types.UnicodeType: ButtonIcon = QtGui.QIcon() if icon.startswith(u':/'): - ButtonIcon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal, - QtGui.QIcon.Off) + ButtonIcon.addPixmap( + QtGui.QPixmap(icon), QtGui.QIcon.Normal, QtGui.QIcon.Off) else: ButtonIcon.addPixmap(QtGui.QPixmap.fromImage(QtGui.QImage(icon)), QtGui.QIcon.Normal, QtGui.QIcon.Off) elif type(icon) is QtGui.QImage: ButtonIcon = QtGui.QIcon() - ButtonIcon.addPixmap(QtGui.QPixmap.fromImage(icon), - QtGui.QIcon.Normal, QtGui.QIcon.Off) + ButtonIcon.addPixmap( + QtGui.QPixmap.fromImage(icon), QtGui.QIcon.Normal, QtGui.QIcon.Off) return ButtonIcon def contextMenuAction(base, icon, text, slot): @@ -100,7 +100,7 @@ def contextMenuAction(base, icon, text, slot): Utility method to help build context menus for plugins """ action = QtGui.QAction(text, base) - action .setIcon(buildIcon(icon)) + action.setIcon(buildIcon(icon)) QtCore.QObject.connect(action, QtCore.SIGNAL(u'triggered()'), slot) return action diff --git a/openlp/core/lib/dockwidget.py b/openlp/core/lib/dockwidget.py index 50b8fe51a..b3d9bb24b 100644 --- a/openlp/core/lib/dockwidget.py +++ b/openlp/core/lib/dockwidget.py @@ -38,6 +38,7 @@ class OpenLPDockWidget(QtGui.QDockWidget): self.parent = parent if name is not None: self.setObjectName(name) + self.setFloating(False) self.log = logging.getLogger(u'OpenLPDockWidget') self.log.debug(u'Init done') diff --git a/openlp/core/lib/eventreceiver.py b/openlp/core/lib/eventreceiver.py index ad5aac289..07884c190 100644 --- a/openlp/core/lib/eventreceiver.py +++ b/openlp/core/lib/eventreceiver.py @@ -141,5 +141,3 @@ class Receiver(): Get the global ``eventreceiver`` instance. """ return Receiver.eventreceiver - - diff --git a/openlp/core/lib/settingsmanager.py b/openlp/core/lib/settingsmanager.py index dff197100..b4566e1b7 100644 --- a/openlp/core/lib/settingsmanager.py +++ b/openlp/core/lib/settingsmanager.py @@ -1,24 +1,26 @@ # -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 -""" -OpenLP - Open Source Lyrics Projection -Copyright (c) 2008 Raoul Snyman - -Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley - -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free Software -Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -PARTICULAR PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., 59 Temple -Place, Suite 330, Boston, MA 02111-1307 USA -""" +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2009 Raoul Snyman # +# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten # +# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### from openlp.core.lib import str_to_bool from openlp.core.utils import ConfigHelper diff --git a/openlp/core/lib/themexmlhandler.py b/openlp/core/lib/themexmlhandler.py index 7778bffb0..610f30eec 100644 --- a/openlp/core/lib/themexmlhandler.py +++ b/openlp/core/lib/themexmlhandler.py @@ -372,8 +372,8 @@ class ThemeXML(object): """ Return a string representation of this object. """ - s = u'' - for k in dir(self): - if k[0:1] != u'_': - s += u'%30s: %s\n' %(k, getattr(self, k)) - return s + theme_strings = [] + for key in dir(self): + if key[0:1] != u'_': + theme_strings.append(u'%30s: %s' % (key, getattr(self, key))) + return u'\n'.join(theme_strings) diff --git a/openlp/core/lib/toolbar.py b/openlp/core/lib/toolbar.py index fcb443af6..4ed30d57d 100644 --- a/openlp/core/lib/toolbar.py +++ b/openlp/core/lib/toolbar.py @@ -22,11 +22,12 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -import types import logging from PyQt4 import QtCore, QtGui +from openlp.core.lib import buildIcon + class OpenLPToolbar(QtGui.QToolBar): """ Lots of toolbars around the place, so it makes sense to have a common way @@ -66,17 +67,7 @@ class OpenLPToolbar(QtGui.QToolBar): ``objectname`` The name of the object, as used in `