clean-up: fix PEP8 E131 continuation line unaligned for hanging indent
--- a/PLCControler.py Sat Aug 19 16:45:37 2017 +0300
+++ b/PLCControler.py Sat Aug 19 17:04:31 2017 +0300
@@ -1753,9 +1753,9 @@
for datatype in project.getdataTypes(name)
- if (not only_locatables or self.IsLocatableDataType(datatype, debug))
+ if ((not only_locatables or self.IsLocatableDataType(datatype, debug)) - len(self.GetInstanceList(datatype, name, debug)) == 0)])
+ len(self.GetInstanceList(datatype, name, debug)) == 0))]) for category in self.GetConfNodeDataTypes(name, only_locatables):
datatypes.extend(category["list"])
--- a/ProjectController.py Sat Aug 19 16:45:37 2017 +0300
+++ b/ProjectController.py Sat Aug 19 17:04:31 2017 +0300
@@ -983,21 +983,21 @@
debug_code = targets.GetCode("plc_debug.c") % {
- "programs_declarations":
- "\n".join(["extern %(type)s %(C_path)s;" % p for p in self._ProgramList]),
- "extern_variables_declarations": "\n".join([
- "EXT": "extern __IEC_%(type)s_p %(C_path)s;",
- "IN": "extern __IEC_%(type)s_p %(C_path)s;",
- "MEM": "extern __IEC_%(type)s_p %(C_path)s;",
- "OUT": "extern __IEC_%(type)s_p %(C_path)s;",
- "VAR": "extern __IEC_%(type)s_t %(C_path)s;",
- "FB": "extern %(type)s %(C_path)s;"
- for v in self._VariablesList if v["C_path"].find('.') < 0]),
- "variable_decl_array": ",\n".join(variable_decl_array)
+ "programs_declarations": "\n".join(["extern %(type)s %(C_path)s;" % + p for p in self._ProgramList]), + "extern_variables_declarations": "\n".join([ + "EXT": "extern __IEC_%(type)s_p %(C_path)s;", + "IN": "extern __IEC_%(type)s_p %(C_path)s;", + "MEM": "extern __IEC_%(type)s_p %(C_path)s;", + "OUT": "extern __IEC_%(type)s_p %(C_path)s;", + "VAR": "extern __IEC_%(type)s_t %(C_path)s;", + "FB": "extern %(type)s %(C_path)s;" + for v in self._VariablesList if v["C_path"].find('.') < 0]), + "variable_decl_array": ",\n".join(variable_decl_array) --- a/controls/DebugVariablePanel/DebugVariableGraphicViewer.py Sat Aug 19 16:45:37 2017 +0300
+++ b/controls/DebugVariablePanel/DebugVariableGraphicViewer.py Sat Aug 19 17:04:31 2017 +0300
@@ -1089,7 +1089,7 @@
canvas_ratio = 1. / height # Divide by canvas height in pixel
(1.0 - (CANVAS_BORDER[0] + CANVAS_BORDER[1]) * canvas_ratio)
- * height) # Divide by figure height in pixel
+ * height) # Divide by figure height in pixel # Update position of figure (keeping up and bottom border the same
--- a/graphics/GraphicCommons.py Sat Aug 19 16:45:37 2017 +0300
+++ b/graphics/GraphicCommons.py Sat Aug 19 17:04:31 2017 +0300
@@ -1088,11 +1088,12 @@
self.ValueSize = self.ParentBlock.Parent.GetMiniTextExtent(self.ComputedValue)
if self.ValueSize is not None:
width, height = self.ValueSize
- rect = rect.Union(wx.Rect(
parent_pos[0] + self.Pos.x + CONNECTOR_SIZE * self.Direction[0] +
- width * (self.Direction[0] - 1) / 2,
+ width * (self.Direction[0] - 1) / 2, parent_pos[1] + self.Pos.y + CONNECTOR_SIZE * self.Direction[1] +
- height * (self.Direction[1] - 1),
+ height * (self.Direction[1] - 1), --- a/plcopen/plcopen.py Sat Aug 19 16:45:37 2017 +0300
+++ b/plcopen/plcopen.py Sat Aug 19 17:04:31 2017 +0300
@@ -466,10 +466,10 @@
def getpous(self, exclude=None, filter=[]):
"ppx:types/ppx:pous/ppx:pou%s%s" %
- (("[@name!='%s']" % exclude) if exclude is not None else '',
- map(lambda x: "@pouType='%s'" % x, filter)))
- if len(filter) > 0 else ""),
+ (("[@name!='%s']" % exclude) if exclude is not None else '', + map(lambda x: "@pouType='%s'" % x, filter))) + if len(filter) > 0 else ""), namespaces=PLCOpenParser.NSMAP)
setattr(cls, "getpous", getpous)
--- a/py_ext/PythonFileCTNMixin.py Sat Aug 19 16:45:37 2017 +0300
+++ b/py_ext/PythonFileCTNMixin.py Sat Aug 19 17:04:31 2017 +0300
@@ -101,19 +101,19 @@
pyextname = self.CTNName()
varinfos = map(lambda variable: {
- "name": variable.getname(),
- "desc": repr(variable.getdesc()),
- "onchangecode": '"' + variable.getonchange() +
- "('" + variable.getname() + "')\""
- if variable.getonchange() else '""',
- "onchange": repr(variable.getonchange())
- if variable.getonchange() else None,
- "opts": repr(variable.getopts()),
- "configname": configname.upper(),
- "uppername": variable.getname().upper(),
- "IECtype": variable.gettype(),
- "pyextname": pyextname},
- self.CodeFile.variables.variable)
+ "name": variable.getname(), + "desc": repr(variable.getdesc()), + "onchangecode": '"' + variable.getonchange() + + "('" + variable.getname() + "')\"" + if variable.getonchange() else '""', + "onchange": repr(variable.getonchange()) + if variable.getonchange() else None, + "opts": repr(variable.getopts()), + "configname": configname.upper(), + "uppername": variable.getname().upper(), + "IECtype": variable.gettype(), + "pyextname": pyextname}, + self.CodeFile.variables.variable) # python side PLC global variables access stub
globalstubs = "\n".join([
--- a/targets/toolchain_gcc.py Sat Aug 19 16:45:37 2017 +0300
+++ b/targets/toolchain_gcc.py Sat Aug 19 17:04:31 2017 +0300
@@ -185,10 +185,10 @@
self.CTRInstance.logger.write(" [CC] "+bn+" -> "+obn+"\n")
status, result, err_result = ProcessLogger(
- self.CTRInstance.logger,
- "\"%s\" -c \"%s\" -o \"%s\" %s %s" %
- (self.compiler, CFile, objectfilename, Builder_CFLAGS, CFLAGS)
+ self.CTRInstance.logger, + "\"%s\" -c \"%s\" -o \"%s\" %s %s" % + (self.compiler, CFile, objectfilename, Builder_CFLAGS, CFLAGS) @@ -214,13 +214,13 @@
self.CTRInstance.logger.write(" [CC] " + ' '.join(obns)+" -> " + self.exe + "\n")
status, result, err_result = ProcessLogger(
- self.CTRInstance.logger,
- "\"%s\" %s -o \"%s\" %s" %
+ self.CTRInstance.logger, + "\"%s\" %s -o \"%s\" %s" % --- a/xmlclass/xmlclass.py Sat Aug 19 16:45:37 2017 +0300
+++ b/xmlclass/xmlclass.py Sat Aug 19 17:04:31 2017 +0300
@@ -1371,8 +1371,8 @@
previous_elements_xpath = "|".join(map(
- else elements["content"]["elmt_type"]["choices_xpath"].path,
+ else elements["content"]["elmt_type"]["choices_xpath"].path, elements.keys()[:element_idx]))
insertion_point = len(self.xpath(previous_elements_xpath, namespaces=factory.NSMAP))