fix pylint warning "(no-value-for-parameter) No value for argument 'X' in function call"
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Wed, 11 Oct 2017 11:35:19 +0300
changeset 1865 0bd5b3099144
parent 1864 9e64afb38963
child 1866 9d1e68d557bf
fix pylint warning "(no-value-for-parameter) No value for argument 'X' in function call"
controls/DurationCellEditor.py
docutil/dochtml.py
editors/LDViewer.py
editors/SFCViewer.py
svgui/pyjs/lib/pyjslib.py
tests/tools/check_source.sh
--- a/controls/DurationCellEditor.py	Wed Oct 11 10:34:45 2017 +0300
+++ b/controls/DurationCellEditor.py	Wed Oct 11 11:35:19 2017 +0300
@@ -142,4 +142,4 @@
                                        wx.SIZE_ALLOW_MINUS_ONE)
 
     def Clone(self):
-        return DurationCellEditor(self.Table)
+        return DurationCellEditor(self.Table, self.Colname)
--- a/docutil/dochtml.py	Wed Oct 11 10:34:45 2017 +0300
+++ b/docutil/dochtml.py	Wed Oct 11 11:35:19 2017 +0300
@@ -62,7 +62,7 @@
         if event == HtmlWindowUrlClick:
             self.Connect(-1, -1, EVT_HTML_URL_CLICK, handler)
         else:
-            wx.html.HtmlWindow.Bind(event, handler, source=source, id=id, id2=id2)
+            wx.html.HtmlWindow.Bind(self, event, handler, source=source, id=id, id2=id2)
 
 
 class HtmlFrame(wx.Frame):
--- a/editors/LDViewer.py	Wed Oct 11 10:34:45 2017 +0300
+++ b/editors/LDViewer.py	Wed Oct 11 11:35:19 2017 +0300
@@ -490,7 +490,7 @@
     # -------------------------------------------------------------------------------
 
     def AddLadderRung(self):
-        dialog = LDElementDialog(self.ParentWindow, self.Controler, "coil")
+        dialog = LDElementDialog(self.ParentWindow, self.Controler, self.TagName, "coil")
         dialog.SetPreviewFont(self.GetFont())
         varlist = []
         vars = self.Controler.GetEditedElementInterfaceVars(self.TagName, debug=self.Debug)
@@ -590,7 +590,7 @@
                 for element in self.SelectedElement.GetElements():
                     wires.append(element)
         if len(wires) > 0:
-            dialog = LDElementDialog(self.ParentWindow, self.Controler, "contact")
+            dialog = LDElementDialog(self.ParentWindow, self.Controler, self.TagName, "contact")
             dialog.SetPreviewFont(self.GetFont())
             varlist = []
             vars = self.Controler.GetEditedElementInterfaceVars(self.TagName, debug=self.Debug)
@@ -804,7 +804,7 @@
                             new_wire.ConnectEndPoint(None, connectors["outputs"][index + 1])
                         right_elements.reverse()
                     elif right_powerrail:
-                        dialog = LDElementDialog(self.ParentWindow, self.Controleur, "coil")
+                        dialog = LDElementDialog(self.ParentWindow, self.Controleur, self.TagName, "coil")
                         dialog.SetPreviewFont(self.GetFont())
                         varlist = []
                         vars = self.Controler.GetEditedElementInterfaceVars(self.TagName, debug=self.Debug)
--- a/editors/SFCViewer.py	Wed Oct 11 10:34:45 2017 +0300
+++ b/editors/SFCViewer.py	Wed Oct 11 11:35:19 2017 +0300
@@ -537,7 +537,7 @@
 
     def AddDivergence(self):
         if self.SelectedElement in self.Wires or isinstance(self.SelectedElement, Graphic_Group) or isinstance(self.SelectedElement, SFC_Step):
-            dialog = SFCDivergenceDialog(self.ParentWindow)
+            dialog = SFCDivergenceDialog(self.ParentWindow, self.Controler, self.TagName)
             dialog.SetPreviewFont(self.GetFont())
             if dialog.ShowModal() == wx.ID_OK:
                 value = dialog.GetValues()
--- a/svgui/pyjs/lib/pyjslib.py	Wed Oct 11 10:34:45 2017 +0300
+++ b/svgui/pyjs/lib/pyjslib.py	Wed Oct 11 11:35:19 2017 +0300
@@ -1167,7 +1167,7 @@
     """)
 
 
-def getattr(obj, name, default_):
+def getattr(obj, name, default_=None):
     JS("""
     if ((!pyjslib.isObject(obj))||(pyjslib.isUndefined(obj[name]))){
         if (pyjslib.isUndefined(default_)){
--- a/tests/tools/check_source.sh	Wed Oct 11 10:34:45 2017 +0300
+++ b/tests/tools/check_source.sh	Wed Oct 11 11:35:19 2017 +0300
@@ -240,7 +240,8 @@
     enable=$enable,E1305          # (too-many-format-args) Too many arguments for format string
     enable=$enable,E0704          # (misplaced-bare-raise) The raise statement is not inside an except clause
     enable=$enable,C0123          # (unidiomatic-typecheck) Using type() instead of isinstance() for a typecheck.
-    enable=$enable,E0601          # (used-before-assignment)
+    enable=$enable,E0601          # (used-before-assignment) Using variable 'X' before assignment
+    enable=$enable,E1120          # (no-value-for-parameter) No value for argument 'X' in function call
     # enable=
 
     options=