clean-up: fix PEP8 E222 multiple spaces after operator
--- a/CodeFileTreeNode.py Wed Aug 16 17:27:58 2017 +0300
+++ b/CodeFileTreeNode.py Thu Aug 17 09:55:39 2017 +0300
@@ -197,9 +197,9 @@
def CTNGlobalInstances(self):
variables = self.CodeFileVariables(self.CodeFile)
- ret = [(variable.getname(),
+ ret = [(variable.getname(), for variable in variables]
ret.extend([("On"+variable.getname()+"Change", "python_poll", "")
for variable in variables
--- a/ConfigTreeNode.py Wed Aug 16 17:27:58 2017 +0300
+++ b/ConfigTreeNode.py Thu Aug 17 09:55:39 2017 +0300
@@ -452,12 +452,12 @@
while res in AllChannels: # While channel not free
if res < CurrentChannel: # Want to go down ?
- res -= 1 # Test for n-1
+ res -= 1 # Test for n-1 self.GetCTRoot().logger.write_warning(_("Cannot find lower free IEC channel than %d\n") % CurrentChannel)
return CurrentChannel # Can't go bellow 0, do nothing
- res += 1 # Test for n-1
+ res += 1 # Test for n-1 # Finally set IEC Channel
self.BaseParams.setIEC_Channel(res)
--- a/ProjectController.py Wed Aug 16 17:27:58 2017 +0300
+++ b/ProjectController.py Thu Aug 17 09:55:39 2017 +0300
@@ -1122,7 +1122,7 @@
- self.LocationCFilesAndCFLAGS = LibCFilesAndCFLAGS + CTNLocationCFilesAndCFLAGS
+ self.LocationCFilesAndCFLAGS = LibCFilesAndCFLAGS + CTNLocationCFilesAndCFLAGS self.LDFLAGS = CTNLDFLAGS + LibLDFLAGS
ExtraFiles = CTNExtraFiles + LibExtraFiles
--- a/controls/FolderTree.py Wed Aug 16 17:27:58 2017 +0300
+++ b/controls/FolderTree.py Thu Aug 17 09:55:39 2017 +0300
@@ -215,7 +215,7 @@
os.rename(old_filepath, new_filepath)
- message = wx.MessageDialog(self,
+ message = wx.MessageDialog(self, _("File '%s' already exists!") % new_name,
_("Error"), wx.OK | wx.ICON_ERROR)
--- a/controls/VariablePanel.py Wed Aug 16 17:27:58 2017 +0300
+++ b/controls/VariablePanel.py Thu Aug 17 09:55:39 2017 +0300
@@ -512,13 +512,15 @@
"Variables", " Local", " Temp"] #,"Access"]
# these condense the ColAlignements list
# Num Name Class Type Loc Init Option Doc
- self.ColSizes = [40, 80, 100, 80, 110, 120, 100, 160]
- self.ColAlignements = [center, left, left, left, left, left, left, left]
- self.ColFixedSizeFlag = [True, False, True, False, True, True, True, False]
+ "size": [40, 80, 100, 80, 110, 120, 100, 160], + "alignement": [center, left, left, left, left, left, left, left], + "fixed_size": [True, False, True, False, True, True, True, False], # this is an element that cannot have located variables
@@ -533,16 +535,18 @@
"Interface", " Input", " Output", " InOut", " External",
"Variables", " Local", " Temp"]
- # these condense the ColAlignements list
+ # these condense the alignements list # Num Name Class Type Init Option Doc
- self.ColSizes = [40, 80, 100, 80, 120, 100, 160]
- self.ColAlignements = [center, left, left, left, left, left, left]
- self.ColFixedSizeFlag = [True, False, True, False, True, True, False]
+ "size": [40, 80, 100, 80, 120, 100, 160], + "alignement": [center, left, left, left, left, left, left], + "fixed_size": [True, False, True, False, True, True, False], - self.PanelWidthMin = sum(self.ColSizes)
+ self.PanelWidthMin = sum(self.ColSettings["size"]) self.ElementType = element_type
@@ -654,22 +658,22 @@
if panel_width > self.PanelWidthMin:
stretch_cols_width = panel_width
- for col in range(len(self.ColFixedSizeFlag)):
- if self.ColFixedSizeFlag[col]:
- stretch_cols_width -= self.ColSizes[col]
+ for col in range(len(self.ColSettings["fixed_size"])): + if self.ColSettings["fixed_size"][col]: + stretch_cols_width -= self.ColSettings["size"][col] - stretch_cols_sum += self.ColSizes[col]
+ stretch_cols_sum += self.ColSettings["size"][col] self.VariablesGrid.SetRowLabelSize(0)
for col in range(self.Table.GetNumberCols()):
attr = wx.grid.GridCellAttr()
- attr.SetAlignment(self.ColAlignements[col], wx.ALIGN_CENTRE)
+ attr.SetAlignment(self.ColSettings["alignement"][col], wx.ALIGN_CENTRE) self.VariablesGrid.SetColAttr(col, attr)
- self.VariablesGrid.SetColMinimalWidth(col, self.ColSizes[col])
- if (panel_width > self.PanelWidthMin) and not self.ColFixedSizeFlag[col]:
- self.VariablesGrid.SetColSize(col, int((float(self.ColSizes[col])/stretch_cols_sum)*stretch_cols_width))
+ self.VariablesGrid.SetColMinimalWidth(col, self.ColSettings["size"][col]) + if (panel_width > self.PanelWidthMin) and not self.ColSettings["fixed_size"][col]: + self.VariablesGrid.SetColSize(col, int((float(self.ColSettings["size"][col])/stretch_cols_sum)*stretch_cols_width)) - self.VariablesGrid.SetColSize(col, self.ColSizes[col])
+ self.VariablesGrid.SetColSize(col, self.ColSettings["size"][col]) self.RefreshHighlightsTimer.Stop()
--- a/dialogs/DiscoveryDialog.py Wed Aug 16 17:27:58 2017 +0300
+++ b/dialogs/DiscoveryDialog.py Thu Aug 17 09:55:39 2017 +0300
@@ -227,10 +227,10 @@
info = self.ZeroConfInstance.getServiceInfo(_type, name)
- svcname = name.split(".")[0]
+ svcname = name.split(".")[0] typename = _type.split(".")[0][1:]
- ip = str(socket.inet_ntoa(info.getAddress()))
+ ip = str(socket.inet_ntoa(info.getAddress())) num_items = self.ServicesList.GetItemCount()
--- a/editors/ConfTreeNodeEditor.py Wed Aug 16 17:27:58 2017 +0300
+++ b/editors/ConfTreeNodeEditor.py Thu Aug 17 09:55:39 2017 +0300
@@ -298,7 +298,7 @@
def GenerateMethodButtonSizer(self):
- normal_bt_font = wx.Font(faces["size"] / 3, wx.DEFAULT, wx.NORMAL, wx.NORMAL, faceName=faces["helv"])
+ normal_bt_font = wx.Font(faces["size"] / 3, wx.DEFAULT, wx.NORMAL, wx.NORMAL, faceName=faces["helv"]) mouseover_bt_font = wx.Font(faces["size"] / 3, wx.DEFAULT, wx.NORMAL, wx.NORMAL, faceName=faces["helv"], underline=True)
msizer = wx.BoxSizer(wx.HORIZONTAL)
--- a/editors/TextViewer.py Wed Aug 16 17:27:58 2017 +0300
+++ b/editors/TextViewer.py Thu Aug 17 09:55:39 2017 +0300
@@ -545,7 +545,7 @@
level = self.Editor.GetFoldLevel(line_number - 1) & wx.stc.STC_FOLDLEVELNUMBERMASK
if level != wx.stc.STC_FOLDLEVELBASE:
- level |= wx.stc.STC_FOLDLEVELWHITEFLAG
+ level |= wx.stc.STC_FOLDLEVELWHITEFLAG elif LineStartswith(line, self.BlockStartKeywords):
level |= wx.stc.STC_FOLDLEVELHEADERFLAG
elif LineStartswith(line, self.BlockEndKeywords):
--- a/graphics/GraphicCommons.py Wed Aug 16 17:27:58 2017 +0300
+++ b/graphics/GraphicCommons.py Thu Aug 17 09:55:39 2017 +0300
@@ -1083,7 +1083,7 @@
if self.Edge == "rising" and self.Direction[1] == 1:
- rect = wx.Rect(x - abs(movex), y - abs(movey), width + 2 * abs(movex), height + 2 * abs(movey))
+ rect = wx.Rect(x - abs(movex), y - abs(movey), width + 2 * abs(movex), height + 2 * abs(movey)) if self.ValueSize is None and isinstance(self.ComputedValue, (StringType, UnicodeType)):
self.ValueSize = self.ParentBlock.Parent.GetMiniTextExtent(self.ComputedValue)
if self.ValueSize is not None:
--- a/graphics/SFC_Objects.py Wed Aug 16 17:27:58 2017 +0300
+++ b/graphics/SFC_Objects.py Thu Aug 17 09:55:39 2017 +0300
@@ -587,7 +587,7 @@
self.Size = wx.Size(SFC_TRANSITION_SIZE[0], SFC_TRANSITION_SIZE[1])
# Create an input and output connector
- self.Input = Connector(self, "", None, wx.Point(self.Size[0] / 2, 0), NORTH, onlyone=True)
+ self.Input = Connector(self, "", None, wx.Point(self.Size[0] / 2, 0), NORTH, onlyone=True) self.Output = Connector(self, "", None, wx.Point(self.Size[0] / 2, self.Size[1]), SOUTH, onlyone=True)
self.SetType(type, condition)
self.SetPriority(priority)
--- a/i18n/mki18n.py Wed Aug 16 17:27:58 2017 +0300
+++ b/i18n/mki18n.py Thu Aug 17 09:55:39 2017 +0300
@@ -88,7 +88,7 @@
-__author__ = "Pierre Rouleau"
+__author__ = "Pierre Rouleau" __version__ = "$Revision: 1.5 $"
# -----------------------------------------------------------------------------
--- a/plcopen/structures.py Wed Aug 16 17:27:58 2017 +0300
+++ b/plcopen/structures.py Thu Aug 17 09:55:39 2017 +0300
@@ -233,11 +233,11 @@
decl_tpl = Function_decl["outputs"][0]
Function_decl["outputs"] = [(decl_tpl[0], outype, decl_tpl[2])]
if funcdeclname_orig.endswith('*'):
- funcdeclout = funcdeclin + '_' + outype
+ funcdeclout = funcdeclin + '_' + outype - funcdeclout = funcdeclin
+ funcdeclout = funcdeclin - funcdeclout = funcdeclin
+ funcdeclout = funcdeclin Function_decl["name"] = funcdeclout
# apply filter given in "filter" column
--- a/svgui/pyjs/build.py Wed Aug 16 17:27:58 2017 +0300
+++ b/svgui/pyjs/build.py Thu Aug 17 09:55:39 2017 +0300
@@ -138,9 +138,9 @@
- filename = os.path.split (source_file)[1]
- mod_name = os.path.splitext(filename)[0]
- file_name = os.path.join (dest_path, mod_name + '.html')
+ filename = os.path.split(source_file)[1] + mod_name = os.path.splitext(filename)[0] + file_name = os.path.join(dest_path, mod_name + '.html') # if html file in output directory exists, leave it alone.
if os.path.exists (file_name):
--- a/targets/__init__.py Wed Aug 16 17:27:58 2017 +0300
+++ b/targets/__init__.py Thu Aug 17 09:55:39 2017 +0300
@@ -74,7 +74,7 @@
for targetname, nfo in targets.iteritems():
xsd_string = open(nfo["xsd"]).read()
- targetchoices += xsd_string % DictXSD_toolchain
+ targetchoices += xsd_string % DictXSD_toolchain --- a/targets/toolchain_gcc.py Wed Aug 16 17:27:58 2017 +0300
+++ b/targets/toolchain_gcc.py Thu Aug 17 09:55:39 2017 +0300
@@ -29,7 +29,7 @@
from util.ProcessLogger import ProcessLogger
-includes_re = re.compile('\s*#include\s*["<]([^">]*)[">].*')
+includes_re = re.compile('\s*#include\s*["<]([^">]*)[">].*') --- a/targets/toolchain_makefile.py Wed Aug 16 17:27:58 2017 +0300
+++ b/targets/toolchain_makefile.py Thu Aug 17 09:55:39 2017 +0300
@@ -30,7 +30,7 @@
-includes_re = re.compile('\s*#include\s*["<]([^">]*)[">].*')
+includes_re = re.compile('\s*#include\s*["<]([^">]*)[">].*') class toolchain_makefile():
--- a/targets/typemapping.py Wed Aug 16 17:27:58 2017 +0300
+++ b/targets/typemapping.py Thu Aug 17 09:55:39 2017 +0300
@@ -90,11 +90,11 @@
TypeTranslator = SameEndianessTypeTranslator
# Construct debugger natively supported types
-DebugTypesSize = dict([(key, sizeof(t)) for key, (t, p, u) in SameEndianessTypeTranslator.iteritems() if t is not None])
+DebugTypesSize = dict([(key, sizeof(t)) for key, (t, p, u) in SameEndianessTypeTranslator.iteritems() if t is not None]) def UnpackDebugBuffer(buff, indexes):
buffptr = cast(ctypes.pythonapi.PyString_AsString(id(buff)), c_void_p).value
--- a/util/Zeroconf.py Wed Aug 16 17:27:58 2017 +0300
+++ b/util/Zeroconf.py Thu Aug 17 09:55:39 2017 +0300
@@ -150,7 +150,7 @@
# Mapping constants to names
@@ -530,7 +530,7 @@
def readString(self, len):
"""Reads a string of a given length from the packet"""
format = '!' + str(len) + 's'
- length = struct.calcsize(format)
+ length = struct.calcsize(format) info = struct.unpack(format, self.data[self.offset:self.offset+length])
--- a/version.py Wed Aug 16 17:27:58 2017 +0300
+++ b/version.py Thu Aug 17 09:55:39 2017 +0300
@@ -73,7 +73,8 @@
info.Version = app_version
- info.Copyright = "(C) 2016 Andrey Skvortsov\n"
+ info.Copyright += "(C) 2016-2017 Andrey Skvortsov\n" info.Copyright += "(C) 2008-2015 Eduard Tisserant\n"
info.Copyright += "(C) 2008-2015 Laurent Bessard"
@@ -123,7 +124,7 @@
app_version = app_version + "-" + rev.rstrip()
--- a/xmlclass/xmlclass.py Wed Aug 16 17:27:58 2017 +0300
+++ b/xmlclass/xmlclass.py Thu Aug 17 09:55:39 2017 +0300
@@ -875,7 +875,7 @@
def ExtractNodeAttrs(self, element_name, node, valid_attrs):
for qualified_name, attr in node._attrs.items():
- namespace, name = DecomposeQualifiedName(qualified_name)
+ namespace, name = DecomposeQualifiedName(qualified_name) infos = self.GetQualifiedNameInfos(name, namespace)
if infos["type"] != SYNTAXATTRIBUTE: