cleanup etherlab: pep8, E261 at least two spaces before inline comment
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Fri, 28 Sep 2018 18:06:59 +0300
changeset 2361 5d6ce74f7835
parent 2360 2a3d022a7dac
child 2362 6d31ef14f396
cleanup etherlab: pep8, E261 at least two spaces before inline comment
etherlab/CommonEtherCATFunction.py
etherlab/EtherCATManagementEditor.py
--- a/etherlab/CommonEtherCATFunction.py	Fri Sep 28 18:04:28 2018 +0300
+++ b/etherlab/CommonEtherCATFunction.py	Fri Sep 28 18:06:59 2018 +0300
@@ -863,8 +863,8 @@
         eeprom = []
         self.Strings = []
         data = ""
-        count = 0 # string counter
-        padflag = False # padding flag if category length is odd
+        count = 0        # string counter
+        padflag = False  # padding flag if category length is odd
 
         # index information for General Category in EEPROM
         self.GroupIdx = 0
@@ -1173,11 +1173,11 @@
         eeprom.append("{:0>2x}".format(self.NameIdx))
 
         # word 3 : Physical Layer Port info. and CoE Details
-        eeprom.append("01") # Physical Layer Port info - assume 01
+        eeprom.append("01")  # Physical Layer Port info - assume 01
         #  CoE Details; <EtherCATInfo>-<Descriptions>-<Devices>-<Device>-<Mailbox>-<CoE>
         coe_details = 0
         mb = device.getMailbox()
-        coe_details = 1 # sdo enabled
+        coe_details = 1  # sdo enabled
         if mb is not None :
             coe = mb.getCoE()
             if coe is not None:
@@ -1214,7 +1214,7 @@
         eeprom.append("01" if ds402ch in [True,1] else "00")
 
         # word 6 : SysmanClass(reserved) and Flags
-        eeprom.append("00") # reserved
+        eeprom.append("00")  # reserved
         #  Flags
         en_safeop = False
         en_lrw = False
@@ -1261,7 +1261,7 @@
         """
         eeprom = []
         data = ""
-        count = 0 # number of FMMU
+        count = 0  # number of FMMU
         padflag = False
 
         for fmmu in device.getFmmu():
--- a/etherlab/EtherCATManagementEditor.py	Fri Sep 28 18:04:28 2018 +0300
+++ b/etherlab/EtherCATManagementEditor.py	Fri Sep 28 18:06:59 2018 +0300
@@ -1467,7 +1467,7 @@
             self.CompactViewCheckbox.Disable()
             for index in range(4):
                 self.RegisterNotebook.RegPage[index].MainTable.SetValue(self, 0, index*512, (index+1)*512)
-        else: # If data was saved,
+        else:  # If data was saved,
             self.BasicSetData()
             self.ParseData()
             for index in range(4):
@@ -1561,7 +1561,7 @@
                                 if register.attributes[property].value == value:
                                     self.GetRegisterInfo(reg_info_tree, register)
                                     break
-                            else: # type == "number"
+                            else:  # type == "number"
                                 if register.attributes[property].value < value:
                                     self.GetRegisterInfo(reg_info_tree, register)
                                     break
@@ -1608,7 +1608,7 @@
                                     if detail.attributes[property].value == value:
                                         self.GetRegisterDetailInfo(reg_info_tree, reg_index, detail)
                                         break
-                                else: # type == "number"
+                                else:  # type == "number"
                                     if detail.attributes[property].value < value:
                                         self.GetRegisterDetailInfo(reg_info_tree, reg_index, detail)
                                         break
@@ -1705,7 +1705,7 @@
                 row_data.append(char_data)
 
                 self.RegMonitorData.append(row_data)
-                reg_word = "" # initialize regWord
+                reg_word = ""  # initialize regWord
                 row_data = []
 
     def OnReloadButton(self, event):