From 122756eca589ef700f54b5337805d9550ad9f805 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 24 May 2010 23:37:20 +0100 Subject: [PATCH] Fix indentations --- .bzrignore | 1 + openlp/core/lib/serviceitem.py | 12 ++++----- openlp/core/theme/theme.py | 13 +++++---- openlp/core/ui/servicemanager.py | 27 ++++++++++--------- openlp/core/ui/slidecontroller.py | 5 ++-- .../presentations/lib/impresscontroller.py | 8 +++--- .../presentations/lib/pptviewcontroller.py | 2 +- .../lib/presentationcontroller.py | 2 +- 8 files changed, 38 insertions(+), 32 deletions(-) diff --git a/.bzrignore b/.bzrignore index 2314d48c5..5d27a95a4 100644 --- a/.bzrignore +++ b/.bzrignore @@ -15,3 +15,4 @@ OpenLP.egg-info build resources/innosetup/Output _eric4project +.pylint.d diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index a25205c82..841e91839 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -43,12 +43,12 @@ class ServiceItemType(object): Command = 3 class ItemCapabilities(object): - AllowsPreview = 1 - AllowsEdit = 2 - AllowsMaintain = 3 - RequiresMedia = 4 - AllowsLoop = 5 - AllowsAdditions = 6 + AllowsPreview = 1 + AllowsEdit = 2 + AllowsMaintain = 3 + RequiresMedia = 4 + AllowsLoop = 5 + AllowsAdditions = 6 class ServiceItem(object): """ diff --git a/openlp/core/theme/theme.py b/openlp/core/theme/theme.py index b01126564..b34510fb7 100644 --- a/openlp/core/theme/theme.py +++ b/openlp/core/theme/theme.py @@ -136,12 +136,15 @@ class Theme(object): except ValueError: val = t if (element.tag.find(u'Color') > 0 or - (element.tag.find(u'BackgroundParameter') == 0 and type(val) == type(0))): + (element.tag.find(u'BackgroundParameter') == 0 and + type(val) == type(0))): # convert to a wx.Colour - if not delphiColorChange: - val = QtGui.QColor(val&0xFF, (val>>8)&0xFF, (val>>16)&0xFF) - else: - val = QtGui.QColor((val>>16)&0xFF, (val>>8)&0xFF, val&0xFF) + if not delphiColorChange: + val = QtGui.QColor( + val&0xFF, (val>>8)&0xFF, (val>>16)&0xFF) + else: + val = QtGui.QColor( + (val>>16)&0xFF, (val>>8)&0xFF, val&0xFF) setattr(self, element.tag, val) def __str__(self): diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index df127c85c..548d04357 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -810,8 +810,8 @@ class ServiceManager(QtGui.QWidget): if self.serviceItems and item < len(self.serviceItems) and \ self.serviceItems[item][u'service_item'].is_capable( ItemCapabilities.AllowsPreview): - self.parent.PreviewController.addServiceManagerItem( - self.serviceItems[item][u'service_item'], 0) + self.parent.PreviewController.addServiceManagerItem( + self.serviceItems[item][u'service_item'], 0) else: QtGui.QMessageBox.critical(self, self.trUtf8('Missing Display Handler'), @@ -897,17 +897,18 @@ class ServiceManager(QtGui.QWidget): #we are over somthing so lets investigate pos = self._getParentItemData(item) - 1 serviceItem = self.serviceItems[pos] - if plugin == serviceItem[u'service_item'].name \ - and serviceItem[u'service_item'].is_capable(ItemCapabilities.AllowsAdditions): - action = self.dndMenu.exec_(QtGui.QCursor.pos()) - #New action required - if action == self.newAction: - self.droppos = self._getParentItemData(item) - #Append to existing action - if action == self.addToAction: - self.droppos = self._getParentItemData(item) - item.setSelected(True) - replace = True + if (plugin == serviceItem[u'service_item'].name and + serviceItem[u'service_item'].is_capable( + ItemCapabilities.AllowsAdditions)): + action = self.dndMenu.exec_(QtGui.QCursor.pos()) + #New action required + if action == self.newAction: + self.droppos = self._getParentItemData(item) + #Append to existing action + if action == self.addToAction: + self.droppos = self._getParentItemData(item) + item.setSelected(True) + replace = True else: self.droppos = self._getParentItemData(item) Receiver.send_message(u'%s_add_service_item' % plugin, replace) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index a2bd68e13..f9dd89daf 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -426,11 +426,12 @@ class SlideController(QtGui.QWidget): self.Toolbar.makeWidgetsVisible([u'Song Menu']) if item.is_capable(ItemCapabilities.AllowsLoop) and \ len(item.get_frames()) > 1: - self.Toolbar.makeWidgetsVisible(self.loopList) + self.Toolbar.makeWidgetsVisible(self.loopList) if item.is_media(): self.Toolbar.setVisible(False) self.Mediabar.setVisible(True) - #self.volumeSlider.setAudioOutput(self.mainDisplay.videoDisplay.audio) + #self.volumeSlider.setAudioOutput( + # self.mainDisplay.videoDisplay.audio) def enablePreviewToolBar(self, item): """ diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index a1a025c02..d79062a2a 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -354,10 +354,10 @@ class ImpressDocument(PresentationDocument): self.control.gotoSlideIndex(slideno-1) def next_step(self): - """ - Triggers the next effect of slide on the running presentation - """ - self.control.gotoNextEffect() + """ + Triggers the next effect of slide on the running presentation + """ + self.control.gotoNextEffect() def previous_step(self): """ diff --git a/openlp/plugins/presentations/lib/pptviewcontroller.py b/openlp/plugins/presentations/lib/pptviewcontroller.py index e45fac45f..b4102f5fe 100644 --- a/openlp/plugins/presentations/lib/pptviewcontroller.py +++ b/openlp/plugins/presentations/lib/pptviewcontroller.py @@ -73,7 +73,7 @@ class PptviewController(PresentationController): self.start_process() return self.process.CheckInstalled() except: - return False + return False def start_process(self): """ diff --git a/openlp/plugins/presentations/lib/presentationcontroller.py b/openlp/plugins/presentations/lib/presentationcontroller.py index f976aa4e7..c0eb7e5f1 100644 --- a/openlp/plugins/presentations/lib/presentationcontroller.py +++ b/openlp/plugins/presentations/lib/presentationcontroller.py @@ -151,7 +151,7 @@ class PresentationController(object): if doc is None: return if doc in self.docs: - self.docs.remove(doc) + self.docs.remove(doc) def close_presentation(self): pass