clean etherlab: pep8, E129 visually indented line with same indent as next logical line
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Sat, 29 Sep 2018 15:16:21 +0300
changeset 2381 1c40e3976cc2
parent 2380 b35bce45bc5a
child 2382 e783c6beacf1
clean etherlab: pep8, E129 visually indented line with same indent as next logical line
etherlab/ConfigEditor.py
etherlab/EtherCATManagementEditor.py
etherlab/EthercatCFileGenerator.py
etherlab/EthercatCIA402Slave.py
etherlab/EthercatMaster.py
etherlab/EthercatSlave.py
etherlab/etherlab.py
--- a/etherlab/ConfigEditor.py	Sat Sep 29 15:03:17 2018 +0300
+++ b/etherlab/ConfigEditor.py	Sat Sep 29 15:16:21 2018 +0300
@@ -90,13 +90,13 @@
         self.AddWindow(self.VariablesFilter, flag=wx.GROW)
 
         self.VariablesGrid = wx.gizmos.TreeListCtrl(parent,
-                style=wx.TR_DEFAULT_STYLE |
-                      wx.TR_ROW_LINES |
-                      wx.TR_COLUMN_LINES |
-                      wx.TR_HIDE_ROOT |
-                      wx.TR_FULL_ROW_HIGHLIGHT)
+                                                    style=wx.TR_DEFAULT_STYLE |
+                                                    wx.TR_ROW_LINES |
+                                                    wx.TR_COLUMN_LINES |
+                                                    wx.TR_HIDE_ROOT |
+                                                    wx.TR_FULL_ROW_HIGHLIGHT)
         self.VariablesGrid.GetMainWindow().Bind(wx.EVT_LEFT_DOWN,
-            self.OnVariablesGridLeftClick)
+                                                self.OnVariablesGridLeftClick)
         self.AddWindow(self.VariablesGrid, flag=wx.GROW)
 
         self.Filters = []
@@ -276,12 +276,12 @@
         main_sizer.AddGrowableRow(1)
 
         variables_label = wx.StaticText(self.EthercatNodeEditor,
-              label=_('Variable entries:'))
+                                        label=_('Variable entries:'))
         main_sizer.AddWindow(variables_label, border=10, flag=wx.TOP | wx.LEFT | wx.RIGHT)
 
         self.NodeVariables = NodeVariablesSizer(self.EthercatNodeEditor, self.Controler)
         main_sizer.AddSizer(self.NodeVariables, border=10,
-            flag=wx.GROW | wx.BOTTOM | wx.LEFT | wx.RIGHT)
+                            flag=wx.GROW | wx.BOTTOM | wx.LEFT | wx.RIGHT)
 
         self.EthercatNodeEditor.SetSizer(main_sizer)
 
@@ -304,7 +304,7 @@
     # -------------------For EtherCAT Management ----------------------------------------------
     def _create_EtherCATManagementEditor(self, prnt):
         self.EtherCATManagementEditor = wx.ScrolledWindow(prnt,
-            style=wx.TAB_TRAVERSAL | wx.HSCROLL | wx.VSCROLL)
+                                                          style=wx.TAB_TRAVERSAL | wx.HSCROLL | wx.VSCROLL)
         self.EtherCATManagementEditor.Bind(wx.EVT_SIZE, self.OnResize)
 
         self.EtherCATManagermentEditor_Main_Sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=5)
@@ -327,7 +327,9 @@
         posy = max(0, min(ystart, (maxy - window_size[1]) / SCROLLBAR_UNIT))
         self.EtherCATManagementEditor.Scroll(posx, posy)
         self.EtherCATManagementEditor.SetScrollbars(SCROLLBAR_UNIT, SCROLLBAR_UNIT,
-                maxx / SCROLLBAR_UNIT, maxy / SCROLLBAR_UNIT, posx, posy)
+                                                    maxx / SCROLLBAR_UNIT,
+                                                    maxy / SCROLLBAR_UNIT,
+                                                    posx, posy)
         event.Skip()
     # -------------------------------------------------------------------------------------------------------
 
@@ -634,18 +636,20 @@
         posy = max(0, min(ystart, (maxy - window_size[1]) / SCROLLBAR_UNIT))
         self.MasterStateEditor.Scroll(posx, posy)
         self.MasterStateEditor.SetScrollbars(SCROLLBAR_UNIT, SCROLLBAR_UNIT,
-                maxx / SCROLLBAR_UNIT, maxy / SCROLLBAR_UNIT, posx, posy)
+                                             maxx / SCROLLBAR_UNIT,
+                                             maxy / SCROLLBAR_UNIT,
+                                             posx, posy)
         event.Skip()
 
     def _create_EthercatMasterEditor(self, prnt):
         self.EthercatMasterEditor = wx.ScrolledWindow(prnt,
-            style=wx.TAB_TRAVERSAL | wx.HSCROLL | wx.VSCROLL)
+                                                      style=wx.TAB_TRAVERSAL | wx.HSCROLL | wx.VSCROLL)
         self.EthercatMasterEditor.Bind(wx.EVT_SIZE, self.OnResize)
 
         self.EthercatMasterEditorSizer = wx.BoxSizer(wx.VERTICAL)
 
         self.NodesFilter = wx.ComboBox(self.EthercatMasterEditor,
-            style=wx.TE_PROCESS_ENTER)
+                                       style=wx.TE_PROCESS_ENTER)
         self.Bind(wx.EVT_COMBOBOX, self.OnNodesFilterChanged, self.NodesFilter)
         self.Bind(wx.EVT_TEXT_ENTER, self.OnNodesFilterChanged, self.NodesFilter)
         self.NodesFilter.Bind(wx.EVT_CHAR, self.OnNodesFilterKeyDown)
@@ -653,9 +657,9 @@
         process_variables_header = wx.BoxSizer(wx.HORIZONTAL)
 
         process_variables_label = wx.StaticText(self.EthercatMasterEditor,
-              label=_("Process variables mapped between nodes:"))
+                                                label=_("Process variables mapped between nodes:"))
         process_variables_header.AddWindow(process_variables_label, 1,
-              flag=wx.ALIGN_CENTER_VERTICAL)
+                                           flag=wx.ALIGN_CENTER_VERTICAL)
 
         for name, bitmap, help in [
                 ("AddVariableButton", "add_element", _("Add process variable")),
@@ -663,7 +667,7 @@
                 ("UpVariableButton", "up", _("Move process variable up")),
                 ("DownVariableButton", "down", _("Move process variable down"))]:
             button = wx.lib.buttons.GenBitmapButton(self.EthercatMasterEditor, bitmap=GetBitmap(bitmap),
-                  size=wx.Size(28, 28), style=wx.NO_BORDER)
+                                                    size=wx.Size(28, 28), style=wx.NO_BORDER)
             button.SetToolTipString(help)
             setattr(self, name, button)
             process_variables_header.AddWindow(button, border=5, flag=wx.LEFT)
@@ -672,23 +676,23 @@
         self.ProcessVariablesGrid.SetMinSize(wx.Size(0, 150))
         self.ProcessVariablesGrid.SetDropTarget(ProcessVariableDropTarget(self))
         self.ProcessVariablesGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGE,
-              self.OnProcessVariablesGridCellChange)
+                                       self.OnProcessVariablesGridCellChange)
         self.ProcessVariablesGrid.Bind(wx.grid.EVT_GRID_CELL_LEFT_CLICK,
-              self.OnProcessVariablesGridCellLeftClick)
+                                       self.OnProcessVariablesGridCellLeftClick)
         self.ProcessVariablesGrid.Bind(wx.EVT_KEY_DOWN, self.OnProcessVariablesGridKeyDown)
 
         startup_commands_header = wx.BoxSizer(wx.HORIZONTAL)
 
         startup_commands_label = wx.StaticText(self.EthercatMasterEditor,
-              label=_("Startup service variables assignments:"))
+                                               label=_("Startup service variables assignments:"))
         startup_commands_header.AddWindow(startup_commands_label, 1,
-              flag=wx.ALIGN_CENTER_VERTICAL)
+                                          flag=wx.ALIGN_CENTER_VERTICAL)
 
         for name, bitmap, help in [
                 ("AddCommandButton", "add_element", _("Add startup service variable")),
                 ("DeleteCommandButton", "remove_element", _("Remove startup service variable"))]:
             button = wx.lib.buttons.GenBitmapButton(self.EthercatMasterEditor, bitmap=GetBitmap(bitmap),
-                  size=wx.Size(28, 28), style=wx.NO_BORDER)
+                                                    size=wx.Size(28, 28), style=wx.NO_BORDER)
             button.SetToolTipString(help)
             setattr(self, name, button)
             startup_commands_header.AddWindow(button, border=5, flag=wx.LEFT)
@@ -697,9 +701,9 @@
         self.StartupCommandsGrid.SetDropTarget(StartupCommandDropTarget(self))
         self.StartupCommandsGrid.SetMinSize(wx.Size(0, 150))
         self.StartupCommandsGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGE,
-              self.OnStartupCommandsGridCellChange)
+                                      self.OnStartupCommandsGridCellChange)
         self.StartupCommandsGrid.Bind(wx.grid.EVT_GRID_EDITOR_SHOWN,
-              self.OnStartupCommandsGridEditorShow)
+                                      self.OnStartupCommandsGridEditorShow)
 
         self.NodesVariables = MasterNodesVariablesSizer(self.EthercatMasterEditor, self.Controler)
 
@@ -715,20 +719,20 @@
         staticbox_sizer.AddSizer(main_staticbox_sizer, 1, flag=wx.GROW)
         main_staticbox_sizer.AddWindow(self.NodesFilter, border=5, flag=wx.GROW | wx.ALL)
         main_staticbox_sizer.AddSizer(process_variables_header, border=5,
-              flag=wx.GROW | wx.LEFT | wx.RIGHT | wx.BOTTOM)
+                                      flag=wx.GROW | wx.LEFT | wx.RIGHT | wx.BOTTOM)
         main_staticbox_sizer.AddWindow(self.ProcessVariablesGrid, 1,
-              border=5, flag=wx.GROW | wx.LEFT | wx.RIGHT | wx.BOTTOM)
+                                       border=5, flag=wx.GROW | wx.LEFT | wx.RIGHT | wx.BOTTOM)
         main_staticbox_sizer.AddSizer(startup_commands_header,
-              border=5, flag=wx.GROW | wx.LEFT | wx.RIGHT | wx.BOTTOM)
+                                      border=5, flag=wx.GROW | wx.LEFT | wx.RIGHT | wx.BOTTOM)
         main_staticbox_sizer.AddWindow(self.StartupCommandsGrid, 1,
-              border=5, flag=wx.GROW | wx.LEFT | wx.RIGHT | wx.BOTTOM)
+                                       border=5, flag=wx.GROW | wx.LEFT | wx.RIGHT | wx.BOTTOM)
 
         second_staticbox = wx.StaticBox(self.EthercatMasterEditor, label=_("Nodes variables filter:"))
         second_staticbox_sizer = wx.StaticBoxSizer(second_staticbox, wx.VERTICAL)
         second_staticbox_sizer.AddSizer(self.NodesVariables, 1, border=5, flag=wx.GROW | wx.ALL)
 
         main_staticbox_sizer.AddSizer(second_staticbox_sizer, 1,
-            border=5, flag=wx.GROW | wx.LEFT | wx.RIGHT | wx.BOTTOM)
+                                      border=5, flag=wx.GROW | wx.LEFT | wx.RIGHT | wx.BOTTOM)
 
         self.EthercatMasterEditor.SetSizer(self.EthercatMasterEditorSizer)
 
@@ -1069,7 +1073,9 @@
         posy = max(0, min(ystart, (maxy - window_size[1]) / SCROLLBAR_UNIT))
         self.EthercatMasterEditor.Scroll(posx, posy)
         self.EthercatMasterEditor.SetScrollbars(SCROLLBAR_UNIT, SCROLLBAR_UNIT,
-                maxx / SCROLLBAR_UNIT, maxy / SCROLLBAR_UNIT, posx, posy)
+                                                maxx / SCROLLBAR_UNIT,
+                                                maxy / SCROLLBAR_UNIT,
+                                                posx, posy)
         event.Skip()
 
     # def OnButtonClick(self, event):
@@ -1113,15 +1119,15 @@
         self.AddGrowableRow(3)
 
         ESI_files_label = wx.StaticText(parent,
-            label=_("ESI Files:"))
+                                        label=_("ESI Files:"))
         self.AddWindow(ESI_files_label, border=10,
-            flag=wx.TOP | wx.LEFT | wx.RIGHT)
+                       flag=wx.TOP | wx.LEFT | wx.RIGHT)
 
         folder_tree_sizer = wx.FlexGridSizer(cols=2, hgap=5, rows=1, vgap=0)
         folder_tree_sizer.AddGrowableCol(0)
         folder_tree_sizer.AddGrowableRow(0)
         self.AddSizer(folder_tree_sizer, border=10,
-            flag=wx.GROW | wx.LEFT | wx.RIGHT)
+                      flag=wx.GROW | wx.LEFT | wx.RIGHT)
 
         self.ESIFiles = FolderTree(parent, self.GetPath(), editable=False)
         self.ESIFiles.SetFilter(".xml")
@@ -1129,12 +1135,13 @@
 
         buttons_sizer = wx.BoxSizer(wx.VERTICAL)
         folder_tree_sizer.AddSizer(buttons_sizer,
-            flag=wx.ALIGN_CENTER_VERTICAL)
+                                   flag=wx.ALIGN_CENTER_VERTICAL)
 
         for idx, (name, bitmap, help, callback) in enumerate(buttons):
             button = wx.lib.buttons.GenBitmapButton(parent,
-                  bitmap=GetBitmap(bitmap),
-                  size=wx.Size(28, 28), style=wx.NO_BORDER)
+                                                    bitmap=GetBitmap(bitmap),
+                                                    size=wx.Size(28, 28),
+                                                    style=wx.NO_BORDER)
             button.SetToolTipString(help)
             setattr(self, name, button)
             if idx > 0:
@@ -1148,26 +1155,26 @@
             buttons_sizer.AddWindow(button, border=10, flag=flag)
 
         modules_label = wx.StaticText(parent,
-            label=_("Modules library:"))
+                                      label=_("Modules library:"))
         self.AddSizer(modules_label, border=10,
-            flag=wx.LEFT | wx.RIGHT)
+                      flag=wx.LEFT | wx.RIGHT)
 
         self.ModulesGrid = wx.gizmos.TreeListCtrl(parent,
-              style=wx.TR_DEFAULT_STYLE |
-                    wx.TR_ROW_LINES |
-                    wx.TR_COLUMN_LINES |
-                    wx.TR_HIDE_ROOT |
-                    wx.TR_FULL_ROW_HIGHLIGHT)
+                                                  style=wx.TR_DEFAULT_STYLE |
+                                                  wx.TR_ROW_LINES |
+                                                  wx.TR_COLUMN_LINES |
+                                                  wx.TR_HIDE_ROOT |
+                                                  wx.TR_FULL_ROW_HIGHLIGHT)
         self.ModulesGrid.GetMainWindow().Bind(wx.EVT_LEFT_DOWN,
-            self.OnModulesGridLeftDown)
+                                              self.OnModulesGridLeftDown)
         self.ModulesGrid.Bind(wx.EVT_TREE_BEGIN_LABEL_EDIT,
-            self.OnModulesGridBeginLabelEdit)
+                              self.OnModulesGridBeginLabelEdit)
         self.ModulesGrid.Bind(wx.EVT_TREE_END_LABEL_EDIT,
-            self.OnModulesGridEndLabelEdit)
+                              self.OnModulesGridEndLabelEdit)
         self.ModulesGrid.GetHeaderWindow().Bind(wx.EVT_MOTION,
-            self.OnModulesGridHeaderMotion)
+                                                self.OnModulesGridHeaderMotion)
         self.AddWindow(self.ModulesGrid, border=10,
-            flag=wx.GROW | wx.BOTTOM | wx.LEFT | wx.RIGHT)
+                       flag=wx.GROW | wx.BOTTOM | wx.LEFT | wx.RIGHT)
 
         for colname, colsize, colalign in zip(
                 [_("Name")] + [param_infos["column_label"]
@@ -1202,8 +1209,8 @@
         if not root.IsOk():
             root = self.ModulesGrid.AddRoot("Modules")
         self.GenerateModulesGridBranch(root,
-            self.ModuleLibrary.GetModulesLibrary(),
-            GetVariablesTableColnames())
+                                       self.ModuleLibrary.GetModulesLibrary(),
+                                       GetVariablesTableColnames())
         self.ModulesGrid.Expand(root)
 
     def GenerateModulesGridBranch(self, root, modules, colnames):
@@ -1237,9 +1244,10 @@
 
     def OnImportButton(self, event):
         dialog = wx.FileDialog(self.ParentWindow,
-             _("Choose an XML file"),
-             os.getcwd(), "",
-             _("XML files (*.xml)|*.xml|All files|*.*"), wx.OPEN)
+                               _("Choose an XML file"),
+                               os.getcwd(), "",
+                               _("XML files (*.xml)|*.xml|All files|*.*"),
+                               wx.OPEN)
 
         if dialog.ShowModal() == wx.ID_OK:
             filepath = dialog.GetPath()
@@ -1247,8 +1255,9 @@
                 wx.CallAfter(self.RefreshView)
             else:
                 message = wx.MessageDialog(self,
-                    _("No such XML file: %s\n") % filepath,
-                    _("Error"), wx.OK | wx.ICON_ERROR)
+                                           _("No such XML file: %s\n") % filepath,
+                                           _("Error"),
+                                           wx.OK | wx.ICON_ERROR)
                 message.ShowModal()
                 message.Destroy()
         dialog.Destroy()
@@ -1261,8 +1270,9 @@
             folder, filename = os.path.split(filepath)
 
             dialog = wx.MessageDialog(self.ParentWindow,
-                  _("Do you really want to delete the file '%s'?") % filename,
-                  _("Delete File"), wx.YES_NO | wx.ICON_QUESTION)
+                                      _("Do you really want to delete the file '%s'?") % filename,
+                                      _("Delete File"),
+                                      wx.YES_NO | wx.ICON_QUESTION)
             remove = dialog.ShowModal() == wx.ID_YES
             dialog.Destroy()
 
@@ -1313,8 +1323,9 @@
                     event.Skip()
                 except ValueError:
                     message = wx.MessageDialog(self,
-                        _("Module %s must be an integer!") % stripped_column_label,
-                        _("Error"), wx.OK | wx.ICON_ERROR)
+                                               _("Module %s must be an integer!") % stripped_column_label,
+                                               _("Error"),
+                                               wx.OK | wx.ICON_ERROR)
                     message.ShowModal()
                     message.Destroy()
                     event.Veto()
@@ -1340,25 +1351,29 @@
 
     def __init__(self, parent, database):
         wx.Dialog.__init__(self, parent,
-              size=wx.Size(700, 500), title=_('ESI Files Database management'),
-              style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
+                           size=wx.Size(700, 500),
+                           title=_('ESI Files Database management'),
+                           style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
 
         main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10)
         main_sizer.AddGrowableCol(0)
         main_sizer.AddGrowableRow(0)
 
-        self.DatabaseSizer = LibraryEditorSizer(self, database,
-            [("ImportButton", "ImportESI", _("Import file to ESI files database"), None),
-             ("DeleteButton", "remove_element", _("Remove file from database"), None)])
+        self.DatabaseSizer = LibraryEditorSizer(
+            self, database,
+            [
+                ("ImportButton", "ImportESI", _("Import file to ESI files database"), None),
+                ("DeleteButton", "remove_element", _("Remove file from database"), None)
+            ])
         self.DatabaseSizer.SetControlMinSize(wx.Size(0, 0))
         main_sizer.AddSizer(self.DatabaseSizer, border=10,
-            flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT)
+                            flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT)
 
         button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE)
         button_sizer.GetAffirmativeButton().SetLabel(_("Add file to project"))
         button_sizer.GetCancelButton().SetLabel(_("Close"))
         main_sizer.AddSizer(button_sizer, border=10,
-              flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
+                            flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)
 
         self.SetSizer(main_sizer)
 
@@ -1375,14 +1390,17 @@
 
     def _create_ModuleLibraryEditor(self, prnt):
         self.ModuleLibraryEditor = wx.ScrolledWindow(prnt,
-            style=wx.TAB_TRAVERSAL | wx.HSCROLL | wx.VSCROLL)
+                                                     style=wx.TAB_TRAVERSAL | wx.HSCROLL | wx.VSCROLL)
         self.ModuleLibraryEditor.Bind(wx.EVT_SIZE, self.OnResize)
 
-        self.ModuleLibrarySizer = LibraryEditorSizer(self.ModuleLibraryEditor,
+        self.ModuleLibrarySizer = LibraryEditorSizer(
+            self.ModuleLibraryEditor,
             self.Controler.GetModulesLibraryInstance(),
-            [("ImportButton", "ImportESI", _("Import ESI file"), None),
-             ("AddButton", "ImportDatabase", _("Add file from ESI files database"), self.OnAddButton),
-             ("DeleteButton", "remove_element", _("Remove file from library"), None)])
+            [
+                ("ImportButton", "ImportESI", _("Import ESI file"), None),
+                ("AddButton", "ImportDatabase", _("Add file from ESI files database"), self.OnAddButton),
+                ("DeleteButton", "remove_element", _("Remove file from library"), None)
+            ])
         self.ModuleLibrarySizer.SetControlMinSize(wx.Size(0, 200))
         self.ModuleLibraryEditor.SetSizer(self.ModuleLibrarySizer)
 
@@ -1399,7 +1417,7 @@
 
     def OnAddButton(self, event):
         dialog = DatabaseManagementDialog(self,
-            self.Controler.GetModulesDatabaseInstance())
+                                          self.Controler.GetModulesDatabaseInstance())
 
         if dialog.ShowModal() == wx.ID_OK:
             module_library = self.Controler.GetModulesLibraryInstance()
@@ -1420,5 +1438,7 @@
         posy = max(0, min(ystart, (maxy - window_size[1]) / SCROLLBAR_UNIT))
         self.ModuleLibraryEditor.Scroll(posx, posy)
         self.ModuleLibraryEditor.SetScrollbars(SCROLLBAR_UNIT, SCROLLBAR_UNIT,
-                maxx / SCROLLBAR_UNIT, maxy / SCROLLBAR_UNIT, posx, posy)
+                                               maxx / SCROLLBAR_UNIT,
+                                               maxy / SCROLLBAR_UNIT,
+                                               posx, posy)
         event.Skip()
--- a/etherlab/EtherCATManagementEditor.py	Sat Sep 29 15:03:17 2018 +0300
+++ b/etherlab/EtherCATManagementEditor.py	Sat Sep 29 15:16:21 2018 +0300
@@ -144,7 +144,7 @@
             self.StaticTextDic[statictext_name] = wx.StaticText(self, label=_(statictext_label))
             self.TextCtrlDic[textctrl_name] = wx.TextCtrl(self, size=wx.Size(130, 24), style=wx.TE_READONLY)
             self.SizerDic["SlaveInfosDetailsInnerSizer"].AddMany([self.StaticTextDic[statictext_name],
-                                                               self.TextCtrlDic[textctrl_name]])
+                                                                  self.TextCtrlDic[textctrl_name]])
 
         self.SizerDic["SlaveInfosDetailsBox"].AddSizer(self.SizerDic["SlaveInfosDetailsInnerSizer"])
 
@@ -181,7 +181,7 @@
             self.SizerDic["SlaveState_down_sizer"].Add(self.ButtonDic[button_name])
 
         self.SizerDic["SlaveState_sizer"].AddMany([self.SizerDic["SlaveState_up_sizer"],
-            self.SizerDic["SlaveState_down_sizer"]])
+                                                   self.SizerDic["SlaveState_down_sizer"]])
 
         self.SizerDic["SlaveStateBox"].Add(self.SizerDic["SlaveState_sizer"])
 
@@ -375,10 +375,11 @@
         """
 
         slaveSDO_progress = wx.ProgressDialog("Slave SDO Monitoring", "Now Uploading...",
-                               maximum=len(self.SDOs.splitlines()), parent=self,
-                               style=wx.PD_CAN_ABORT | wx.PD_APP_MODAL | wx.PD_ELAPSED_TIME |
-                                     wx.PD_ESTIMATED_TIME | wx.PD_REMAINING_TIME |
-                                     wx.PD_AUTO_HIDE | wx.PD_SMOOTH)
+                                              maximum=len(self.SDOs.splitlines()),
+                                              parent=self,
+                                              style=wx.PD_CAN_ABORT | wx.PD_APP_MODAL | wx.PD_ELAPSED_TIME |
+                                              wx.PD_ESTIMATED_TIME | wx.PD_REMAINING_TIME |
+                                              wx.PD_AUTO_HIDE | wx.PD_SMOOTH)
 
         # If keep_going flag is False, SDOParser method is stop and return "False".
         keep_going = True
@@ -496,11 +497,11 @@
         count = 1
 
         page_texts = [("all", self.parent.AllSDOData),
-                     ("0x0000 - 0x0ff", self.parent.DatatypeDescription),
-                     ("0x1000 - 0x1fff", self.parent.CommunicationObject),
-                     ("0x2000 - 0x5fff", self.parent.ManufacturerSpecific),
-                     ("0x6000 - 0x9fff", self.parent.ProfileSpecific),
-                     ("0xa000 - 0xffff", self.parent.Reserved)]
+                      ("0x0000 - 0x0ff", self.parent.DatatypeDescription),
+                      ("0x1000 - 0x1fff", self.parent.CommunicationObject),
+                      ("0x2000 - 0x5fff", self.parent.ManufacturerSpecific),
+                      ("0x6000 - 0x9fff", self.parent.ProfileSpecific),
+                      ("0xa000 - 0xffff", self.parent.Reserved)]
 
         page_tooltip_string = ["SDO Index 0x0000 - 0x0fff : Data Type Description",
                                "SDO Index 0x1000 - 0x1fff : Communication object",
@@ -664,8 +665,12 @@
                     # check "Access" field
                     if self.DecideSDODownload(self.Controler.CommonMethod.SlaveState[self.Controler.GetSlavePos()]):
                         # Request "SDODownload"
-                        self.Controler.CommonMethod.SDODownload(self.SDOs[event.GetRow()]['type'], self.SDOs[event.GetRow()]['idx'],
-                                                   self.SDOs[event.GetRow()]['subIdx'], dlg.GetValue())
+                        self.Controler.CommonMethod.SDODownload(
+                            self.SDOs[event.GetRow()]['type'],
+                            self.SDOs[event.GetRow()]['idx'],
+                            self.SDOs[event.GetRow()]['subIdx'],
+                            dlg.GetValue())
+
                         self.SetCellValue(event.GetRow(), event.GetCol(), hex(int(dlg.GetValue(), 0)))
                     else:
                         self.Controler.CommonMethod.CreateErrorDialog('You cannot SDO download this state')
@@ -1267,11 +1272,12 @@
                              "siiButton": wx.BoxSizer()}
         self.HexViewButton = {}
 
-        for key, evt_handler in [("Sii Upload", self.OnButtonSiiUpload),
-                                ("Sii Download", self.OnButtonSiiDownload),
-                                ("Write to File", self.OnButtonWriteToBinFile),
-                                ("Read from File", self.OnButtonReadFromBinFile),
-                                ("XML to EEPROM Image", self.OnButtonXmlToEEPROMImg)]:
+        for key, evt_handler in [
+                ("Sii Upload", self.OnButtonSiiUpload),
+                ("Sii Download", self.OnButtonSiiDownload),
+                ("Write to File", self.OnButtonWriteToBinFile),
+                ("Read from File", self.OnButtonReadFromBinFile),
+                ("XML to EEPROM Image", self.OnButtonXmlToEEPROMImg)]:
             self.HexViewButton[key] = wx.Button(self, -1, key)
             self.HexViewButton[key].Bind(wx.EVT_BUTTON, evt_handler)
             self.HexViewSizer["siiButton"].Add(self.HexViewButton[key])
@@ -1828,7 +1834,7 @@
 
         for index in range(4):
             self.RegPage[index] = RegisterNotebookPanel(self, self.Controler,
-                                                    parent.MainRow[index], parent.MainCol)
+                                                        parent.MainRow[index], parent.MainCol)
             self.AddPage(self.RegPage[index],
                          "0x"+"{:0>4x}".format(index*1024)+" - 0x"+"{:0>4x}".format((index+1)*1024-1))
 
--- a/etherlab/EthercatCFileGenerator.py	Sat Sep 29 15:03:17 2018 +0300
+++ b/etherlab/EthercatCFileGenerator.py	Sat Sep 29 15:16:21 2018 +0300
@@ -357,7 +357,8 @@
                     if exclusion_scope[0]["matching"] > 0:
                         selected_pdos.append(exclusion_scope[0]["index"])
                         start_excluding_index = 1
-                    excluded_pdos.extend([pdo["index"]
+                    excluded_pdos.extend([
+                        pdo["index"]
                         for pdo in exclusion_scope[start_excluding_index:]
                         if PdoAssign or not pdo["assigned"]])
 
--- a/etherlab/EthercatCIA402Slave.py	Sat Sep 29 15:03:17 2018 +0300
+++ b/etherlab/EthercatCIA402Slave.py	Sat Sep 29 15:16:21 2018 +0300
@@ -106,7 +106,7 @@
     """ % ("\n".join(["""\
           <xsd:attribute name="Enable%s" type="xsd:boolean"
                          use="optional" default="false"/>""" % category
-                for category, variables in EXTRA_NODE_VARIABLES]) + AxisXSD)
+                      for category, variables in EXTRA_NODE_VARIABLES]) + AxisXSD)
 
     NODE_PROFILE = 402
     EditorType = CIA402NodeEditor
@@ -236,13 +236,14 @@
                     for input in blocktype_infos["inputs"]]
                 ])
 
-            return_outputs = "\n".join(["""\
+            return_outputs = "\n".join([
+                """\
     __SET_VAR(data__->,%(output_name)s,,
               __GET_VAR(%(blockname)s->%(output_name)s));""" % locals()
-                    for output_name in ["DONE", "BUSY", "ERROR"] + [
+                for output_name in ["DONE", "BUSY", "ERROR"] + [
                         output["name"].upper()
                         for output in blocktype_infos["outputs"]]
-                ])
+            ])
 
             fieldbus_interface_declaration.append("""
 extern void ETHERLAB%(ucase_blocktype)s_body__(ETHERLAB%(ucase_blocktype)s* data__);
@@ -333,7 +334,7 @@
 
         # Write generated content to CIA402 node file
         Gen_CIA402Nodefile_path = os.path.join(buildpath,
-                                "cia402node_%s.c" % location_str)
+                                               "cia402node_%s.c" % location_str)
         cia402nodefile = open(Gen_CIA402Nodefile_path, 'w')
         cia402nodefile.write(plc_cia402node_code % locals())
         cia402nodefile.close()
--- a/etherlab/EthercatMaster.py	Sat Sep 29 15:03:17 2018 +0300
+++ b/etherlab/EthercatMaster.py	Sat Sep 29 15:16:21 2018 +0300
@@ -294,7 +294,8 @@
     def OnAddEthercatSlave(self, event):
         app_frame = self.GetCTRoot().AppFrame
         dialog = BrowseValuesLibraryDialog(app_frame,
-            "Ethercat Slave Type", self.GetSlaveTypesLibrary())
+                                           "Ethercat Slave Type",
+                                           self.GetSlaveTypesLibrary())
         if dialog.ShowModal() == wx.ID_OK:
             type_infos = dialog.GetValueInfos()
             device, module_extra_params = self.GetModuleInfos(type_infos)
@@ -443,7 +444,8 @@
 
         execute = True
         if len(self.Children) > 0:
-            dialog = wx.MessageDialog(app_frame,
+            dialog = wx.MessageDialog(
+                app_frame,
                 _("The current network configuration will be deleted.\nDo you want to continue?"),
                 _("Scan Network"),
                 wx.YES_NO | wx.ICON_QUESTION)
@@ -744,7 +746,8 @@
 
         self.FileGenerator.GenerateCFile(Gen_Ethercatfile_path, location_str, self.BaseParams.getIEC_Channel())
 
-        LocationCFilesAndCFLAGS.insert(0,
+        LocationCFilesAndCFLAGS.insert(
+            0,
             (current_location,
              [(Gen_Ethercatfile_path, '"-I%s"' % os.path.abspath(self.GetCTRoot().GetIECLibPath()))],
              True))
--- a/etherlab/EthercatSlave.py	Sat Sep 29 15:03:17 2018 +0300
+++ b/etherlab/EthercatSlave.py	Sat Sep 29 15:16:21 2018 +0300
@@ -22,12 +22,12 @@
 
 
 TYPECONVERSION = {"BOOL": "X", "SINT": "B", "INT": "W", "DINT": "D", "LINT": "L",
-    "USINT": "B", "UINT": "W", "UDINT": "D", "ULINT": "L",
-    "BYTE": "B", "WORD": "W", "DWORD": "D", "LWORD": "L"}
+                  "USINT": "B", "UINT": "W", "UDINT": "D", "ULINT": "L",
+                  "BYTE": "B", "WORD": "W", "DWORD": "D", "LWORD": "L"}
 
 DATATYPECONVERSION = {"BOOL": "BIT", "SINT": "S8", "INT": "S16", "DINT": "S32", "LINT": "S64",
-    "USINT": "U8", "UINT": "U16", "UDINT": "U32", "ULINT": "U64",
-    "BYTE": "U8", "WORD": "U16", "DWORD": "U32", "LWORD": "U64"}
+                      "USINT": "U8", "UINT": "U16", "UDINT": "U32", "ULINT": "U64",
+                      "BYTE": "U8", "WORD": "U16", "DWORD": "U32", "LWORD": "U64"}
 
 VARCLASSCONVERSION = {"T": LOCATION_VAR_INPUT, "R": LOCATION_VAR_OUTPUT, "RT": LOCATION_VAR_MEMORY}
 
@@ -107,16 +107,22 @@
                 })
 
             slave_type = self.CTNParent.GetSlaveType(self.GetSlavePos())
-            params[0]['children'].insert(0,
-                   {'use': 'optional',
+            params[0]['children'].insert(
+                0,
+                {
+                    'use': 'optional',
                     'type': self.CTNParent.GetSlaveTypesLibrary(self.NODE_PROFILE),
                     'name': 'Type',
-                    'value': (slave_type["device_type"], slave_type)})
-            params[0]['children'].insert(1,
-                   {'use': 'optional',
+                    'value': (slave_type["device_type"], slave_type)
+                })
+            params[0]['children'].insert(
+                1,
+                {
+                    'use': 'optional',
                     'type': 'unsignedLong',
                     'name': 'Alias',
-                    'value': self.CTNParent.GetSlaveAlias(self.GetSlavePos())})
+                    'value': self.CTNParent.GetSlaveAlias(self.GetSlavePos())
+                })
             return params
 
     def SetParamsAttribute(self, path, value):
--- a/etherlab/etherlab.py	Sat Sep 29 15:03:17 2018 +0300
+++ b/etherlab/etherlab.py	Sat Sep 29 15:16:21 2018 +0300
@@ -43,8 +43,7 @@
 
 
 def EntryName(context, *args):
-    return ExtractName(args[0],
-        args[1][0] if len(args) > 1 else None)
+    return ExtractName(args[0], args[1][0] if len(args) > 1 else None)
 
 
 ENTRY_INFOS_KEYS = [
@@ -231,12 +230,15 @@
                     for group in self.groups_xpath(self.modules_infos):
                         group_type = group.getType()
 
-                        vendor_category["groups"].setdefault(group_type,
-                            {"name": ExtractName(group.getName(), group_type),
-                             "parent": group.getParentGroup(),
-                             "order": group.getSortOrder(),
-                             # "value": group.getcontent()["value"],
-                             "devices": []})
+                        vendor_category["groups"].setdefault(
+                            group_type,
+                            {
+                                "name": ExtractName(group.getName(), group_type),
+                                "parent": group.getParentGroup(),
+                                "order": group.getSortOrder(),
+                                # "value": group.getcontent()["value"],
+                                "devices": [],
+                            })
 
                     for device in self.devices_xpath(self.modules_infos):
                         device_group = device.getGroupType()