clean-up: fix PEP8 W503 line break before binary operator
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Tue, 22 Aug 2017 12:45:06 +0300
changeset 1785 0ff2a45dcefa
parent 1784 64beb9e9c749
child 1786 b6d47158d68a
clean-up: fix PEP8 W503 line break before binary operator
PLCControler.py
connectors/__init__.py
controls/DebugVariablePanel/DebugVariableGraphicViewer.py
svgui/pyjs/pyjs.py
targets/__init__.py
--- a/PLCControler.py	Mon Aug 21 23:22:58 2017 +0300
+++ b/PLCControler.py	Tue Aug 22 12:45:06 2017 +0300
@@ -1738,9 +1738,8 @@
             datatypes.extend([
                 datatype.getname()
                 for datatype in project.getdataTypes(name)
-                if ((not only_locatables or self.IsLocatableDataType(datatype, debug))
-                    and (name is None or
-                         len(self.GetInstanceList(datatype, name, debug)) == 0))])
+                if ((not only_locatables or self.IsLocatableDataType(datatype, debug)) and
+                    (name is None or len(self.GetInstanceList(datatype, name, debug)) == 0))])
         if confnodetypes:
             for category in self.GetConfNodeDataTypes(name, only_locatables):
                 datatypes.extend(category["list"])
--- a/connectors/__init__.py	Mon Aug 21 23:22:58 2017 +0300
+++ b/connectors/__init__.py	Tue Aug 22 12:45:06 2017 +0300
@@ -38,8 +38,8 @@
 connectors = {name:
               _GetLocalConnectorClassFactory(name)
               for name in listdir(_base_path)
-              if (path.isdir(path.join(_base_path, name))
-                  and not name.startswith("__"))}
+              if (path.isdir(path.join(_base_path, name)) and
+                  not name.startswith("__"))}
 
 
 def ConnectorFactory(uri, confnodesroot):
--- a/controls/DebugVariablePanel/DebugVariableGraphicViewer.py	Mon Aug 21 23:22:58 2017 +0300
+++ b/controls/DebugVariablePanel/DebugVariableGraphicViewer.py	Tue Aug 22 12:45:06 2017 +0300
@@ -1088,8 +1088,8 @@
         # matplotlib coordinate
         canvas_ratio = 1. / height  # Divide by canvas height in pixel
         graph_ratio = 1. / (
-            (1.0 - (CANVAS_BORDER[0] + CANVAS_BORDER[1]) * canvas_ratio)
-            * height)             # Divide by figure height in pixel
+            (1.0 - (CANVAS_BORDER[0] + CANVAS_BORDER[1]) * canvas_ratio) *
+            height)             # Divide by figure height in pixel
 
         # Update position of figure (keeping up and bottom border the same
         # size)
--- a/svgui/pyjs/pyjs.py	Mon Aug 21 23:22:58 2017 +0300
+++ b/svgui/pyjs/pyjs.py	Tue Aug 22 12:45:06 2017 +0300
@@ -546,11 +546,11 @@
                 call_this, method_name = call_name.rsplit(".", 1)
             except ValueError:
                 # Must be a function call ...
-                return ("pyjs_kwargs_function_call("+call_name+", "
-                        + star_arg_name + ", ["+fn_args+"]" + ")")
-            else:
-                return ("pyjs_kwargs_method_call("+call_this+", '"+method_name+"', "
-                        + star_arg_name + ", ["+fn_args+"]" + ")")
+                return ("pyjs_kwargs_function_call("+call_name+", " +
+                        star_arg_name + ", ["+fn_args+"]" + ")")
+            else:
+                return ("pyjs_kwargs_method_call("+call_this+", '"+method_name+"', " +
+                        star_arg_name + ", ["+fn_args+"]" + ")")
         else:
             return call_name + "(" + ", ".join(call_args) + ")"
 
@@ -1016,9 +1016,9 @@
                 '          throw __err;',
                 '      } else {',
                 '          st = sys.printstack() + ' + '"%s"' % lt + "+ '\\n' ;"
-                '          alert("' + 'Error in ' + lt + '"'
-                + '+"\\n"+__err.name+": "+__err.message'
-                + '+"\\n\\nStack trace:\\n"' + '+st' + ');',
+                '          alert("' + 'Error in ' + lt + '"' +
+                '+"\\n"+__err.name+": "+__err.message' +
+                '+"\\n\\nStack trace:\\n"' + '+st' + ');',
                 '          debugger;',
                 '          throw new ' + self.module_prefix + 'HaltException();',
                 '      }',
--- a/targets/__init__.py	Mon Aug 21 23:22:58 2017 +0300
+++ b/targets/__init__.py	Tue Aug 22 12:45:06 2017 +0300
@@ -51,8 +51,8 @@
                                   if (fname.startswith("plc_%s_main" % name) and
                                       fname.endswith(".c"))}})
                 for name in listdir(_base_path)
-                if (path.isdir(path.join(_base_path, name))
-                    and not name.startswith("__"))])
+                if (path.isdir(path.join(_base_path, name)) and
+                    not name.startswith("__"))])
 
 toolchains = {"gcc":  path.join(_base_path, "XSD_toolchain_gcc"),
               "makefile":  path.join(_base_path, "XSD_toolchain_makefile")}