Kaydet (Commit) 36638e6a authored tarafından Julien Nabet's avatar Julien Nabet

Python/pep8: fix E711 (is or is not None instead of = or !=) in letter module

Change-Id: Ic6ff028008aea87d1bf2126dccd2afb1bf3733d2
üst be487d6e
......@@ -560,8 +560,8 @@ class AgendaTemplate(TextDocument):
paraStyle = Range.ParaStyleName
Range.setString(text)
Range.ParaStyleName = paraStyle
if text == None or text == "":
if placeholder != None and not placeholder == "":
if text is None or text == "":
if placeholder is not None and not placeholder == "":
placeHolder = createPlaceHolder(
self.xTextDocument, placeholder,
self.resources.resPlaceHolderHint)
......
......@@ -60,7 +60,7 @@ class LetterDocument(TextDocument):
FH.updateDateFields()
def switchFooter(self, sPageStyle, bState, bPageNumber, sText):
if self.xTextDocument != None:
if self.xTextDocument is not None:
try:
self.xTextDocument.lockControllers()
xNameAccess = self.xTextDocument.StyleFamilies
......@@ -94,7 +94,7 @@ class LetterDocument(TextDocument):
traceback.print_exc()
def hasElement(self, sElement):
if self.xTextDocument != None:
if self.xTextDocument is not None:
SH = TextSectionHandler(self.xMSF, self.xTextDocument)
return SH.hasTextSectionByName(sElement)
else:
......@@ -137,31 +137,31 @@ class LetterDocument(TextDocument):
if not self.keepLogoFrame:
xTF = self.getFrameByName(
"Company Logo", self.xTextDocument)
if xTF != None:
if xTF is not None:
xTF.dispose()
if not self.keepBendMarksFrame:
xTF = self.getFrameByName(
"Bend Marks", self.xTextDocument)
if xTF != None:
if xTF is not None:
xTF.dispose()
if not self.keepLetterSignsFrame:
xTF = self.getFrameByName(
"Letter Signs", self.xTextDocument)
if xTF != None:
if xTF is not None:
xTF.dispose()
if not self.keepSenderAddressRepeatedFrame:
xTF = self.getFrameByName(
"Sender Address Repeated", self.xTextDocument)
if xTF != None:
if xTF is not None:
xTF.dispose()
if not self.keepAddressFrame:
xTF = self.getFrameByName(
"Sender Address", self.xTextDocument)
if xTF != None:
if xTF is not None:
xTF.dispose()
except Exception:
......
......@@ -427,7 +427,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
self.xDialogModel.numLogoY.Enabled = True
self.setPossibleLogo(False)
else:
if self.BusCompanyLogo != None:
if self.BusCompanyLogo is not None:
self.BusCompanyLogo.removeFrame()
self.xDialogModel.numLogoHeight.Enabled = False
......@@ -501,7 +501,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
self.setPossibleSenderData(False)
else:
if self.BusCompanyAddressReceiver != None:
if self.BusCompanyAddressReceiver is not None:
self.BusCompanyAddressReceiver.removeFrame()
self.setPossibleAddressReceiver(True)
......@@ -527,7 +527,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
self.xDialogModel.lblFooterHeight.Enabled = True
self.setPossibleFooter(False)
else:
if self.BusFooter != None:
if self.BusFooter is not None:
self.BusFooter.removeFrame()
self.xDialogModel.numFooterHeight.Enabled = False
......@@ -732,16 +732,16 @@ class LetterWizardDialogImpl(LetterWizardDialog):
BPaperItem = self.getRoadmapItemByID(
LetterWizardDialogImpl.RM_BUSINESSPAPER)
BPaperItem.Enabled = False
if self.BusCompanyLogo != None:
if self.BusCompanyLogo is not None:
self.BusCompanyLogo.removeFrame()
if self.BusCompanyAddress != None:
if self.BusCompanyAddress is not None:
self.BusCompanyAddress.removeFrame()
if self.BusFooter != None:
if self.BusFooter is not None:
self.BusFooter.removeFrame()
if self.BusCompanyAddressReceiver != None:
if self.BusCompanyAddressReceiver is not None:
self.BusCompanyAddressReceiver.removeFrame()
self.setPossibleAddressReceiver(True)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment