clean etherlab: pylint,E0602 # (undefined-variable) Undefined variable 'X'
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Sat, 29 Sep 2018 17:39:21 +0300
changeset 2404 87eb184414bd
parent 2403 045df8ecc8b3
child 2405 af050469fc5c
clean etherlab: pylint,E0602 # (undefined-variable) Undefined variable 'X'
.pylint
etherlab/EthercatMaster.py
etherlab/runtime_etherlab.py
--- a/.pylint	Sat Sep 29 17:12:44 2018 +0300
+++ b/.pylint	Sat Sep 29 17:39:21 2018 +0300
@@ -110,7 +110,7 @@
 
 # List of additional names supposed to be defined in builtins. Remember that
 # you should avoid to define new builtins when possible.
-additional-builtins=_,website,JS,cobalt
+additional-builtins=_,website,JS,cobalt,PLCBinary
 
 # List of strings which can identify a callback function by name. A callback
 # name must start or end with one of those strings.
--- a/etherlab/EthercatMaster.py	Sat Sep 29 17:12:44 2018 +0300
+++ b/etherlab/EthercatMaster.py	Sat Sep 29 17:39:21 2018 +0300
@@ -249,7 +249,7 @@
 
             if error is not None:
                 self.GetCTRoot().logger.write_error(
-                    _("Couldn't load %s network configuration file.") % CTNName)
+                    _("Couldn't load %s network configuration file.") % self.CTNName())
 
         if self.Config is None:
             self.Config = EtherCATConfigParser.CreateElement("EtherCATConfig")
@@ -270,7 +270,7 @@
 
             if error is not None:
                 self.GetCTRoot().logger.write_error(
-                    _("Couldn't load %s network process variables file.") % CTNName)
+                    _("Couldn't load %s network process variables file.") % self.CTNName())
 
         if self.ProcessVariables is None:
             self.ProcessVariables = ProcessVariablesParser.CreateElement("ProcessVariables")
--- a/etherlab/runtime_etherlab.py	Sat Sep 29 17:12:44 2018 +0300
+++ b/etherlab/runtime_etherlab.py	Sat Sep 29 17:39:21 2018 +0300
@@ -1,9 +1,12 @@
 import os
+import signal
 import subprocess
 import ctypes
 from threading import Thread
 import time
 import re
+
+import runtime.PLCObject as PLCObject
 from runtime.loglevels import LogLevelsDict
 
 SDOAnswered = PLCBinary.SDOAnswered
@@ -111,7 +114,7 @@
 def _runtime_etherlab_cleanup():
     global KMSGPollThread, StopKMSGThread, SDOProc, SDOThread
     try:
-        os.kill(SDOProc.pid, SIGTERM)
+        os.kill(SDOProc.pid, signal.SIGTERM)
     except Exception:
         pass
     SDOThread = None