Conform to pep8 and pylint :
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Sun, 07 Apr 2019 21:08:07 +0200
changeset 2579 8fb5c6eddc72
parent 2578 eed31489c909
child 2584 adfdeaba5a6a
Conform to pep8 and pylint :

pep8 version: 2.3.1
./ConfigTreeNode.py:130:49: E231 missing whitespace after ','
./editors/Viewer.py:643:24: E128 continuation line under-indented for visual indent
./editors/Viewer.py:670:12: E221 multiple spaces before operator
./editors/Viewer.py:671:13: E221 multiple spaces before operator
./editors/Viewer.py:2138:52: E203 whitespace before ':'
./editors/Viewer.py:2139:66: W291 trailing whitespace
./controls/VariablePanel.py:154:25: E231 missing whitespace after ','
./controls/LocationCellEditor.py:88:1: W293 blank line contains whitespace
./controls/LocationCellEditor.py:191:25: E221 multiple spaces before operator
./controls/LocationCellEditor.py:200:17: E128 continuation line under-indented for visual indent

pylint 1.8.3,
************* Module controls.LocationCellEditor
controls/LocationCellEditor.py:200: [C0330(bad-continuation), ] Wrong continued indentation (add 9 spaces).
_("Selected location is identical to previous one"))
^ |
************* Module controls.VariablePanel
controls/VariablePanel.py:154: [E1601(print-statement), VariableTable.SetValue] print statement used
************* Module editors.Viewer
editors/Viewer.py:643: [C0330(bad-continuation), ] Wrong continued indentation (add 1 space).
self.GetAddMenuCallBack(self.AddNewComment))
^|
editors/Viewer.py:598: [W0612(unused-variable), Viewer.AddDivergenceMenuItems] Unused variable 'add_branch'
editors/Viewer.py:1655: [E0602(undefined-variable), Viewer.PopupConnectionMenu] Undefined variable 'variable_type'
editors/Viewer.py:1649: [W0612(unused-variable), Viewer.PopupConnectionMenu] Unused variable 'connection_type'
************* Module connectors.PYRO.PSK_Adapter
ConfigTreeNode.py
controls/LocationCellEditor.py
controls/VariablePanel.py
editors/Viewer.py
--- a/ConfigTreeNode.py	Sun Apr 07 16:23:49 2019 +0200
+++ b/ConfigTreeNode.py	Sun Apr 07 21:08:07 2019 +0200
@@ -127,7 +127,7 @@
         # TODO match config's fields name and fields contents
         return reduce(add, [
             CTNChild.CTNSearch(criteria)
-            for CTNChild in self.IterChildren()],[])
+            for CTNChild in self.IterChildren()], [])
 
     def GetIconName(self):
         return None
--- a/controls/LocationCellEditor.py	Sun Apr 07 16:23:49 2019 +0200
+++ b/controls/LocationCellEditor.py	Sun Apr 07 21:08:07 2019 +0200
@@ -85,7 +85,7 @@
 
     def GetName(self):
         return self.VariableName
-    
+
     def OnSize(self, event):
         self.Layout()
 
@@ -188,7 +188,7 @@
                 if message is not None:
                     wx.CallAfter(self.Table.Parent.ShowErrorMessage, message)
                     return None
-                old_name  = self.Table.GetValueByName(row, 'Name')
+                old_name = self.Table.GetValueByName(row, 'Name')
                 self.Table.SetValueByName(row, 'Name', name)
                 self.Table.Parent.OnVariableNameChange(old_name, name)
             self.Table.SetValueByName(row, 'Location', loc)
@@ -197,7 +197,7 @@
                 self.Table.SetValueByName(row, 'Type', var_type)
         else:
             wx.CallAfter(self.Table.Parent.ShowErrorMessage,
-                _("Selected location is identical to previous one"))
+                         _("Selected location is identical to previous one"))
         self.CellControl.Disable()
         return changed
 
--- a/controls/VariablePanel.py	Sun Apr 07 16:23:49 2019 +0200
+++ b/controls/VariablePanel.py	Sun Apr 07 21:08:07 2019 +0200
@@ -151,7 +151,6 @@
             return value
 
     def SetValue(self, row, col, value):
-        print("SetValue",row, col, value)
         if col < len(self.colnames):
             colname = self.GetColLabelValue(col, False)
             if colname == "Name":
--- a/editors/Viewer.py	Sun Apr 07 16:23:49 2019 +0200
+++ b/editors/Viewer.py	Sun Apr 07 21:08:07 2019 +0200
@@ -595,8 +595,8 @@
 
     # Add Divergence Menu items to the given menu
     def AddDivergenceMenuItems(self, menu, delete=False):
-        add_branch = self.AppendItem(menu, _(u'Add Divergence Branch'),
-                                     self.OnAddBranchMenu)
+        self.AppendItem(menu, _(u'Add Divergence Branch'),
+                        self.OnAddBranchMenu)
         delete_branch = self.AppendItem(menu, _(u'Delete Divergence Branch'),
                                         self.OnDeleteBranchMenu)
 
@@ -640,7 +640,7 @@
             menu.AppendSeparator()
 
         self.AppendItem(menu, _(u'Comment'),
-                       self.GetAddMenuCallBack(self.AddNewComment))
+                        self.GetAddMenuCallBack(self.AddNewComment))
 
     # Add Default Menu items to the given menu
     def AddDefaultMenuItems(self, menu, edit=False, block=False):
@@ -667,8 +667,8 @@
 
         menu.AppendSeparator()
 
-        cut   = self.AppendItem(menu, _(u'Cut'), self.GetClipboardCallBack(self.Cut))
-        copy  = self.AppendItem(menu, _(u'Copy'), self.GetClipboardCallBack(self.Copy))
+        cut = self.AppendItem(menu, _(u'Cut'), self.GetClipboardCallBack(self.Cut))
+        copy = self.AppendItem(menu, _(u'Copy'), self.GetClipboardCallBack(self.Copy))
         paste = self.AppendItem(menu, _(u'Paste'), self.GetAddMenuCallBack(self.Paste))
 
         cut.Enable(block)
@@ -1631,13 +1631,13 @@
     def PopupVariableMenu(self):
         menu = wx.Menu(title='')
         variable_type = self.SelectedElement.GetType()
-        for type_label, type in [(_("Input"), INPUT),
-                                 (_("Output"), OUTPUT),
-                                 (_("InOut"), INOUT)]:
+        for type_label, vtype in [(_("Input"), INPUT),
+                                  (_("Output"), OUTPUT),
+                                  (_("InOut"), INOUT)]:
             item = self.AppendItem(menu, type_label,
-                                   self.GetChangeVariableTypeMenuFunction(type),
+                                   self.GetChangeVariableTypeMenuFunction(vtype),
                                    kind=wx.ITEM_RADIO)
-            if type == variable_type:
+            if vtype == variable_type:
                 item.Check(True)
         menu.AppendSeparator()
         self.AddDefaultMenuItems(menu, block=True)
@@ -1647,12 +1647,12 @@
     def PopupConnectionMenu(self):
         menu = wx.Menu(title='')
         connection_type = self.SelectedElement.GetType()
-        for type_label, type in [(_("Connector"), CONNECTOR),
-                                 (_("Continuation"), CONTINUATION)]:
+        for type_label, ctype in [(_("Connector"), CONNECTOR),
+                                  (_("Continuation"), CONTINUATION)]:
             item = self.AppendItem(menu, type_label,
-                                   self.GetChangeConnectionTypeMenuFunction(type),
+                                   self.GetChangeConnectionTypeMenuFunction(ctype),
                                    kind=wx.ITEM_RADIO)
-            if type == variable_type:
+            if ctype == connection_type:
                 item.Check(True)
         menu.AppendSeparator()
         self.AddDefaultMenuItems(menu, block=True)
@@ -2135,8 +2135,8 @@
 
                         # Popup contextual menu
                         menu = wx.Menu()
-                        for text, callback in items :
-                            self.AppendItem(menu, text, callback) 
+                        for text, callback in items:
+                            self.AppendItem(menu, text, callback)
                         self.PopupMenu(menu)
 
                     self.SelectedElement.StartConnected.HighlightParentBlock(False)