From e0875fa90e0335906e946d19b7cc370556628214 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 26 Feb 2010 20:22:34 +0000 Subject: [PATCH 1/5] Import fixes --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 73cecd97a..d6f4b7503 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,6 @@ #!/usr/bin/env python from setuptools import setup, find_packages -import sys, os VERSION_FILE = 'openlp/.version' From 2185f4e84271e61ee6cbb28617f8d0cbab9fe5a3 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 26 Feb 2010 23:47:59 +0000 Subject: [PATCH 2/5] Remove C-style semi-colons --- openlp/core/lib/__init__.py | 2 +- openlp/core/lib/renderer.py | 10 +++++----- openlp/core/ui/maindisplay.py | 2 +- openlp/core/ui/slidecontroller.py | 4 ++-- openlp/migration/display.py | 8 ++++---- openlp/migration/migratebibles.py | 4 ++-- openlp/migration/migratefiles.py | 18 +++++++++--------- .../presentations/lib/pptviewcontroller.py | 2 +- .../songs/forms/songmaintenancedialog.py | 8 ++++---- 9 files changed, 29 insertions(+), 29 deletions(-) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 93512f946..899b5cf73 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -146,7 +146,7 @@ def resize_image(image, width, height): preview = QtGui.QImage(image) preview = preview.scaled(width, height, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation) - realw = preview.width(); + 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) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index cc976dae5..03b53eca8 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -406,8 +406,8 @@ class Renderer(object): Defaults to *False*. Whether or not this is a live screen. """ x, y = tlcorner - maxx = self._rect.width(); - maxy = self._rect.height(); + maxx = self._rect.width() + maxy = self._rect.height() lines = [] lines.append(line) startx = x @@ -415,11 +415,11 @@ class Renderer(object): rightextent = None self.painter = QtGui.QPainter() self.painter.begin(self._frame) - self.painter.setRenderHint(QtGui.QPainter.Antialiasing); + self.painter.setRenderHint(QtGui.QPainter.Antialiasing) if self._theme.display_slideTransition: self.painter2 = QtGui.QPainter() self.painter2.begin(self._frameOp) - self.painter2.setRenderHint(QtGui.QPainter.Antialiasing); + self.painter2.setRenderHint(QtGui.QPainter.Antialiasing) self.painter2.setOpacity(0.7) # dont allow alignment messing with footers if footer: @@ -458,7 +458,7 @@ class Renderer(object): x = maxx - w # centre elif align == 2: - x = (maxx - w) / 2; + x = (maxx - w) / 2 rightextent = x + w if live: # now draw the text, and any outlines/shadows diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index bdb396498..2671732ec 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -65,7 +65,7 @@ class DisplayWidget(QtGui.QWidget): Receiver.send_message(u'live_slidecontroller_last') event.accept() elif event.key() in self.hotkey_map: - Receiver.send_message(self.hotkey_map[event.key()]); + Receiver.send_message(self.hotkey_map[event.key()]) event.accept() elif event.key() == QtCore.Qt.Key_Escape: self.resetDisplay() diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index e88699b71..c21afa4f5 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -31,7 +31,7 @@ from PyQt4 import QtCore, QtGui from PyQt4.phonon import Phonon from openlp.core.lib import OpenLPToolbar, Receiver, str_to_bool, \ -PluginConfig, resize_image + PluginConfig, resize_image class SlideList(QtGui.QTableWidget): """ @@ -63,7 +63,7 @@ class SlideList(QtGui.QTableWidget): self.parent.onSlideSelectedLast() event.accept() elif event.key() in self.hotkey_map and self.parent.isLive: - Receiver.send_message(self.hotkey_map[event.key()]); + Receiver.send_message(self.hotkey_map[event.key()]) event.accept() event.ignore() else: diff --git a/openlp/migration/display.py b/openlp/migration/display.py index 9a3f6e44e..f427c5fb6 100644 --- a/openlp/migration/display.py +++ b/openlp/migration/display.py @@ -32,11 +32,11 @@ class Display(): @staticmethod def output(string): - log.debug(string); - print (string) + log.debug(string) + #print (string) @staticmethod def sub_output(string): if not string is None: - log.debug(u' '+string); - print (u' '+string) \ No newline at end of file + log.debug(u' '+string) + #print (u' '+string) diff --git a/openlp/migration/migratebibles.py b/openlp/migration/migratebibles.py index 92504e907..f9e10b756 100644 --- a/openlp/migration/migratebibles.py +++ b/openlp/migration/migratebibles.py @@ -28,5 +28,5 @@ class MigrateBibles(): self.display = display def process(self): - self.display.output(u'Bible process started'); - self.display.output(u'Bible process finished'); \ No newline at end of file + self.display.output(u'Bible process started') + self.display.output(u'Bible process finished') \ No newline at end of file diff --git a/openlp/migration/migratefiles.py b/openlp/migration/migratefiles.py index 9c38fbb88..f1c9435ab 100644 --- a/openlp/migration/migratefiles.py +++ b/openlp/migration/migratefiles.py @@ -30,20 +30,20 @@ class MigrateFiles(): self.display = display def process(self): - self.display.output(u'Files process started'); + self.display.output(u'Files process started') self._initial_setup() - self.display.output(u'Files process finished'); + self.display.output(u'Files process finished') def _initial_setup(self): - self.display.output(u'Initial Setup started'); + self.display.output(u'Initial Setup started') ConfigHelper.get_data_path() - self.display.sub_output(u'Config created'); + self.display.sub_output(u'Config created') ConfigHelper.get_config(u'bible', u'data path') - self.display.sub_output(u'Config created'); + self.display.sub_output(u'Config created') ConfigHelper.get_config(u'videos', u'data path') - self.display.sub_output(u'videos created'); + self.display.sub_output(u'videos created') ConfigHelper.get_config(u'images', u'data path') - self.display.sub_output(u'images created'); + self.display.sub_output(u'images created') ConfigHelper.get_config(u'presentations', u'data path') - self.display.sub_output(u'presentations created'); - self.display.output(u'Initial Setup finished'); \ No newline at end of file + self.display.sub_output(u'presentations created') + self.display.output(u'Initial Setup finished') \ No newline at end of file diff --git a/openlp/plugins/presentations/lib/pptviewcontroller.py b/openlp/plugins/presentations/lib/pptviewcontroller.py index 2ed457fc0..56372e352 100644 --- a/openlp/plugins/presentations/lib/pptviewcontroller.py +++ b/openlp/plugins/presentations/lib/pptviewcontroller.py @@ -110,7 +110,7 @@ class PptviewController(PresentationController): rendermanager = self.plugin.render_manager rect = rendermanager.screens.current[u'size'] rect = RECT(rect.x(), rect.y(), rect.right(), rect.bottom()) - filepath = str(presentation.replace(u'/', u'\\')); + filepath = str(presentation.replace(u'/', u'\\')) try: self.pptid = self.process.OpenPPT(filepath, None, rect, str(os.path.join(self.thumbnailpath, self.thumbnailprefix))) diff --git a/openlp/plugins/songs/forms/songmaintenancedialog.py b/openlp/plugins/songs/forms/songmaintenancedialog.py index 5730e8c56..643676ff6 100644 --- a/openlp/plugins/songs/forms/songmaintenancedialog.py +++ b/openlp/plugins/songs/forms/songmaintenancedialog.py @@ -51,10 +51,10 @@ class Ui_SongMaintenanceDialog(object): self.TypeListWidget.sizePolicy().hasHeightForWidth()) self.TypeListWidget.setSizePolicy(sizePolicy) self.TypeListWidget.setViewMode(QtGui.QListView.IconMode) - self.TypeListWidget.setIconSize(QtCore.QSize(112, 100)); - self.TypeListWidget.setMovement(QtGui.QListView.Static); - self.TypeListWidget.setMaximumWidth(118); - self.TypeListWidget.setSpacing(0); + self.TypeListWidget.setIconSize(QtCore.QSize(112, 100)) + self.TypeListWidget.setMovement(QtGui.QListView.Static) + self.TypeListWidget.setMaximumWidth(118) + self.TypeListWidget.setSpacing(0) self.TypeListWidget.setSortingEnabled(False) self.TypeListWidget.setUniformItemSizes(True) self.TypeListWidget.setObjectName(u'TypeListWidget') From 80d54dc1be05a2582095203ad2827a254b22041e Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 27 Feb 2010 00:11:26 +0000 Subject: [PATCH 3/5] None tests --- openlp/core/ui/servicemanager.py | 2 +- openlp/plugins/presentations/lib/powerpointcontroller.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 22fbb7ecc..ab36660b4 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -694,7 +694,7 @@ class ServiceManager(QtGui.QWidget): if plugin == u'ServiceManager': startpos, startCount = self.findServiceItem() item = self.ServiceManagerList.itemAt(event.pos()) - if item == None: + if item is None: endpos = len(self.serviceItems) else: parentitem = item.parent() diff --git a/openlp/plugins/presentations/lib/powerpointcontroller.py b/openlp/plugins/presentations/lib/powerpointcontroller.py index a9775e086..4ac7ada66 100644 --- a/openlp/plugins/presentations/lib/powerpointcontroller.py +++ b/openlp/plugins/presentations/lib/powerpointcontroller.py @@ -150,7 +150,7 @@ class PowerpointController(PresentationController): Triggerent by new object being added to SlideController orOpenLP being shut down """ - if self.presentation == None: + if self.presentation is None: return try: self.presentation.Close() @@ -165,9 +165,9 @@ class PowerpointController(PresentationController): if not self.is_loaded(): return False try: - if self.presentation.SlideShowWindow == None: + if self.presentation.SlideShowWindow is None: return False - if self.presentation.SlideShowWindow.View == None: + if self.presentation.SlideShowWindow.View is None: return False except: return False From 132022205edc7aea4e74c5fcafa572f6be11f42c Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 4 Mar 2010 18:43:53 +0000 Subject: [PATCH 4/5] None tests redux --- openlp/plugins/presentations/lib/powerpointcontroller.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/presentations/lib/powerpointcontroller.py b/openlp/plugins/presentations/lib/powerpointcontroller.py index 64c435ebf..935fa9929 100644 --- a/openlp/plugins/presentations/lib/powerpointcontroller.py +++ b/openlp/plugins/presentations/lib/powerpointcontroller.py @@ -165,7 +165,7 @@ class PowerpointDocument(PresentationDocument): Triggerent by new object being added to SlideController orOpenLP being shut down """ - if self.presentation == None: + if self.presentation is None: return try: self.presentation.Close() @@ -181,9 +181,9 @@ class PowerpointDocument(PresentationDocument): if not self.controller.is_loaded(): return False try: - if self.presentation.SlideShowWindow == None: + if self.presentation.SlideShowWindow is None: return False - if self.presentation.SlideShowWindow.View == None: + if self.presentation.SlideShowWindow.View is None: return False except: return False From e40f1b41ef47e35d3119334cbd6bbe7c52afda6d Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Tue, 9 Mar 2010 19:43:11 +0000 Subject: [PATCH 5/5] Truth tests and some style fixes --- openlp/core/lib/mediamanageritem.py | 2 +- openlp/core/lib/renderer.py | 6 +++--- openlp/core/lib/themexmlhandler.py | 9 ++++---- openlp/core/ui/servicemanager.py | 6 +++--- openlp/core/ui/thememanager.py | 2 +- openlp/plugins/alerts/forms/alerteditform.py | 2 +- openlp/plugins/bibles/lib/http.py | 4 ++-- openlp/plugins/custom/forms/editcustomform.py | 2 +- openlp/plugins/custom/lib/mediaitem.py | 8 +++---- .../presentations/presentationplugin.py | 2 +- openlp/plugins/remotes/remoteclient.py | 2 +- openlp/plugins/songs/lib/songxml.py | 21 +++++++++---------- 12 files changed, 33 insertions(+), 33 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index ff87f0b0d..fd6d37ca6 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -314,7 +314,7 @@ class MediaManagerItem(QtGui.QWidget): self, self.OnNewPrompt, self.parent.config.get_last_dir(), self.OnNewFileMasks) log.info(u'New files(s)%s', unicode(files)) - if len(files) > 0: + if files: self.loadList(files) dir, filename = os.path.split(unicode(files[0])) self.parent.config.set_last_dir(dir) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 9b2d666ac..4ed0fcf76 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -174,7 +174,7 @@ class Renderer(object): #Must be a blank line so keep it. if len(line) == 0: line = u' ' - while len(line) > 0: + while line: pos = char_per_line split_text = line[:pos] #line needs splitting @@ -199,7 +199,7 @@ class Renderer(object): split_lines.append(split_text) line = line[pos:].lstrip() #if we have more text add up to 10 spaces on the front. - if len(line) > 0 and self._theme.font_main_indentation > 0: + if line and self._theme.font_main_indentation > 0: line = u'%s%s' % \ (u' '[:int(self._theme.font_main_indentation)], line) #Text fits in a line now @@ -210,7 +210,7 @@ class Renderer(object): len(page) == page_length: split_pages.append(page) page = [] - if len(page) > 0 and page != u' ': + if page and page != u' ': split_pages.append(page) return split_pages diff --git a/openlp/core/lib/themexmlhandler.py b/openlp/core/lib/themexmlhandler.py index 697c161e2..cbd46d597 100644 --- a/openlp/core/lib/themexmlhandler.py +++ b/openlp/core/lib/themexmlhandler.py @@ -171,7 +171,8 @@ class ThemeXML(object): self.child_element(background, u'filename', filename) def add_font(self, name, color, proportion, override, fonttype=u'main', - weight=u'Normal', italics=u'False', indentation=0, xpos=0, ypos=0, width=0, height=0): + weight=u'Normal', italics=u'False', indentation=0, xpos=0, ypos=0, + width=0, height=0): """ Add a Font. @@ -363,14 +364,14 @@ class ThemeXML(object): master = u'' for element in iter: element.text = unicode(element.text).decode('unicode-escape') - if len(element.getchildren()) > 0: + if element.getchildren(): master = element.tag + u'_' else: #background transparent tags have no children so special case if element.tag == u'background': for e in element.attrib.iteritems(): setattr(self, element.tag + u'_' + e[0], e[1]) - if len(element.attrib) > 0: + if element.attrib: for e in element.attrib.iteritems(): if master == u'font_' and e[0] == u'type': master += e[1] + u'_' @@ -402,4 +403,4 @@ class ThemeXML(object): 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) \ No newline at end of file + return u'\n'.join(theme_strings) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index b4ce85e5d..9afd07f51 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -428,7 +428,7 @@ class ServiceManager(QtGui.QWidget): for itemcount, item in enumerate(self.serviceItems): serviceitem = item[u'service_item'] treewidgetitem = QtGui.QTreeWidgetItem(self.ServiceManagerList) - if len(serviceitem.notes) > 0: + if serviceitem.notes: icon = QtGui.QImage(serviceitem.icon) icon = icon.scaled(80, 80, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation) @@ -601,7 +601,7 @@ class ServiceManager(QtGui.QWidget): def regenerateServiceItems(self): #force reset of renderer as theme data has changed self.parent.RenderManager.themedata = None - if len(self.serviceItems) > 0: + if self.serviceItems: tempServiceItems = self.serviceItems self.ServiceManagerList.clear() self.serviceItems = [] @@ -663,7 +663,7 @@ class ServiceManager(QtGui.QWidget): if str_to_bool(PluginConfig(u'General'). get_config(u'auto preview', u'False')): item += 1 - if len(self.serviceItems) > 0 and item < len(self.serviceItems) and \ + if self.serviceItems and item < len(self.serviceItems) and \ self.serviceItems[item][u'service_item'].autoPreviewAllowed: self.parent.PreviewController.addServiceManagerItem( self.serviceItems[item][u'service_item'], 0) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index b6396c7db..5cad41f58 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -246,7 +246,7 @@ class ThemeManager(QtGui.QWidget): self, self.trUtf8('Select Theme Import File'), self.config.get_last_dir(), u'Theme (*.*)') log.info(u'New Themes %s', unicode(files)) - if len(files) > 0: + if files: for file in files: self.config.set_last_dir(unicode(file)) self.unzipTheme(file, self.path) diff --git a/openlp/plugins/alerts/forms/alerteditform.py b/openlp/plugins/alerts/forms/alerteditform.py index 4abc8a660..62c129508 100644 --- a/openlp/plugins/alerts/forms/alerteditform.py +++ b/openlp/plugins/alerts/forms/alerteditform.py @@ -82,7 +82,7 @@ class AlertEditForm(QtGui.QDialog, Ui_AlertEditDialog): self.DeleteButton.setEnabled(False) def onItemSelected(self): - if len(self.AlertLineEdit.text()) > 0: + if self.AlertLineEdit.text(): QtGui.QMessageBox.information(self, self.trUtf8('Item selected to Edit'), self.trUtf8('Please Save or Clear seletced item')) diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index d00c1f88a..7c675dee9 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -77,7 +77,7 @@ class HTTPBooks(object): books = HTTPBooks.run_sql(u'SELECT id, testament_id, name, ' u'abbreviation, chapters FROM books WHERE name = ? OR ' u'abbreviation = ?', (name, name)) - if len(books) > 0: + if books: return { u'id': books[0][0], u'testament_id': books[0][1], @@ -95,7 +95,7 @@ class HTTPBooks(object): book = HTTPBooks.get_book(name) chapters = HTTPBooks.run_sql(u'SELECT id, book_id, chapter, ' u'verses FROM chapters WHERE book_id = ?', (book[u'id'],)) - if len(chapters) > 0: + if chapters: return { u'id': chapters[0][0], u'book_id': chapters[0][1], diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index 577142f23..b4402ceb3 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -254,7 +254,7 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): if self.VerseListView.count() == 0: self.VerseTextEdit.setFocus() return False, self.trUtf8('You need to enter a slide') - if len(self.VerseTextEdit.toPlainText()) > 0: + if self.VerseTextEdit.toPlainText(): self.VerseTextEdit.setFocus() return False, self.trUtf8('You have unsaved data') return True, u'' diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index 2a3090cf2..61d1b05d7 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -151,7 +151,7 @@ class CustomMediaItem(MediaManagerItem): service_item.edit_enabled = True service_item.editId = item_id theme = customSlide.theme_name - if len(theme) is not 0 : + if theme: service_item.theme = theme songXML = SongXMLParser(customSlide.text) verseList = songXML.get_verses() @@ -160,9 +160,9 @@ class CustomMediaItem(MediaManagerItem): service_item.title = title for slide in raw_slides: service_item.add_from_text(slide[:30], slide) - if str_to_bool(self.parent.config.get_config(u'display footer', True)) or \ - len(credit) > 0: - raw_footer.append(title + u' '+ credit) + if str_to_bool(self.parent.config.get_config(u'display footer', True)) \ + or credit: + raw_footer.append(title + u' ' + credit) else: raw_footer.append(u'') service_item.raw_footer = raw_footer diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 061eb737f..8353611ab 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -103,7 +103,7 @@ class PresentationPlugin(Plugin): self.registerControllers(controller) if controller.enabled: controller.start_process() - if len(self.controllers) > 0: + if self.controllers: return True else: return False diff --git a/openlp/plugins/remotes/remoteclient.py b/openlp/plugins/remotes/remoteclient.py index 6d1abe877..857a7fc7e 100755 --- a/openlp/plugins/remotes/remoteclient.py +++ b/openlp/plugins/remotes/remoteclient.py @@ -54,7 +54,7 @@ def main(): help="Message to be passed for the action") (options, args) = parser.parse_args() - if len(args) > 0: + if args: parser.print_help() parser.error("incorrect number of arguments") elif options.address is None: diff --git a/openlp/plugins/songs/lib/songxml.py b/openlp/plugins/songs/lib/songxml.py index 7d356d848..f9cef7fce 100644 --- a/openlp/plugins/songs/lib/songxml.py +++ b/openlp/plugins/songs/lib/songxml.py @@ -153,12 +153,12 @@ class _OpenSong(XmlRootClass): tmpVerse = [] finalLyrics = [] tag = "" - for l in lyrics: - line = l.rstrip() + for lyric in lyrics: + line = lyric.rstrip() if not line.startswith(u'.'): # drop all chords tmpVerse.append(line) - if len(line) > 0: + if line: if line.startswith(u'['): tag = line else: @@ -298,9 +298,9 @@ class Song(object): chars are: .,:;!?&%#/\@`$'|"^~*- """ punctuation = ".,:;!?&%#'\"/\\@`$|^~*-" - s = title - for c in punctuation: - s = s.replace(c, '') + string = title + for char in punctuation: + string = string.replace(char, '') return s def set_title(self, title): @@ -582,17 +582,16 @@ class Song(object): self.slideList = [] tmpSlide = [] metContent = False - for l in self.lyrics: - if len(l) > 0: + for lyric in self.lyrics: + if lyric: metContent = True - tmpSlide.append(l) + tmpSlide.append(lyric) else: if metContent: metContent = False self.slideList.append(tmpSlide) tmpSlide = [] - # - if len(tmpSlide) > 0: + if tmpSlide: self.slideList.append(tmpSlide) def get_number_of_slides(self):