← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~meths/openlp/trivialfixes into lp:openlp

 

Jon Tibble has proposed merging lp:~meths/openlp/trivialfixes into lp:openlp.

    Requested reviews:
    OpenLP Core (openlp-core)


Object testing cleanups
-- 
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/14385
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp.pyw'
--- openlp.pyw	2009-11-01 09:07:10 +0000
+++ openlp.pyw	2009-11-03 19:50:24 +0000
@@ -137,7 +137,7 @@
     log.addHandler(logfile)
     # Parse command line options and deal with them.
     (options, args) = parser.parse_args()
-    if options.debug is not None:
+    if options.debug:
         log.setLevel(logging.DEBUG)
     else:
         log.setLevel(logging.INFO)

=== modified file 'openlp/core/lib/__init__.py'
--- openlp/core/lib/__init__.py	2009-10-26 23:51:48 +0000
+++ openlp/core/lib/__init__.py	2009-11-03 19:50:24 +0000
@@ -110,7 +110,7 @@
     Utility method to help build context menus for plugins
     """
     action = QtGui.QAction(text, base)
-    if icon is not None:
+    if icon:
         action.setIcon(buildIcon(icon))
     QtCore.QObject.connect(action, QtCore.SIGNAL(u'triggered()'), slot)
     return action

=== modified file 'openlp/core/lib/dockwidget.py'
--- openlp/core/lib/dockwidget.py	2009-10-11 06:29:25 +0000
+++ openlp/core/lib/dockwidget.py	2009-11-03 19:50:24 +0000
@@ -36,7 +36,7 @@
         """
         QtGui.QDockWidget.__init__(self, parent)
         self.parent = parent
-        if name is not None:
+        if name:
             self.setObjectName(name)
         self.setFloating(False)
         self.log = logging.getLogger(u'OpenLPDockWidget')

=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py	2009-11-03 01:12:35 +0000
+++ openlp/core/lib/mediamanageritem.py	2009-11-03 19:50:24 +0000
@@ -110,7 +110,7 @@
                 QtGui.QIcon.Normal, QtGui.QIcon.Off)
         else:
             self.icon = None
-        if title is not None:
+        if title:
             self.title = title
         self.Toolbar = None
         self.ServiceItemIconName = None
@@ -364,7 +364,7 @@
                 self.trUtf8(u'You must select one or more items'))
         log.debug(self.PluginNameShort + u' Preview Requested')
         service_item = self.buildServiceItem()
-        if service_item is not None:
+        if service_item:
             service_item.fromPlugin = True
             self.parent.preview_controller.addServiceItem(service_item)
 
@@ -375,7 +375,7 @@
                 self.trUtf8(u'You must select one or more items'))
         log.debug(self.PluginNameShort + u' Live Requested')
         service_item = self.buildServiceItem()
-        if service_item is not None:
+        if service_item:
             service_item.fromPlugin = True
             service_item.uuid = unicode(uuid.uuid1())
             self.parent.live_controller.addServiceItem(service_item)
@@ -387,7 +387,7 @@
                 self.trUtf8(u'You must select one or more items'))
         log.debug(self.PluginNameShort + u' Add Requested')
         service_item = self.buildServiceItem()
-        if service_item is not None:
+        if service_item:
             service_item.fromPlugin = False
             service_item.uuid = unicode(uuid.uuid1())
             self.parent.service_manager.addServiceItem(service_item)
@@ -397,7 +397,7 @@
         Common method for generating a service item
         """
         service_item = ServiceItem(self.parent)
-        if self.ServiceItemIconName is not None:
+        if self.ServiceItemIconName:
             service_item.addIcon(self.ServiceItemIconName)
         else:
             service_item.addIcon(

=== modified file 'openlp/core/lib/plugin.py'
--- openlp/core/lib/plugin.py	2009-10-30 20:34:11 +0000
+++ openlp/core/lib/plugin.py	2009-11-03 19:50:24 +0000
@@ -112,7 +112,7 @@
         """
         QtCore.QObject.__init__(self)
         self.name = name
-        if version is not None:
+        if version:
             self.version = version
         self.icon = None
         self.config = PluginConfig(self.name)
@@ -236,7 +236,7 @@
         """
         Called by the plugin Manager to initialise anything it needs.
         """
-        if self.media_item is not None:
+        if self.media_item:
             self.media_item.initialise()
 
     def finalise(self):
@@ -256,7 +256,7 @@
         """
         Called by plugin to replace toolbar
         """
-        if self.media_item is not None:
+        if self.media_item:
             self.mediadock.insert_dock(self.media_item, self.icon, self.weight)
-        if self.settings_tab is not None:
+        if self.settings_tab:
             self.settings.insertTab(self.settings_tab, self.weight)

=== modified file 'openlp/core/lib/pluginconfig.py'
--- openlp/core/lib/pluginconfig.py	2009-09-25 23:06:54 +0000
+++ openlp/core/lib/pluginconfig.py	2009-11-03 19:50:24 +0000
@@ -107,7 +107,7 @@
             files = os.listdir(self.get_data_path())
         except:
             return []
-        if suffix is not None:
+        if suffix:
             return_files = []
             for file in files:
                 if file.find(u'.') != -1:
@@ -131,7 +131,7 @@
             The name of the list.
         """
         list_count = self.get_config(u'%s count' % name)
-        if list_count is not None:
+        if list_count:
             list_count = int(list_count)
         else:
             list_count = 0
@@ -169,12 +169,12 @@
         ``num``
             Defaults to *None*. A further qualifier.
         """
-        if num is not None:
+        if num:
             name = u'last directory %d' % num
         else:
             name = u'last directory'
         last_dir = self.get_config(name)
-        if last_dir is None:
+        if not last_dir:
             last_dir = u''
         return last_dir
 
@@ -185,7 +185,7 @@
         ``num``
             Defaults to *None*. A further qualifier.
         """
-        if num is not None:
+        if num:
             name = u'last directory %d' % num
         else:
             name = u'last directory'

=== modified file 'openlp/core/lib/pluginmanager.py'
--- openlp/core/lib/pluginmanager.py	2009-10-30 20:34:11 +0000
+++ openlp/core/lib/pluginmanager.py	2009-11-03 19:50:24 +0000
@@ -149,8 +149,9 @@
         for plugin in self.plugins:
             if plugin.status is not PluginStatus.Disabled:
                 plugin.settings_tab = plugin.get_settings_tab()
-                if plugin.settings_tab is not None:
-                    log.debug(u'Inserting settings tab item from %s' % plugin.name)
+                if plugin.settings_tab:
+                    log.debug(u'Inserting settings tab item from %s' %
+                        plugin.name)
                     settingsform.addTab(plugin.name, plugin.settings_tab)
                 else:
                     log.debug(u'No tab settings in %s' % plugin.name)

=== modified file 'openlp/core/lib/renderer.py'
--- openlp/core/lib/renderer.py	2009-11-03 01:12:35 +0000
+++ openlp/core/lib/renderer.py	2009-11-03 19:50:24 +0000
@@ -59,7 +59,7 @@
         ``debug``
             The debug mode.
         """
-        self._debug=debug
+        self._debug = debug
 
     def set_theme(self, theme):
         """
@@ -76,7 +76,7 @@
         self.theme_name = theme.theme_name
         self._set_theme_font()
         if theme.background_type == u'image':
-            if theme.background_filename is not None:
+            if theme.background_filename:
                 self.set_bg_image(theme.background_filename)
 
     def set_bg_image(self, filename):
@@ -88,7 +88,7 @@
         """
         log.debug(u'set bg image %s', filename)
         self._bg_image_filename = unicode(filename)
-        if self._frame is not None:
+        if self._frame:
             self.scale_bg_image()
 
     def scale_bg_image(self):
@@ -128,13 +128,13 @@
         ``preview``
             Defaults to *False*. Whether or not to generate a preview.
         """
-        if preview == True:
+        if preview:
             self.bg_frame = None
         log.debug(u'set frame dest (frame) w %d h %d', frame_width,
             frame_height)
         self._frame = QtGui.QImage(frame_width, frame_height,
             QtGui.QImage.Format_ARGB32_Premultiplied)
-        if self._bg_image_filename is not None and self.bg_image is None:
+        if self._bg_image_filename and not self.bg_image:
             self.scale_bg_image()
         if self.bg_frame is None:
             self._generate_background_frame()
@@ -241,13 +241,13 @@
         """
         log.debug(u'generate_frame_from_lines - Start')
         bbox = self._render_lines_unaligned(lines, False)
-        if footer_lines is not None:
+        if footer_lines:
             bbox1 = self._render_lines_unaligned(footer_lines, True)
         # reset the frame. first time do not worry about what you paint on.
         self._frame = QtGui.QImage(self.bg_frame)
         x, y = self._correctAlignment(self._rect, bbox)
         bbox = self._render_lines_unaligned(lines, False, (x, y), True)
-        if footer_lines is not None:
+        if footer_lines:
             bbox = self._render_lines_unaligned(footer_lines, True,
                 (self._rect_footer.left(), self._rect_footer.top()), True)
         log.debug(u'generate_frame_from_lines - Finish')
@@ -305,7 +305,7 @@
             elif self._theme.background_type == u'image':
                 # image
                 painter.fillRect(self._frame.rect(), QtCore.Qt.black)
-                if self.bg_image is not None:
+                if self.bg_image:
                     painter.drawImage(0, 0, self.bg_image)
         painter.end()
         log.debug(u'render background End')
@@ -321,13 +321,13 @@
             Footer dimensions?
         """
         x = rect.left()
-        if int(self._theme.display_verticalAlign) == 0:
+        if self._theme.display_verticalAlign == 0:
             # top align
             y = rect.top()
-        elif int(self._theme.display_verticalAlign) == 2:
+        elif self._theme.display_verticalAlign == 2:
             # bottom align
             y = rect.bottom() - bbox.height()
-        elif int(self._theme.display_verticalAlign) == 1:
+        elif self._theme.display_verticalAlign == 1:
             # centre align
             y = rect.top() + (rect.height() - bbox.height()) / 2
         else:
@@ -571,5 +571,5 @@
             Defaults to *None*. Another image to save to disk.
         """
         image.save(u'renderer.png', u'png')
-        if image2 is not None:
+        if image2:
             image2.save(u'renderer2.png', u'png')

=== modified file 'openlp/core/lib/rendermanager.py'
--- openlp/core/lib/rendermanager.py	2009-10-24 07:22:44 +0000
+++ openlp/core/lib/rendermanager.py	2009-11-03 19:50:24 +0000
@@ -121,7 +121,7 @@
             else:
                 self.theme = self.service_theme
         else:
-            if theme is not None:
+            if theme:
                 self.theme = theme
             elif self.global_style == u'Song' or \
                 self.global_style == u'Service':
@@ -139,17 +139,19 @@
             self.renderer.set_theme(self.themedata)
             self.build_text_rectangle(self.themedata)
         #Replace the backgrount image from renderer with one from image
-        if self.override_background is not None:
+        if self.override_background:
             if self.save_bg_frame is None:
                 self.save_bg_frame = self.renderer.bg_frame
             if self.override_background_changed:
-                self.renderer.bg_frame = self.resize_image(self.override_background)
+                self.renderer.bg_frame = self.resize_image(
+                    self.override_background)
                 self.override_background_changed = False
         else:
             if self.override_background_changed:
-                self.renderer.bg_frame = self.resize_image(self.override_background)
+                self.renderer.bg_frame = self.resize_image(
+                    self.override_background)
                 self.override_background_changed = False
-            if self.save_bg_frame is not None:
+            if self.save_bg_frame:
                 self.renderer.bg_frame = self.save_bg_frame
                 self.save_bg_frame = None
 
@@ -164,14 +166,14 @@
         log.debug(u'build_text_rectangle')
         main_rect = None
         footer_rect = None
-        if theme.font_main_override == False:
+        if not theme.font_main_override:
             main_rect = QtCore.QRect(10, 0, self.width - 1,
                 self.footer_start - 20)
         else:
             main_rect = QtCore.QRect(int(theme.font_main_x),
                 int(theme.font_main_y), int(theme.font_main_width)-1,
                 int(theme.font_main_height) - 1)
-        if theme.font_footer_override == False:
+        if not theme.font_footer_override:
             footer_rect = QtCore.QRect(10,self.footer_start, self.width - 1,
                 self.height-self.footer_start)
         else:

=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py	2009-11-01 16:06:59 +0000
+++ openlp/core/lib/serviceitem.py	2009-11-03 19:50:24 +0000
@@ -57,7 +57,7 @@
             The plugin that this service item belongs to.
         """
         self.plugin = hostplugin
-        if hostplugin is not None:
+        if hostplugin:
             self.RenderManager = self.plugin.render_manager
             self.shortname = hostplugin.name
             self.name = self.plugin.name

=== modified file 'openlp/core/lib/themexmlhandler.py'
--- openlp/core/lib/themexmlhandler.py	2009-10-23 16:10:09 +0000
+++ openlp/core/lib/themexmlhandler.py	2009-11-03 19:50:24 +0000
@@ -91,7 +91,7 @@
         ``path``
             The path name to be added.
         """
-        if self.background_filename is not None and path is not None:
+        if self.background_filename and path:
             self.theme_name = self.theme_name.rstrip().lstrip()
             self.background_filename = self.background_filename.rstrip().lstrip()
             self.background_filename = os.path.join(path, self.theme_name,
@@ -371,7 +371,7 @@
                         else:
                             setattr(self, field, e[1])
             else:
-                if element.tag is not None:
+                if element.tag:
                     field = master + element.tag
                     if element.text == u'True' or element.text == u'False':
                         setattr(self, field, str_to_bool(element.text))

=== modified file 'openlp/core/lib/toolbar.py'
--- openlp/core/lib/toolbar.py	2009-10-19 16:18:32 +0000
+++ openlp/core/lib/toolbar.py	2009-11-03 19:50:24 +0000
@@ -68,12 +68,12 @@
             The name of the object, as used in `<button>.setObjectName()`.
         """
         ButtonIcon = buildIcon(icon)
-        if ButtonIcon is not None:
-            if slot is not None:
+        if ButtonIcon:
+            if slot:
                 ToolbarButton = self.addAction(ButtonIcon, title, slot)
             else:
                 ToolbarButton = self.addAction(ButtonIcon, title)
-            if tooltip is not None:
+            if tooltip:
                 ToolbarButton.setToolTip(tooltip)
             self.icons[title] = ButtonIcon
             self.actions[title] = ToolbarButton

=== modified file 'openlp/core/ui/amendthemeform.py'
--- openlp/core/ui/amendthemeform.py	2009-10-30 21:47:15 +0000
+++ openlp/core/ui/amendthemeform.py	2009-11-03 19:50:24 +0000
@@ -545,12 +545,12 @@
         self.FontFooterColorPushButton.setStyleSheet(
             u'background-color: %s' % unicode(theme.font_footer_color))
 
-        if self.theme.font_main_override == False:
+        if not self.theme.font_main_override:
             self.FontMainDefaultCheckBox.setChecked(True)
         else:
             self.FontMainDefaultCheckBox.setChecked(False)
 
-        if self.theme.font_footer_override == False:
+        if not self.theme.font_footer_override:
             self.FontFooterDefaultCheckBox.setChecked(True)
         else:
             self.FontFooterDefaultCheckBox.setChecked(False)
@@ -635,7 +635,7 @@
                 self.GradientLabel.setVisible(False)
                 self.GradientComboBox.setVisible(False)
 
-        if theme.font_main_override == False:
+        if not theme.font_main_override:
             self.FontMainXSpinBox.setEnabled(False)
             self.FontMainYSpinBox.setEnabled(False)
             self.FontMainWidthSpinBox.setEnabled(False)
@@ -646,7 +646,7 @@
             self.FontMainWidthSpinBox.setEnabled(True)
             self.FontMainHeightSpinBox.setEnabled(True)
 
-        if theme.font_footer_override == False:
+        if not theme.font_footer_override:
             self.FontFooterXSpinBox.setEnabled(False)
             self.FontFooterYSpinBox.setEnabled(False)
             self.FontFooterWidthSpinBox.setEnabled(False)

=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py	2009-11-03 00:04:41 +0000
+++ openlp/core/ui/maindisplay.py	2009-11-03 19:50:24 +0000
@@ -208,7 +208,7 @@
             self.display.setPixmap(QtGui.QPixmap.fromImage(self.blankFrame))
         else:
             self.displayBlank = False
-            if self.frame is not None:
+            if self.frame:
                 self.frameView(self.frame)
         if self.parent.LiveController.blackPushButton.isChecked() != \
             self.displayBlank:

=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py	2009-11-01 09:07:10 +0000
+++ openlp/core/ui/mainwindow.py	2009-11-03 19:50:24 +0000
@@ -606,7 +606,7 @@
         """
         Hook to close the main window and display windows on exit
         """
-        if self.serviceNotSaved == True:
+        if self.serviceNotSaved:
             ret = QtGui.QMessageBox.question(None,
                 self.trUtf8(u'Save Changes to Service?'),
                 self.trUtf8(u'Your service has changed, do you want to save those changes?'),
@@ -655,7 +655,7 @@
             service_name = u'(unsaved service)'
         else:
             service_name = serviceName
-        if reset == True:
+        if reset:
             self.serviceNotSaved = False
             title = u'%s - %s' % (self.mainTitle, service_name)
         else:

=== modified file 'openlp/core/ui/mediadockmanager.py'
--- openlp/core/ui/mediadockmanager.py	2009-10-30 20:34:11 +0000
+++ openlp/core/ui/mediadockmanager.py	2009-11-03 19:50:24 +0000
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expanddock textwidth=80 dockstop=4 softdockstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
 
 ###############################################################################
 # OpenLP - Open Source Lyrics Projection                                      #
@@ -54,7 +54,7 @@
     def remove_dock(self, name):
         log.debug(u'remove %s dock' % name)
         for dock_index in range(0, self.media_dock.count()):
-            if self.media_dock.widget(dock_index) is not None:
+            if self.media_dock.widget(dock_index):
                 if self.media_dock.widget(dock_index).ConfigSection == name:
                     self.media_dock.widget(dock_index).hide()
                     self.media_dock.removeItem(dock_index)

=== modified file 'openlp/core/ui/pluginform.py'
--- openlp/core/ui/pluginform.py	2009-10-30 20:34:11 +0000
+++ openlp/core/ui/pluginform.py	2009-11-03 19:50:24 +0000
@@ -71,7 +71,7 @@
                 status_text = 'Disabled'
             item.setText(u'%s (%s)' % (plugin.name, status_text))
             # If the plugin has an icon, set it!
-            if plugin.icon is not None:
+            if plugin.icon:
                 item.setIcon(plugin.icon)
             self.PluginListWidget.addItem(item)
 
@@ -101,13 +101,13 @@
             if plugin.name == plugin_name:
                 self.activePlugin = plugin
                 break
-        if self.activePlugin is not None:
+        if self.activePlugin:
             self._setDetails()
         else:
             self._clearDetails()
 
     def onStatusComboBoxChanged(self, status):
-        if self.programaticChange is True:
+        if self.programaticChange:
             self.programaticChange = False
             return
         self.activePlugin.toggle_status(status)

=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py	2009-11-03 18:39:58 +0000
+++ openlp/core/ui/servicemanager.py	2009-11-03 19:50:24 +0000
@@ -247,7 +247,7 @@
                 serviceIterator.setSelected(False)
             if serviceIterator.isSelected():
                 #We are on the first record
-                if tempItem is not None:
+                if tempItem:
                     tempItem.setSelected(True)
                     serviceIterator.setSelected(False)
             else:

=== modified file 'openlp/core/ui/settingsform.py'
--- openlp/core/ui/settingsform.py	2009-10-29 13:00:48 +0000
+++ openlp/core/ui/settingsform.py	2009-11-03 19:50:24 +0000
@@ -54,12 +54,13 @@
     def insertTab(self, tab, location):
         log.debug(u'Inserting %s tab' % tab.tabTitle)
         #13 : There are 3 tables currently and locations starts at -10
-        self.SettingsTabWidget.insertTab(location + 13, tab, tab.tabTitleVisible)
+        self.SettingsTabWidget.insertTab(
+            location + 13, tab, tab.tabTitleVisible)
 
     def removeTab(self, name):
         log.debug(u'remove %s tab' % name)
         for tab_index in range(0, self.SettingsTabWidget.count()):
-            if self.SettingsTabWidget.widget(tab_index) is not None:
+            if self.SettingsTabWidget.widget(tab_index):
                 if self.SettingsTabWidget.widget(tab_index).tabTitle == name:
                     self.SettingsTabWidget.removeTab(tab_index)
 

=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py	2009-11-03 06:15:35 +0000
+++ openlp/core/ui/slidecontroller.py	2009-11-03 19:50:24 +0000
@@ -302,7 +302,7 @@
                 str_to_bool(self.songsconfig.get_config(u'display songbar', True)):
                 for action in self.Songbar.actions:
                     self.Songbar.actions[action].setVisible(False)
-                if item.verse_order is not None:
+                if item.verse_order:
                     verses = item.verse_order.split(u' ')
                     for verse in verses:
                         try:
@@ -336,7 +336,7 @@
         """
         log.debug(u'addServiceItem')
         #If old item was a command tell it to stop
-        if self.commandItem is not None and \
+        if self.commandItem and \
             self.commandItem.service_item_type == ServiceItemType.Command:
             Receiver().send_message(u'%s_stop'% self.commandItem.name.lower())
         self.commandItem = item
@@ -358,7 +358,7 @@
         """
         Replacement item following a remote edit
         """
-        if self.commandItem is not None and \
+        if self.commandItem and \
             item.uuid == self.commandItem.uuid:
             self.addServiceManagerItem(item, self.PreviewListWidget.currentRow())
 
@@ -370,7 +370,7 @@
         """
         log.debug(u'addServiceManagerItem')
         #If old item was a command tell it to stop
-        if self.commandItem is not None and \
+        if self.commandItem and \
             self.commandItem.service_item_type == ServiceItemType.Command:
             Receiver().send_message(u'%s_stop'% self.commandItem.name.lower())
         self.commandItem = item
@@ -413,7 +413,7 @@
             self.PreviewListWidget.setItem(framenumber, 0, item)
             if slide_height != 0:
                 self.PreviewListWidget.setRowHeight(framenumber, slide_height)
-        if self.serviceitem.frames[0][u'text'] is not None:
+        if self.serviceitem.frames[0][u'text']:
             self.PreviewListWidget.resizeRowsToContents()
         self.PreviewListWidget.setColumnWidth(
             0, self.PreviewListWidget.viewport().size().width())
@@ -433,7 +433,7 @@
         """
         Go to the first slide.
         """
-        if self.commandItem is not None and \
+        if self.commandItem and \
             self.commandItem.service_item_type == ServiceItemType.Command:
             Receiver().send_message(u'%s_first'% self.commandItem.name.lower())
             QtCore.QTimer.singleShot(0.5, self.grabMainDisplay)
@@ -445,7 +445,7 @@
         """
         Blank the screen.
         """
-        if self.commandItem is not None and \
+        if self.commandItem and \
             self.commandItem.service_item_type == ServiceItemType.Command:
             if blanked:
                 Receiver().send_message(u'%s_blank'% self.commandItem.name.lower())
@@ -499,7 +499,7 @@
         """
         Go to the next slide.
         """
-        if self.commandItem is not None and \
+        if self.commandItem and \
             self.commandItem.service_item_type == ServiceItemType.Command:
             Receiver().send_message(u'%s_next'% self.commandItem.name.lower())
             QtCore.QTimer.singleShot(0.5, self.grabMainDisplay)
@@ -514,7 +514,7 @@
         """
         Go to the previous slide.
         """
-        if self.commandItem is not None and \
+        if self.commandItem and \
             self.commandItem.service_item_type == ServiceItemType.Command:
             Receiver().send_message(
                 u'%s_previous'% self.commandItem.name.lower())
@@ -530,7 +530,7 @@
         """
         Go to the last slide.
         """
-        if self.commandItem is not None and \
+        if self.commandItem and \
             self.commandItem.service_item_type == ServiceItemType.Command:
             Receiver().send_message(u'%s_last'% self.commandItem.name.lower())
             QtCore.QTimer.singleShot(0.5, self.grabMainDisplay)

=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py	2009-10-29 13:58:03 +0000
+++ openlp/core/ui/thememanager.py	2009-11-03 19:50:24 +0000
@@ -148,17 +148,18 @@
 
     def onEditTheme(self):
         item = self.ThemeListWidget.currentItem()
-        if item is not None:
+        if item:
             self.amendThemeForm.loadTheme(
                 unicode(item.data(QtCore.Qt.UserRole).toString()))
-            self.saveThemeName = unicode(item.data(QtCore.Qt.UserRole).toString())
+            self.saveThemeName = unicode(
+                item.data(QtCore.Qt.UserRole).toString())
             self.amendThemeForm.exec_()
 
     def onDeleteTheme(self):
         self.global_theme = unicode(
             self.config.get_config(u'theme global theme', u''))
         item = self.ThemeListWidget.currentItem()
-        if item is not None:
+        if item:
             theme = unicode(item.text())
             # should be the same unless default
             if theme != unicode(item.data(QtCore.Qt.UserRole).toString()):
@@ -275,7 +276,7 @@
 
     def checkThemesExists(self, dir):
         log.debug(u'check themes')
-        if os.path.exists(dir) == False:
+        if not os.path.exists(dir):
             os.mkdir(dir)
 
     def unzipTheme(self, filename, dir):
@@ -299,7 +300,7 @@
         for file in zip.namelist():
             if file.endswith(os.path.sep):
                 theme_dir = os.path.join(dir, file)
-                if os.path.exists(theme_dir) == False:
+                if not os.path.exists(theme_dir):
                     os.mkdir(os.path.join(dir, file))
             else:
                 fullpath = os.path.join(dir, file)
@@ -386,7 +387,7 @@
         """
         log.debug(u'saveTheme %s %s', name, theme_xml)
         theme_dir = os.path.join(self.path, name)
-        if os.path.exists(theme_dir) == False:
+        if not os.path.exists(theme_dir):
             os.mkdir(os.path.join(self.path, name))
         theme_file = os.path.join(theme_dir, name + u'.xml')
         log.debug(theme_file)
@@ -406,7 +407,7 @@
             outfile = open(theme_file, u'w')
             outfile.write(theme_pretty_xml)
             outfile.close()
-            if image_from is not None and image_from != image_to:
+            if image_from and image_from != image_to:
                 print "if", image_from
                 print "it", image_to
                 shutil.copyfile(image_from, image_to)

=== modified file 'openlp/core/utils/confighelper.py'
--- openlp/core/utils/confighelper.py	2009-09-29 02:54:32 +0000
+++ openlp/core/utils/confighelper.py	2009-11-03 19:50:24 +0000
@@ -57,7 +57,7 @@
         if reg.has_value(section, key):
             return reg.get_value(section, key, default)
         else:
-            if default is not None:
+            if default:
                 ConfigHelper.set_config(section, key, default)
             return default
 

=== modified file 'openlp/plugins/bibles/bibleplugin.py'
--- openlp/plugins/bibles/bibleplugin.py	2009-10-30 20:34:11 +0000
+++ openlp/plugins/bibles/bibleplugin.py	2009-11-03 19:50:24 +0000
@@ -85,7 +85,7 @@
         self.ExportBibleItem.setVisible(False)
 
     def onBibleNewClick(self):
-        if self.media_item is not None:
+        if self.media_item:
             self.media_item.onNewClick()
 
     def about(self):

=== modified file 'openlp/plugins/bibles/forms/bibleimportform.py'
--- openlp/plugins/bibles/forms/bibleimportform.py	2009-10-29 06:45:37 +0000
+++ openlp/plugins/bibles/forms/bibleimportform.py	2009-11-03 19:50:24 +0000
@@ -199,7 +199,7 @@
 
     def onImportButtonClicked(self):
         message = self.trUtf8(u'Bible import completed')
-        if self.biblemanager is not None:
+        if self.biblemanager:
             if not self.bible_type is None and \
                 len(self.BibleNameEdit.displayText()) > 0:
                 self.MessageLabel.setText(self.trUtf8(u'Import Started'))
@@ -208,7 +208,7 @@
                 self.ProgressBar.setValue(0)
                 self.biblemanager.process_dialog(self)
                 status, msg = self.importBible()
-                if msg is not None:
+                if msg:
                     message = msg
                 self.MessageLabel.setText(message)
                 self.ProgressBar.setValue(self.barmax)

=== modified file 'openlp/plugins/bibles/lib/bibleCSVimpl.py'
--- openlp/plugins/bibles/lib/bibleCSVimpl.py	2009-09-28 20:45:04 +0000
+++ openlp/plugins/bibles/lib/bibleCSVimpl.py	2009-11-03 19:50:24 +0000
@@ -44,17 +44,17 @@
             QtCore.SIGNAL(u'openlpstopimport'), self.stop_import)
 
     def stop_import(self):
-        self.loadbible= False
+        self.loadbible = False
 
     def load_data(self, booksfile, versesfile, dialogobject):
         #Populate the Tables
-        fbooks=open(booksfile, 'r')
-        fverse=open(versesfile, 'r')
+        fbooks = open(booksfile, 'r')
+        fverse = open(versesfile, 'r')
 
         count = 0
         for line in fbooks:
             # cancel pressed
-            if self.loadbible == False:
+            if not self.loadbible:
                 break
             details = chardet.detect(line)
             line = unicode(line, details['encoding'])
@@ -72,7 +72,7 @@
         count = 0
         book_ptr = None
         for line in fverse:
-            if self.loadbible == False:  # cancel pressed
+            if not self.loadbible:  # cancel pressed
                 break
             details = chardet.detect(line)
             line = unicode(line, details['encoding'])

=== modified file 'openlp/plugins/bibles/lib/bibleDBimpl.py'
--- openlp/plugins/bibles/lib/bibleDBimpl.py	2009-10-24 05:58:49 +0000
+++ openlp/plugins/bibles/lib/bibleDBimpl.py	2009-11-03 19:50:24 +0000
@@ -160,7 +160,7 @@
             everse)
         #Look up book name or abbreviation
         book = self.get_bible_book(bookname)
-        if book is not None:
+        if book:
             bookname = book.name
             log.debug(u'bookname corrected to  %s' % bookname)
         verses = self.session.query(Verse).join(Book).filter(

=== modified file 'openlp/plugins/bibles/lib/bibleOSISimpl.py'
--- openlp/plugins/bibles/lib/bibleOSISimpl.py	2009-10-24 16:40:36 +0000
+++ openlp/plugins/bibles/lib/bibleOSISimpl.py	2009-11-03 19:50:24 +0000
@@ -96,7 +96,7 @@
         testament = 1
         for file_record in osis.readlines():
             # cancel pressed on UI
-            if self.loadbible == False:
+            if not self.loadbible:
                 break
             pos = file_record.find(verseText)
             # we have a verse

=== modified file 'openlp/plugins/bibles/lib/common.py'
--- openlp/plugins/bibles/lib/common.py	2009-10-27 16:55:09 +0000
+++ openlp/plugins/bibles/lib/common.py	2009-11-03 19:50:24 +0000
@@ -97,7 +97,7 @@
             The URL of a proxy server used to access the Internet.
         """
         log.debug(u'get_web_text %s %s', proxyurl, urlstring)
-        if proxyurl is not None:
+        if proxyurl:
             proxy_support = urllib2.ProxyHandler({'http': self.proxyurl})
             http_support = urllib2.HTTPHandler()
             opener = urllib2.build_opener(proxy_support, http_support)

=== modified file 'openlp/plugins/bibles/lib/manager.py'
--- openlp/plugins/bibles/lib/manager.py	2009-10-30 19:29:02 +0000
+++ openlp/plugins/bibles/lib/manager.py	2009-11-03 19:50:24 +0000
@@ -97,7 +97,7 @@
                 # look to see if lazy load bible exists and get create getter.
                 meta = self.bible_db_cache[bname].get_meta(u'proxy')
                 proxy = None
-                if meta is not None:
+                if meta:
                     proxy = meta.value
                     # tell The Server where to get the verses from.
                 nhttp.set_proxy(proxy)
@@ -173,14 +173,14 @@
             nbible.save_meta(u'WEB', biblesource)
             # store the web id of the bible
             nbible.save_meta(u'bibleid', bibleid)
-            if proxyurl is not None and proxyurl != u'':
+            if proxyurl and proxyurl != u'':
                 # store the proxy URL
                 nbible.save_meta(u'proxy', proxyurl)
                 nhttp.set_proxy(proxyurl)
-            if proxyid is not None and proxyid != u'':
+            if proxyid and proxyid != u'':
                 # store the proxy userid
                 nbible.save_meta(u'proxyid', proxyid)
-            if proxypass is not None and proxypass != u'':
+            if proxypass and proxypass != u'':
                 # store the proxy password
                 nbible.save_meta(u'proxypass', proxypass)
             return True
@@ -247,7 +247,7 @@
         log.debug(u'get_bibles')
         bible_list = []
         for bible_name, bible_object in self.bible_db_cache.iteritems():
-            if self.bible_http_cache[bible_name] is not None:
+            if self.bible_http_cache[bible_name]:
                 bible_name = u'%s (%s)' % (bible_name, self.web)
             bible_list.append(bible_name)
         return bible_list
@@ -338,13 +338,14 @@
         # check to see if book/chapter exists fow HTTP bibles and load cache
         # if necessary
         web, bible = self.is_bible_web(bible)
-        if self.bible_http_cache[bible] is not None:
+        if self.bible_http_cache[bible]:
             book = self.bible_db_cache[bible].get_bible_book(bookname)
             if book is None:
                 log.debug(u'get_verse_text : new book')
                 for chapter in range(schapter, echapter + 1):
                     self.media.setQuickMessage(
-                        unicode(self.media.trUtf8(u'Downloading %s: %s')) % (bookname, chapter))
+                        unicode(self.media.trUtf8(u'Downloading %s: %s')) %
+                            (bookname, chapter))
                     search_results = \
                         self.bible_http_cache[bible].get_bible_chapter(
                             bible, bookname, chapter)

=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py	2009-10-30 17:44:16 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py	2009-11-03 19:50:24 +0000
@@ -380,7 +380,7 @@
                 bible, text)
         else:
             self.searchByReference(bible, text)
-        if self.search_results is not None:
+        if self.search_results:
             self.displayResults(bible)
 
     def generateSlideData(self, service_item):
@@ -518,9 +518,9 @@
             bible_verse.setData(QtCore.Qt.UserRole,
                 QtCore.QVariant(bible_text))
             self.ListView.addItem(bible_verse)
-            cr = self.ListView.setCurrentRow(count)
-            if cr is not None:
-                cr.setSelected(True)
+            row = self.ListView.setCurrentRow(count)
+            if row:
+                row.setSelected(True)
 
     def searchByReference(self, bible, search):
         log.debug(u'searchByReference %s, %s', bible, search)

=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
--- openlp/plugins/custom/lib/mediaitem.py	2009-10-30 17:44:16 +0000
+++ openlp/plugins/custom/lib/mediaitem.py	2009-11-03 19:50:24 +0000
@@ -90,14 +90,14 @@
 
     def onRemoteEdit(self, item_id):
         valid = self.parent.custommanager.get_custom(item_id)
-        if valid is not None:
+        if valid:
             self.fromServiceManager = item_id
             self.parent.edit_custom_form.loadCustom(item_id)
             self.parent.edit_custom_form.exec_()
 
     def onEditClick(self):
         item = self.ListView.currentItem()
-        if item is not None:
+        if item:
             item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
             self.parent.edit_custom_form.loadCustom(item_id)
             self.parent.edit_custom_form.exec_()
@@ -105,7 +105,7 @@
 
     def onDeleteClick(self):
         item = self.ListView.currentItem()
-        if item is not None:
+        if item:
             item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
             self.parent.custommanager.delete_custom(item_id)
             row = self.ListView.row(item)
@@ -137,7 +137,7 @@
         for verse in verseList:
             raw_slides.append(verse[1])
         raw_footer.append(title + u' '+ credit)
-        if theme is not None:
+        if theme:
             service_item.title = title
             for slide in raw_slides:
                 service_item.add_from_text(slide[:30], slide)

=== modified file 'openlp/plugins/images/lib/mediaitem.py'
--- openlp/plugins/images/lib/mediaitem.py	2009-11-03 01:12:35 +0000
+++ openlp/plugins/images/lib/mediaitem.py	2009-11-03 19:50:24 +0000
@@ -76,7 +76,7 @@
         self.ListView.setIconSize(QtCore.QSize(88,50))
         self.servicePath = os.path.join(
             self.parent.config.get_data_path(), u'.thumbnails')
-        if os.path.exists(self.servicePath) == False:
+        if not os.path.exists(self.servicePath):
             os.mkdir(self.servicePath)
         self.loadList(self.parent.config.load_list(self.ConfigSection))
 
@@ -113,7 +113,7 @@
 
     def onDeleteClick(self):
         item = self.ListView.currentItem()
-        if item is not None:
+        if item:
             try:
                 os.remove(os.path.join(self.servicePath, unicode(item.text())))
             except:
@@ -141,16 +141,17 @@
 
     def generateSlideData(self, service_item):
         items = self.ListView.selectedIndexes()
-        if len(items) == 0:
+        if items:
+            service_item.title = self.trUtf8(u'Image(s)')
+            for item in items:
+                bitem = self.ListView.item(item.row())
+                filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString())
+                frame = QtGui.QImage(unicode(filename))
+                (path, name) = os.path.split(filename)
+                service_item.add_from_image(path, name, frame)
+            return True
+        else:
             return False
-        service_item.title = self.trUtf8(u'Image(s)')
-        for item in items:
-            bitem = self.ListView.item(item.row())
-            filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString())
-            frame = QtGui.QImage(unicode(filename))
-            (path, name) = os.path.split(filename)
-            service_item.add_from_image(path, name, frame)
-        return True
 
     def toggleOverrideState(self):
         self.overrideActive = not self.overrideActive

=== modified file 'openlp/plugins/media/lib/mediaitem.py'
--- openlp/plugins/media/lib/mediaitem.py	2009-11-03 01:38:15 +0000
+++ openlp/plugins/media/lib/mediaitem.py	2009-11-03 19:50:24 +0000
@@ -96,7 +96,7 @@
 
     def onDeleteClick(self):
         item = self.ListView.currentItem()
-        if item is not None:
+        if item:
             row = self.ListView.row(item)
             self.ListView.takeItem(row)
             self.parent.config.set_list(

=== modified file 'openlp/plugins/presentations/lib/impresscontroller.py'
--- openlp/plugins/presentations/lib/impresscontroller.py	2009-10-30 01:26:45 +0000
+++ openlp/plugins/presentations/lib/impresscontroller.py	2009-11-03 19:50:24 +0000
@@ -225,8 +225,8 @@
         Triggerent by new object being added to SlideController orOpenLP
         being shut down
         """
-        if self.document is not None:
-            if self.presentation is not None:
+        if self.document:
+            if self.presentation:
                 self.presentation.end()
                 self.presentation = None
             self.document.dispose()

=== modified file 'openlp/plugins/presentations/lib/mediaitem.py'
--- openlp/plugins/presentations/lib/mediaitem.py	2009-11-01 23:15:19 +0000
+++ openlp/plugins/presentations/lib/mediaitem.py	2009-11-03 19:50:24 +0000
@@ -121,7 +121,7 @@
 
     def onDeleteClick(self):
         item = self.ListView.currentItem()
-        if item is not None:
+        if item:
             row = self.ListView.row(item)
             self.ListView.takeItem(row)
             self.parent.config.set_list(
@@ -146,7 +146,7 @@
                 cont.load_presentation(filename)
             i = 1
             img = cont.get_slide_preview_file(i)
-            while img is not None:
+            while img:
                 service_item.add_from_command(path, name, img)
                 i = i + 1
                 img = cont.get_slide_preview_file(i)

=== modified file 'openlp/plugins/presentations/lib/messagelistener.py'
--- openlp/plugins/presentations/lib/messagelistener.py	2009-10-30 01:26:45 +0000
+++ openlp/plugins/presentations/lib/messagelistener.py	2009-11-03 19:50:24 +0000
@@ -86,7 +86,7 @@
         
     def slide(self, message):
         self.activate()
-        if message is not None:
+        if message:
             self.controller.goto_slide(message[0]+1)
             self.controller.poll_slidenumber()
 

=== modified file 'openlp/plugins/presentations/lib/pptviewcontroller.py'
--- openlp/plugins/presentations/lib/pptviewcontroller.py	2009-10-16 23:34:56 +0000
+++ openlp/plugins/presentations/lib/pptviewcontroller.py	2009-11-03 19:50:24 +0000
@@ -78,7 +78,7 @@
             """
             Loads the PPTVIEWLIB library
             """
-            if self.process is not None:
+            if self.process:
                 return
             log.debug(u'start PPTView')
             self.process = cdll.LoadLibrary(r'openlp\plugins\presentations\lib\pptviewlib\pptviewlib.dll')

=== modified file 'openlp/plugins/remotes/remoteclient-cli.py'
--- openlp/plugins/remotes/remoteclient-cli.py	2009-10-30 01:26:45 +0000
+++ openlp/plugins/remotes/remoteclient-cli.py	2009-11-03 19:50:24 +0000
@@ -69,7 +69,7 @@
     elif options.address is None:
         parser.print_help()
         parser.error("IP address missing")
-    elif options.slidenext is not None:
+    elif options.slidenext:
         options.event = u'next_slide'
         options.message = u''
         text = format_message(options)

=== modified file 'openlp/plugins/remotes/remoteplugin.py'
--- openlp/plugins/remotes/remoteplugin.py	2009-10-30 20:34:11 +0000
+++ openlp/plugins/remotes/remoteplugin.py	2009-11-03 19:50:24 +0000
@@ -55,7 +55,7 @@
     def finalise(self):
         log.debug(u'finalise')
         self.remove_toolbox_item()
-        if self.server is not None:
+        if self.server:
             self.server.close()
 
     def get_settings_tab(self):

=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py	2009-11-01 21:02:31 +0000
+++ openlp/plugins/songs/forms/editsongform.py	2009-11-03 19:50:24 +0000
@@ -183,7 +183,7 @@
                 # Not Found
                 id = 0
             self.SongbookCombo.setCurrentIndex(id)
-        if self.song.theme_name is not None and len(self.song.theme_name) > 0:
+        if self.song.theme_name:
             id = self.ThemeSelectionComboItem.findText(
                 unicode(self.song.theme_name), QtCore.Qt.MatchExactly)
             if id == -1:
@@ -193,20 +193,20 @@
             self.ThemeSelectionComboItem.setCurrentIndex(id)
         if len(title) > 1:
             self.AlternativeEdit.setText(title[1])
-        if self.song.copyright is not None:
+        if self.song.copyright:
             self.CopyrightEditItem.setText(self.song.copyright)
         else:
             self.CopyrightEditItem.setText(u'')
         self.VerseListWidget.clear()
-        if self.song.verse_order is not None:
+        if self.song.verse_order:
             self.VerseOrderEdit.setText(self.song.verse_order)
         else:
             self.VerseOrderEdit.setText(u'')
-        if self.song.comments is not None:
+        if self.song.comments:
             self.CommentsEdit.setPlainText(self.song.comments)
         else:
             self.CommentsEdit.setPlainText(u'')
-        if self.song.ccli_number is not None:
+        if self.song.ccli_number:
             self.CCLNumberEdit.setText(self.song.ccli_number)
         else:
             self.CCLNumberEdit.setText(u'')
@@ -311,7 +311,7 @@
 
     def onVerseEditButtonClicked(self):
         item = self.VerseListWidget.currentItem()
-        if item is not None:
+        if item:
             tempText = item.text()
             self.verse_form.setVerse(tempText)
             self.verse_form.exec_()

=== modified file 'openlp/plugins/songs/forms/songmaintenanceform.py'
--- openlp/plugins/songs/forms/songmaintenanceform.py	2009-10-24 16:40:36 +0000
+++ openlp/plugins/songs/forms/songmaintenanceform.py	2009-11-03 19:50:24 +0000
@@ -68,7 +68,7 @@
 
     def _getCurrentItemId(self, ListWidget):
         item = ListWidget.currentItem()
-        if item is not None:
+        if item:
             item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
             return item_id
         else:
@@ -79,9 +79,10 @@
         item_id = self._getCurrentItemId(list_widget)
         if item_id != -1:
             item = get_func(item_id)
-            if item is not None and len(item.songs) == 0:
+            if item and len(item.songs) == 0:
                 if QtGui.QMessageBox.warning(self, dlg_title, del_text,
-                        QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No | QtGui.QMessageBox.Yes)
+                        QtGui.QMessageBox.StandardButtons(
+                            QtGui.QMessageBox.No | QtGui.QMessageBox.Yes)
                         ) == QtGui.QMessageBox.Yes:
                     del_func(item.id)
                     reset_func()
@@ -96,7 +97,7 @@
         self.AuthorsListWidget.clear()
         authors = self.songmanager.get_authors()
         for author in authors:
-            if author.display_name is not None and author.display_name != u'':
+            if author.display_name:
                 author_name = QtGui.QListWidgetItem(author.display_name)
             else:
                 author_name = QtGui.QListWidgetItem(

=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py	2009-11-03 06:15:35 +0000
+++ openlp/plugins/songs/lib/mediaitem.py	2009-11-03 19:50:24 +0000
@@ -53,8 +53,8 @@
         self.edit_song_form = EditSongForm(self.parent.songmanager, self)
         self.song_maintenance_form = SongMaintenanceForm(
             self.parent.songmanager, self)
-        #Holds information about whether the edit is remotly triggered and which
-        #Song is required.
+        # Holds information about whether the edit is remotly triggered and
+        # which Song is required.
         self.remoteTriggered = None
         self.remoteSong = -1
 
@@ -254,7 +254,7 @@
         """
         fields = songid.split(u':')
         valid = self.parent.songmanager.get_song(fields[1])
-        if valid is not None:
+        if valid:
             self.remoteSong = fields[1]
             self.remoteTriggered = fields[0]
             self.edit_song_form.loadSong(fields[1], (fields[0] == u'P'))
@@ -262,14 +262,14 @@
 
     def onEditClick(self, preview=False):
         item = self.ListView.currentItem()
-        if item is not None:
+        if item:
             item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
             self.edit_song_form.loadSong(item_id, False)
             self.edit_song_form.exec_()
 
     def onDeleteClick(self):
         item = self.ListView.currentItem()
-        if item is not None:
+        if item:
             item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
             self.parent.songmanager.delete_song(item_id)
             row = self.ListView.row(item)
@@ -296,7 +296,7 @@
             songXML=SongXMLParser(song.lyrics)
             verseList = songXML.get_verses()
             for verse in verseList:
-                if verse[1] is not None:
+                if verse[1]:
                     service_item.add_from_text(verse[1][:30], verse[1])
         else:
             verses = song.lyrics.split(u'\n\n')

=== modified file 'openlp/plugins/songs/lib/songxml.py'
--- openlp/plugins/songs/lib/songxml.py	2009-09-25 23:06:54 +0000
+++ openlp/plugins/songs/lib/songxml.py	2009-11-03 19:50:24 +0000
@@ -85,7 +85,7 @@
     def from_buffer(self, xmlContent):
         """Initialize from buffer(string) with xml content"""
         self._reset()
-        if xmlContent is not None:
+        if xmlContent:
             self._setFromXml(xmlContent, 'song')
 
     def get_author_list(self):
@@ -95,7 +95,7 @@
         return as a string
         """
         res = []
-        if self.author is not None:
+        if self.author:
             lst = self.author.split(u' and ')
             for l in lst:
                 res.append(l.strip())
@@ -108,9 +108,9 @@
         return as a string
         """
         res = []
-        if self.theme is not None:
+        if self.theme:
             res.append(self.theme)
-        if self.alttheme is not None:
+        if self.alttheme:
             res.append(self.alttheme)
         s = u', u'.join(res)
         return s
@@ -264,13 +264,13 @@
         """Initialize from buffer(string) of xml lines in opensong format"""
         self._reset()
         opensong = _OpenSong(xmlcontent)
-        if opensong.title is not None:
+        if opensong.title:
             self.set_title(opensong.title)
-        if opensong.copyright is not None:
+        if opensong.copyright:
             self.set_copyright(opensong.copyright)
-        if opensong.presentation is not None:
+        if opensong.presentation:
             self.set_verse_order(opensong.presentation)
-        if opensong.ccli is not None:
+        if opensong.ccli:
             self.set_song_cclino(opensong.ccli)
         self.set_author_list(opensong.get_author_list())
         self.set_category_array(opensong.get_category_array())
@@ -402,7 +402,7 @@
     def _split_to_list(self, aString):
         """Split a string into a list - comma separated"""
         res = []
-        if aString is not None:
+        if aString:
             lst = aString.split(u',')
             for l in lst:
                 # remove whitespace


Follow ups