cleanup: pylint, R1704 # (redefined-argument-from-local) Redefining argument with the local name 'Y'
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Mon, 01 Oct 2018 15:53:34 +0300
changeset 2415 f7d8891fe708
parent 2414 7fad75e5e63d
child 2416 1ca207782dde
cleanup: pylint, R1704 # (redefined-argument-from-local) Redefining argument with the local name 'Y'
ProjectController.py
editors/LDViewer.py
svgui/pyjs/pyjs.py
tests/tools/check_source.sh
--- a/ProjectController.py	Mon Oct 01 15:36:01 2018 +0300
+++ b/ProjectController.py	Mon Oct 01 15:53:34 2018 +0300
@@ -1323,7 +1323,7 @@
                     self.AppFrame.TabsOpened, self, name, self._getProjectFilesPath(), True)
 
                 extensions = []
-                for extension, name, editor in features.file_editors:
+                for extension, _name, _editor in features.file_editors:
                     if extension not in extensions:
                         extensions.append(extension)
                 self._ProjectFilesView.SetEditableFileExtensions(extensions)
--- a/editors/LDViewer.py	Mon Oct 01 15:36:01 2018 +0300
+++ b/editors/LDViewer.py	Mon Oct 01 15:53:34 2018 +0300
@@ -1062,17 +1062,17 @@
                 rungindex = self.FindRung(wires[0])
                 rung = self.Rungs[rungindex]
                 old_bbox = rung.GetBoundingBox()
-                for wire in wires:
-                    connections = wire.GetSelectedSegmentConnections()
-                    left_block = wire.EndConnected.GetParentBlock()
-                    if wire.EndConnected not in left_elements:
-                        left_elements.append(wire.EndConnected)
-                    if wire.StartConnected not in right_elements:
-                        right_elements.append(wire.StartConnected)
+                for w in wires:
+                    connections = w.GetSelectedSegmentConnections()
+                    left_block = w.EndConnected.GetParentBlock()
+                    if w.EndConnected not in left_elements:
+                        left_elements.append(w.EndConnected)
+                    if w.StartConnected not in right_elements:
+                        right_elements.append(w.StartConnected)
                     if connections == (False, False) or connections == (False, True) and isinstance(left_block, LD_PowerRail):
-                        wire.Clean()
-                        self.RemoveWire(wire)
-                        rung.SelectElement(wire)
+                        w.Clean()
+                        self.RemoveWire(w)
+                        rung.SelectElement(w)
                 for left_element in left_elements:
                     left_block = left_element.GetParentBlock()
                     if isinstance(left_block, LD_PowerRail):
@@ -1082,8 +1082,8 @@
                     else:
                         connectors = left_block.GetConnectors()
                         for connector in connectors["outputs"]:
-                            for wire, _handle in connector.GetWires():
-                                self.RefreshPosition(wire.StartConnected.GetParentBlock())
+                            for lwire, _handle in connector.GetWires():
+                                self.RefreshPosition(lwire.StartConnected.GetParentBlock())
                 for right_element in right_elements:
                     self.RefreshPosition(right_element.GetParentBlock())
                 rung.RefreshBoundingBox()
--- a/svgui/pyjs/pyjs.py	Mon Oct 01 15:36:01 2018 +0300
+++ b/svgui/pyjs/pyjs.py	Mon Oct 01 15:53:34 2018 +0300
@@ -1331,8 +1331,8 @@
                 %(lhs)s %(op)s %(iterator_name)s.next();
                 %(assign_tuple)s
         """ % loc_dict)
-        for node in node.body.nodes:
-            self._stmt(node, current_klass)
+        for n in node.body.nodes:
+            self._stmt(n, current_klass)
         self.printo("""
             }
         } catch (e) {
--- a/tests/tools/check_source.sh	Mon Oct 01 15:36:01 2018 +0300
+++ b/tests/tools/check_source.sh	Mon Oct 01 15:53:34 2018 +0300
@@ -296,6 +296,7 @@
     enable=$enable,E1300          # (bad-format-character) Unsupported format character '"' (0x22) at index 17
     enable=$enable,E1304          # (missing-format-string-key) Missing key 'X_name' in format string dictionary
     enable=$enable,R1701          # (consider-merging-isinstance) Consider merging these isinstance calls to isinstance(CTNLDFLAGS, (str, unicode))
+    enable=$enable,R1704          # (redefined-argument-from-local) Redefining argument with the local name 'Y'
     enable=$enable,W0106          # (expression-not-assigned) Expression "X" is assigned to nothing
     enable=$enable,E1136          # (unsubscriptable-object) Value 'X' is unsubscriptable
     enable=$enable,E0602          # (undefined-variable) Undefined variable 'X'