← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~googol/openlp/clean-up into lp:openlp

 

Andreas Preikschat has proposed merging lp:~googol/openlp/clean-up into lp:openlp.

Requested reviews:
  Tim Bentley (trb143)
  Raoul Snyman (raoul-snyman)

For more details, see:
https://code.launchpad.net/~googol/openlp/clean-up/+merge/145954

Hello,

- removed not needed imports
- added missing lines
- use 'isinstance' instead of 'type'
- removed old openlp-remoteclient.py
-- 
https://code.launchpad.net/~googol/openlp/clean-up/+merge/145954
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/__init__.py'
--- openlp/core/lib/__init__.py	2013-01-24 20:08:52 +0000
+++ openlp/core/lib/__init__.py	2013-01-31 19:23:27 +0000
@@ -35,8 +35,10 @@
 
 from PyQt4 import QtCore, QtGui, Qt
 
+
 log = logging.getLogger(__name__)
 
+
 class ServiceItemContext(object):
     """
     The context in which a Service Item is being generated

=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py	2013-01-27 20:36:18 +0000
+++ openlp/core/lib/mediamanageritem.py	2013-01-31 19:23:27 +0000
@@ -43,6 +43,7 @@
 
 log = logging.getLogger(__name__)
 
+
 class MediaManagerItem(QtGui.QWidget):
     """
     MediaManagerItem is a helper widget for plugins.

=== modified file 'openlp/core/lib/renderer.py'
--- openlp/core/lib/renderer.py	2013-01-23 20:29:43 +0000
+++ openlp/core/lib/renderer.py	2013-01-31 19:23:27 +0000
@@ -36,8 +36,10 @@
 from openlp.core.lib.theme import ThemeLevel
 from openlp.core.ui import MainDisplay
 
+
 log = logging.getLogger(__name__)
 
+
 VERSE = u'The Lord said to {r}Noah{/r}: \n' \
     'There\'s gonna be a {su}floody{/su}, {sb}floody{/sb}\n' \
     'The Lord said to {g}Noah{/g}:\n' \
@@ -136,8 +138,8 @@
             theme_data, main_rect, footer_rect = self._theme_dimensions[theme_name]
         # if No file do not update cache
         if theme_data.background_filename:
-            self.image_manager.addImage(theme_data.background_filename,
-                ImageSource.Theme, QtGui.QColor(theme_data.background_border_color))
+            self.image_manager.addImage(
+                theme_data.background_filename, ImageSource.Theme, QtGui.QColor(theme_data.background_border_color))
 
     def pre_render(self, override_theme_data=None):
         """
@@ -238,9 +240,8 @@
         serviceItem.raw_footer = FOOTER
         # if No file do not update cache
         if theme_data.background_filename:
-            self.image_manager.addImage(theme_data.background_filename,
-                ImageSource.Theme,
-                QtGui.QColor(theme_data.background_border_color))
+            self.image_manager.addImage(
+                theme_data.background_filename, ImageSource.Theme, QtGui.QColor(theme_data.background_border_color))
         theme_data, main, footer = self.pre_render(theme_data)
         serviceItem.themedata = theme_data
         serviceItem.main = main
@@ -343,8 +344,7 @@
         self.width = screen_size.width()
         self.height = screen_size.height()
         self.screen_ratio = float(self.height) / float(self.width)
-        log.debug(u'_calculate default %s, %f' % (screen_size,
-            self.screen_ratio))
+        log.debug(u'_calculate default %s, %f' % (screen_size, self.screen_ratio))
         # 90% is start of footer
         self.footer_start = int(self.height * 0.90)
 
@@ -369,11 +369,9 @@
             The theme data.
         """
         if not theme_data.font_footer_override:
-            return QtCore.QRect(10, self.footer_start, self.width - 20,
-                self.height - self.footer_start)
+            return QtCore.QRect(10, self.footer_start, self.width - 20, self.height - self.footer_start)
         else:
-            return QtCore.QRect(theme_data.font_footer_x,
-                theme_data.font_footer_y, theme_data.font_footer_width - 1,
+            return QtCore.QRect(theme_data.font_footer_x, theme_data.font_footer_y, theme_data.font_footer_width - 1,
                 theme_data.font_footer_height - 1)
 
     def _set_text_rectangle(self, theme_data, rect_main, rect_footer):
@@ -410,16 +408,14 @@
             function show_text(newtext) {
                 var main = document.getElementById('main');
                 main.innerHTML = newtext;
-                // We need to be sure that the page is loaded, that is why we
-                // return the element's height (even though we do not use the
-                // returned value).
+                // We need to be sure that the page is loaded, that is why we return the element's height (even though
+                // we do not use the returned value).
                 return main.offsetHeight;
             }
             </script><style>*{margin: 0; padding: 0; border: 0;}
             #main {position: absolute; top: 0px; %s %s}</style></head><body>
-            <div id="main"></div></body></html>""" % \
-            (build_lyrics_format_css(theme_data, self.page_width,
-            self.page_height), build_lyrics_outline_css(theme_data))
+            <div id="main"></div></body></html>""" % (build_lyrics_format_css(
+                theme_data, self.page_width, self.page_height), build_lyrics_outline_css(theme_data))
         self.web.setHtml(html)
         self.empty_height = self.web_frame.contentsSize().height()
 
@@ -444,8 +440,8 @@
         html_lines = map(expand_tags, lines)
         # Text too long so go to next page.
         if not self._text_fits_on_slide(separator.join(html_lines)):
-            html_text, previous_raw = self._binary_chop(formatted,
-                previous_html, previous_raw, html_lines, lines, separator, u'')
+            html_text, previous_raw = self._binary_chop(
+                formatted, previous_html, previous_raw, html_lines, lines, separator, u'')
         else:
             previous_raw = separator.join(lines)
         formatted.append(previous_raw)
@@ -583,10 +579,8 @@
         highest_index = len(html_list) - 1
         index = int(highest_index / 2)
         while True:
-            if not self._text_fits_on_slide(
-                previous_html + separator.join(html_list[:index + 1]).strip()):
-                # We know that it does not fit, so change/calculate the
-                # new index and highest_index accordingly.
+            if not self._text_fits_on_slide(previous_html + separator.join(html_list[:index + 1]).strip()):
+                # We know that it does not fit, so change/calculate the new index and highest_index accordingly.
                 highest_index = index
                 index = int(index - (index - smallest_index) / 2)
             else:
@@ -661,4 +655,4 @@
             self._theme_manager = Registry().get(u'theme_manager')
         return self._theme_manager
 
-    theme_manager = property(_get_theme_manager)
\ No newline at end of file
+    theme_manager = property(_get_theme_manager)

=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py	2013-01-24 20:08:52 +0000
+++ openlp/core/lib/serviceitem.py	2013-01-31 19:23:27 +0000
@@ -41,8 +41,10 @@
 
 from openlp.core.lib import build_icon, clean_tags, expand_tags, translate, ImageSource, Settings, Registry
 
+
 log = logging.getLogger(__name__)
 
+
 class ServiceItemType(object):
     """
     Defines the type of service item

=== modified file 'openlp/core/lib/settingsmanager.py'
--- openlp/core/lib/settingsmanager.py	2013-01-18 18:50:46 +0000
+++ openlp/core/lib/settingsmanager.py	2013-01-31 19:23:27 +0000
@@ -33,9 +33,6 @@
 """
 import os
 
-from PyQt4 import QtCore
-
-from openlp.core.lib import Settings
 from openlp.core.utils import AppLocation
 
 

=== modified file 'openlp/core/ui/__init__.py'
--- openlp/core/ui/__init__.py	2013-01-20 12:23:22 +0000
+++ openlp/core/ui/__init__.py	2013-01-31 19:23:27 +0000
@@ -31,7 +31,6 @@
 """
 
 
-
 class HideMode(object):
     """
     This is an enumeration class which specifies the different modes of hiding the display.

=== modified file 'openlp/core/ui/aboutdialog.py'
--- openlp/core/ui/aboutdialog.py	2013-01-27 20:36:18 +0000
+++ openlp/core/ui/aboutdialog.py	2013-01-31 19:23:27 +0000
@@ -260,7 +260,7 @@
             u'\n    '.join(documentors)))
         self.aboutNotebook.setTabText(self.aboutNotebook.indexOf(self.creditsTab),
             translate('OpenLP.AboutForm', 'Credits'))
-        copyright = translate('OpenLP.AboutForm',
+        openlp_copyright = translate('OpenLP.AboutForm',
             'Copyright \xa9 2004-2013 %s\n'
             'Portions copyright \xa9 2004-2013 %s') % (u'Raoul Snyman',
             u'Tim Bentley, Gerald Britton, Jonathan Corwin, Samuel Findlay, '
@@ -652,7 +652,7 @@
             'linking proprietary applications with the library. If this is '
             'what you want to do, use the GNU Lesser General Public License '
             'instead of this License.')
-        self.licenseTextEdit.setPlainText(u'%s\n\n%s\n\n%s\n\n\n%s' % (copyright, licence, disclaimer, gpltext))
+        self.licenseTextEdit.setPlainText(u'%s\n\n%s\n\n%s\n\n\n%s' % (openlp_copyright, licence, disclaimer, gpltext))
         self.aboutNotebook.setTabText(self.aboutNotebook.indexOf(self.licenseTab),
             translate('OpenLP.AboutForm', 'License'))
         self.volunteerButton.setText(translate('OpenLP.AboutForm', 'Volunteer'))

=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py	2013-01-23 21:05:25 +0000
+++ openlp/core/ui/maindisplay.py	2013-01-31 19:23:27 +0000
@@ -32,7 +32,6 @@
 """
 import cgi
 import logging
-import os
 import sys
 
 from PyQt4 import QtCore, QtGui, QtWebKit, QtOpenGL
@@ -50,6 +49,7 @@
 #http://www.steveheffernan.com/html5-video-player/demo-video-player.html
 #http://html5demos.com/two-videos
 
+
 class Display(QtGui.QGraphicsView):
     """
     This is a general display screen class. Here the general display settings

=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py	2013-01-30 22:01:52 +0000
+++ openlp/core/ui/servicemanager.py	2013-01-31 19:23:27 +0000
@@ -35,8 +35,6 @@
 from tempfile import mkstemp
 from datetime import datetime, timedelta
 
-log = logging.getLogger(__name__)
-
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import OpenLPToolbar, ServiceItem, Receiver, build_icon, ItemCapabilities, SettingsManager, \
@@ -48,6 +46,10 @@
 from openlp.core.utils import AppLocation, delete_file, split_filename, format_time
 from openlp.core.utils.actions import ActionList, CategoryOrder
 
+
+log = logging.getLogger(__name__)
+
+
 class ServiceManagerList(QtGui.QTreeWidget):
     """
     Set up key bindings and mouse behaviour for the service list

=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py	2013-01-31 19:06:53 +0000
+++ openlp/core/ui/slidecontroller.py	2013-01-31 19:23:27 +0000
@@ -332,21 +332,16 @@
             self.shortcutTimer = QtCore.QTimer()
             self.shortcutTimer.setObjectName(u'shortcutTimer')
             self.shortcutTimer.setSingleShot(True)
-            shortcuts = [{u'key': u'V', u'configurable': True,
-                u'text': translate('OpenLP.SlideController', 'Go to "Verse"')},
-                {u'key': u'C', u'configurable': True,
-                u'text': translate('OpenLP.SlideController', 'Go to "Chorus"')},
-                {u'key': u'B', u'configurable': True,
-                u'text': translate('OpenLP.SlideController', 'Go to "Bridge"')},
-                {u'key': u'P', u'configurable': True,
-                u'text': translate('OpenLP.SlideController',
-                'Go to "Pre-Chorus"')},
-                {u'key': u'I', u'configurable': True,
-                u'text': translate('OpenLP.SlideController', 'Go to "Intro"')},
-                {u'key': u'E', u'configurable': True,
-                u'text': translate('OpenLP.SlideController', 'Go to "Ending"')},
-                {u'key': u'O', u'configurable': True,
-                u'text': translate('OpenLP.SlideController', 'Go to "Other"')}]
+            shortcuts = [
+                {u'key': u'V', u'configurable': True, u'text': translate('OpenLP.SlideController', 'Go to "Verse"')},
+                {u'key': u'C', u'configurable': True, u'text': translate('OpenLP.SlideController', 'Go to "Chorus"')},
+                {u'key': u'B', u'configurable': True, u'text': translate('OpenLP.SlideController', 'Go to "Bridge"')},
+                {u'key': u'P', u'configurable': True, u'text': translate('OpenLP.SlideController',
+                    'Go to "Pre-Chorus"')},
+                {u'key': u'I', u'configurable': True, u'text': translate('OpenLP.SlideController', 'Go to "Intro"')},
+                {u'key': u'E', u'configurable': True, u'text': translate('OpenLP.SlideController', 'Go to "Ending"')},
+                {u'key': u'O', u'configurable': True, u'text': translate('OpenLP.SlideController', 'Go to "Other"')}
+            ]
             shortcuts += [{u'key': unicode(number)} for number in range(10)]
             self.previewListWidget.addActions([create_action(self,
                 u'shortcutAction_%s' % s[u'key'], text=s.get(u'text'),
@@ -354,9 +349,7 @@
                 context=QtCore.Qt.WidgetWithChildrenShortcut,
                 category=self.category if s.get(u'configurable') else None,
                 triggers=self._slideShortcutActivated) for s in shortcuts])
-            QtCore.QObject.connect(
-                self.shortcutTimer, QtCore.SIGNAL(u'timeout()'),
-                self._slideShortcutActivated)
+            QtCore.QObject.connect(self.shortcutTimer, QtCore.SIGNAL(u'timeout()'), self._slideShortcutActivated)
         # Signals
         QtCore.QObject.connect(self.previewListWidget, QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onSlideSelected)
         if self.isLive:
@@ -787,8 +780,7 @@
                     if verse_def not in self.slideList:
                         self.slideList[verse_def] = framenumber
                         if self.isLive:
-                            self.songMenu.menu().addAction(verse_def,
-                                self.onSongBarHandler)
+                            self.songMenu.menu().addAction(verse_def, self.onSongBarHandler)
                 else:
                     row += 1
                     self.slideList[unicode(row)] = row - 1
@@ -849,8 +841,7 @@
         Utility method to update the selected slide in the list.
         """
         if slideno > self.previewListWidget.rowCount():
-            self.previewListWidget.selectRow(
-                self.previewListWidget.rowCount() - 1)
+            self.previewListWidget.selectRow(self.previewListWidget.rowCount() - 1)
         else:
             self.__checkUpdateSelectedSlide(slideno)
 
@@ -1363,4 +1354,4 @@
             self._live_controller = Registry().get(u'live_controller')
         return self._live_controller
 
-    live_controller = property(_get_live_controller)
\ No newline at end of file
+    live_controller = property(_get_live_controller)

=== modified file 'openlp/core/ui/themelayoutform.py'
--- openlp/core/ui/themelayoutform.py	2012-12-29 20:56:56 +0000
+++ openlp/core/ui/themelayoutform.py	2013-01-31 19:23:27 +0000
@@ -43,7 +43,6 @@
         """
         Run the Dialog with correct heading.
         """
-        pixmap = image.scaledToHeight(400, QtCore.Qt.SmoothTransformation)
         self.themeDisplayLabel.setPixmap(image)
         displayAspectRatio = float(image.width()) / image.height()
         self.themeDisplayLabel.setFixedSize(400, 400 / displayAspectRatio )

=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py	2013-01-24 20:08:52 +0000
+++ openlp/core/ui/thememanager.py	2013-01-31 19:23:27 +0000
@@ -45,8 +45,10 @@
 from openlp.core.ui import FileRenameForm, ThemeForm
 from openlp.core.utils import AppLocation, delete_file, locale_compare, get_filesystem_encoding
 
+
 log = logging.getLogger(__name__)
 
+
 class ThemeManager(QtGui.QWidget):
     """
     Manages the orders of Theme.

=== modified file 'openlp/core/utils/__init__.py'
--- openlp/core/utils/__init__.py	2013-01-23 21:01:45 +0000
+++ openlp/core/utils/__init__.py	2013-01-31 19:23:27 +0000
@@ -29,7 +29,7 @@
 """
 The :mod:`openlp.core.utils` module provides the utility libraries for OpenLP.
 """
-from datetime import datetime, timedelta
+from datetime import datetime
 from distutils.version import LooseVersion
 import logging
 import locale
@@ -53,7 +53,10 @@
 import openlp
 from openlp.core.lib import Receiver, translate, check_directory_exists
 
+
 log = logging.getLogger(__name__)
+
+
 APPLICATION_VERSION = {}
 IMAGES_FILTER = None
 UNO_CONNECTION_TYPE = u'pipe'
@@ -61,6 +64,7 @@
 CONTROL_CHARS = re.compile(r'[\x00-\x1F\x7F-\x9F]', re.UNICODE)
 INVALID_FILE_CHARS = re.compile(r'[\\/:\*\?"<>\|\+\[\]%]', re.UNICODE)
 
+
 class VersionThread(QtCore.QThread):
     """
     A special Qt thread class to fetch the version of OpenLP from the website.

=== modified file 'scripts/check_dependencies.py'
--- scripts/check_dependencies.py	2013-01-07 09:18:29 +0000
+++ scripts/check_dependencies.py	2013-01-31 19:23:27 +0000
@@ -89,10 +89,11 @@
 
 w = sys.stdout.write
 
+
 def check_vers(version, required, text):
-    if type(version) is not str:
+    if not isinstance(version, str):
         version = '.'.join(map(str, version))
-    if type(required) is not str:
+    if not isinstance(required, str):
         required = '.'.join(map(str, required))
     w('  %s >= %s ...    ' % (text, required))
     if LooseVersion(version) >= LooseVersion(required):
@@ -102,13 +103,16 @@
         w('FAIL' + os.linesep)
         return False
 
+
 def print_vers_fail(required, text):
     print('  %s >= %s ...    FAIL' % (text, required))
 
+
 def verify_python():
     if not check_vers(list(sys.version_info), VERS['Python'], text='Python'):
         exit(1)
 
+
 def verify_versions():
     print('Verifying version of modules...')
     try:
@@ -129,6 +133,7 @@
     except ImportError:
         print_vers_fail(VERS['enchant'], 'enchant')
 
+
 def check_module(mod, text='', indent='  '):
     space = (30 - len(mod) - len(text)) * ' '
     w(indent + '%s%s...  ' % (mod, text) + space)
@@ -139,6 +144,7 @@
         w('FAIL')
     w(os.linesep)
 
+
 def verify_pyenchant():
     w('Enchant (spell checker)... ')
     try:
@@ -151,20 +157,20 @@
     except ImportError:
         w('FAIL' + os.linesep)
 
+
 def verify_pyqt():
     w('Qt4 image formats... ')
     try:
         from PyQt4 import QtGui
-        read_f = ', '.join([unicode(format).lower()
-           for format in QtGui.QImageReader.supportedImageFormats()])
-        write_f = ', '.join([unicode(format).lower()
-            for format in QtGui.QImageWriter.supportedImageFormats()])
+        read_f = ', '.join([unicode(format).lower() for format in QtGui.QImageReader.supportedImageFormats()])
+        write_f = ', '.join([unicode(format).lower() for format in QtGui.QImageWriter.supportedImageFormats()])
         w(os.linesep)
         print('  read: %s' % read_f)
         print('  write: %s' % write_f)
     except ImportError:
         w('FAIL' + os.linesep)
 
+
 def main():
     verify_python()
 

=== removed file 'scripts/openlp-remoteclient.py'
--- scripts/openlp-remoteclient.py	2012-12-29 20:56:56 +0000
+++ scripts/openlp-remoteclient.py	1970-01-01 00:00:00 +0000
@@ -1,70 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
-
-###############################################################################
-# OpenLP - Open Source Lyrics Projection                                      #
-# --------------------------------------------------------------------------- #
-# Copyright (c) 2008-2013 Raoul Snyman                                        #
-# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan      #
-# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub,      #
-# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer.   #
-# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru,          #
-# Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith,             #
-# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Dave Warnock,              #
-# Frode Woldsund, Martin Zibricky, Patrick Zimmermann                         #
-# --------------------------------------------------------------------------- #
-# 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                          #
-###############################################################################
-
-import urllib
-import sys
-from optparse import OptionParser
-
-def sendData(options):
-    addr = 'http://%s:%s/send/%s?q=%s' % (options.address, options.port,
-        options.event, options.message)
-    try:
-        urllib.urlopen(addr)
-        print u'Message sent ', addr
-    except:
-        print u'Error thrown ', sys.exc_info()[1]
-
-def main():
-    usage = "usage: %prog [-a address] [-p port] [-e event] [-m message]"
-    parser = OptionParser(usage=usage)
-    parser.add_option("-p", "--port", default=4316,
-                      help="IP Port number %default ")
-    parser.add_option("-a", "--address",
-                      help="Recipient address ",
-                      default="localhost")
-    parser.add_option("-e", "--event",
-                      help="Action to be performed",
-                      default="alerts_text")
-    parser.add_option("-m", "--message",
-                      help="Message to be passed for the action",
-                      default="")
-
-    (options, args) = parser.parse_args()
-    if args:
-        parser.print_help()
-        parser.error("incorrect number of arguments")
-    elif options.address is None:
-        parser.print_help()
-        parser.error("IP address missing")
-    else:
-        sendData(options)
-
-if __name__ == u'__main__':
-    main()

=== modified file 'scripts/translation_utils.py'
--- scripts/translation_utils.py	2012-12-29 20:56:56 +0000
+++ scripts/translation_utils.py	2013-01-31 19:23:27 +0000
@@ -53,8 +53,6 @@
 """
 import os
 import urllib2
-import re
-from shutil import copy
 from getpass import getpass
 import base64
 import json
@@ -62,7 +60,6 @@
 
 from optparse import OptionParser
 from PyQt4 import QtCore
-from BeautifulSoup import BeautifulSoup
 
 SERVER_URL = u'http://www.transifex.net/api/2/project/openlp/'
 IGNORED_PATHS = [u'scripts']
@@ -73,6 +70,7 @@
 username = ''
 password = ''
 
+
 class Command(object):
     """
     Provide an enumeration of commands.
@@ -83,6 +81,7 @@
     Update = 4
     Generate = 5
 
+
 class CommandStack(object):
     """
     This class provides an iterable stack.
@@ -137,6 +136,7 @@
                 results.append(str((item[u'command'], )))
         return u'[%s]' % u', '.join(results)
 
+
 def print_quiet(text, linefeed=True):
     """
     This method checks to see if we are in quiet mode, and if not prints
@@ -152,6 +152,7 @@
         else:
             print text,
 
+
 def print_verbose(text):
     """
     This method checks to see if we are in verbose mode, and if so prints
@@ -164,6 +165,7 @@
     if not quiet_mode and verbose_mode:
         print u'    %s' % text
 
+
 def run(command):
     """
     This method runs an external application.
@@ -179,6 +181,7 @@
     print_verbose(u'Error(s):\n%s' % process.readAllStandardError())
     print_verbose(u'Output:\n%s' % process.readAllStandardOutput())
 
+
 def download_translations():
     """
     This method downloads the translation files from the Pootle server.
@@ -220,6 +223,7 @@
     print_quiet(u'   Done.')
     return True
 
+
 def prepare_project():
     """
     This method creates the project file needed to update the translation files
@@ -261,11 +265,12 @@
                 print_verbose(u'Parsing "%s"' % line)
                 lines.append(u'TRANSLATIONS += %s' % line)
     lines.sort()
-    file = open(os.path.join(start_dir, u'openlp.pro'), u'w')
-    file.write(u'\n'.join(lines).encode('utf8'))
-    file.close()
+    pro_file = open(os.path.join(start_dir, u'openlp.pro'), u'w')
+    pro_file.write(u'\n'.join(lines).encode('utf8'))
+    pro_file.close()
     print_quiet(u'   Done.')
 
+
 def update_translations():
     print_quiet(u'Update the translation files')
     if not os.path.exists(os.path.join(os.path.abspath(u'..'), u'openlp.pro')):
@@ -277,6 +282,7 @@
         run(u'pylupdate4 -verbose -noobsolete openlp.pro')
         os.chdir(os.path.abspath(u'scripts'))
 
+
 def generate_binaries():
     print_quiet(u'Generate the related *.qm files')
     if not os.path.exists(os.path.join(os.path.abspath(u'..'), u'openlp.pro')):
@@ -302,6 +308,7 @@
         'resource/ents/')
     print_quiet(u'Opening browser to OpenLP project...')
 
+
 def process_stack(command_stack):
     """
     This method looks at the commands in the command stack, and processes them
@@ -329,6 +336,7 @@
     else:
         print_quiet(u'No commands to process.')
 
+
 def main():
     global verbose_mode, quiet_mode, username, password
     # Set up command line options.

=== modified file 'tests/test_app.py'
--- tests/test_app.py	2012-12-08 08:40:41 +0000
+++ tests/test_app.py	2013-01-31 19:23:27 +0000
@@ -32,6 +32,6 @@
 
 
 def test_start_app(openlpapp):
-    assert type(openlpapp) == OpenLP
-    assert type(openlpapp.mainWindow) == MainWindow
+    assert isinstance(openlpapp, OpenLP)
+    assert isinstance(openlpapp.mainWindow, MainWindow)
     assert unicode(openlpapp.mainWindow.windowTitle()) == u'OpenLP 2.1'


Follow ups