etherlab/runtime_etherlab.py
changeset 2363 9c7da6ff6a34
parent 2360 2a3d022a7dac
child 2365 bc07b9910cdb
--- a/etherlab/runtime_etherlab.py	Fri Sep 28 18:12:18 2018 +0300
+++ b/etherlab/runtime_etherlab.py	Fri Sep 28 19:02:49 2018 +0300
@@ -47,7 +47,7 @@
     if res != 0 :
         PLCObject.LogMessage(
             LogLevelsDict["WARNING"],
-            "%s : %s" % (command,output))
+            "%s : %s" % (command, output))
 
 
 def EthercatSDOUpload(pos, index, subindex, var_type):
@@ -85,19 +85,19 @@
     s=ctypes.create_string_buffer(4*1024)
     last = None
     while not StopKMSGThread:
-        l = klog(3,s,len(s)-1)
+        l = klog(3, s, len(s)-1)
         log = s.value[:l-1]
         if last :
             log = log.rpartition(last)[2]
         if log :
             last = log.rpartition('\n')[2]
-            for lvl,msg in re.findall(
+            for lvl, msg in re.findall(
                             r'<(\d)>\[\s*\d*\.\d*\]\s*(EtherCAT\s*.*)$',
                             log, re.MULTILINE):
                 PLCObject.LogMessage(
                     LogLevelsDict[{
-                        "4":"WARNING",
-                        "3":"CRITICAL"}.get(lvl,"DEBUG")],
+                        "4": "WARNING",
+                        "3": "CRITICAL"}.get(lvl, "DEBUG")],
                     msg)
         time.sleep(0.5)