clean-up: fix PEP8 E712 comparison to True should be 'if cond is True:' or 'if cond:'
--- a/editors/Viewer.py Thu Aug 17 09:55:39 2017 +0300
+++ b/editors/Viewer.py Thu Aug 17 10:04:24 2017 +0300
@@ -3714,11 +3714,11 @@
comment.Draw(dc)
for wire in self.Wires.iterkeys():
if wire != self.SelectedElement and (wire.IsVisible() or printing):
- if not self.Debug or wire.GetValue() != True:
+ if not self.Debug or not wire.GetValue():
wire.Draw(dc)
if self.Debug:
for wire in self.Wires.iterkeys():
- if wire != self.SelectedElement and (wire.IsVisible() or printing) and wire.GetValue() == True:
+ if wire != self.SelectedElement and (wire.IsVisible() or printing) and wire.GetValue():
wire.Draw(dc)
for block in self.Blocks.itervalues():
if block != self.SelectedElement and (block.IsVisible() or printing):
--- a/graphics/GraphicCommons.py Thu Aug 17 09:55:39 2017 +0300
+++ b/graphics/GraphicCommons.py Thu Aug 17 10:04:24 2017 +0300
@@ -2631,7 +2631,7 @@
scalex, scaley = dc.GetUserScale()
dc.SetUserScale(1, 1)
# If user trying to connect wire with wrong input, highlight will become red.
- if self.ErrHighlight == True and not (self.EndConnected):
+ if self.ErrHighlight and not (self.EndConnected):
highlightcolor = wx.RED
else:
highlightcolor = HIGHLIGHTCOLOR
--- a/plcopen/plcopen.py Thu Aug 17 09:55:39 2017 +0300
+++ b/plcopen/plcopen.py Thu Aug 17 10:04:24 2017 +0300
@@ -1678,7 +1678,7 @@
for variable in instance.inputVariables.getvariable():
connections = variable.connectionPointIn.getconnections()
if connections and len(connections) == 1:
- if (self.checkedBlocksDict.has_key(connections[0].getrefLocalId()) == False):
+ if not self.checkedBlocksDict.has_key(connections[0].getrefLocalId()):
self.compileelementExecutionOrder(connections[0])
if instance.getexecutionOrderId() == 0:
instance.setexecutionOrderId(self.getnewExecutionOrderId())
--- a/util/ProcessLogger.py Thu Aug 17 09:55:39 2017 +0300
+++ b/util/ProcessLogger.py Thu Aug 17 10:04:24 2017 +0300
@@ -124,7 +124,7 @@
"stderr": subprocess.PIPE
}
- if no_gui == True and wx.Platform == '__WXMSW__':
+ if no_gui and wx.Platform == '__WXMSW__':
self.startupinfo = subprocess.STARTUPINFO()
self.startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
popenargs["startupinfo"] = self.startupinfo
--- a/xmlclass/xmlclass.py Thu Aug 17 09:55:39 2017 +0300
+++ b/xmlclass/xmlclass.py Thu Aug 17 10:04:24 2017 +0300
@@ -598,7 +598,7 @@
"extract": ExtractTag,
"generate": GenerateTag,
"initial": lambda: None,
- "check": lambda x: x is None or infos["minOccurs"] == 0 and value == True
+ "check": lambda x: x is None or infos["minOccurs"] == 0 and value
}