clean etherlab: pylint, W1618 # (no-absolute-import) import missing `from __future__ import absolute_import`
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Sat, 29 Sep 2018 17:52:33 +0300
changeset 2405 af050469fc5c
parent 2404 87eb184414bd
child 2406 ffd091b51cd0
clean etherlab: pylint, W1618 # (no-absolute-import) import missing `from __future__ import absolute_import`
etherlab/CommonEtherCATFunction.py
etherlab/ConfigEditor.py
etherlab/EtherCATManagementEditor.py
etherlab/EthercatCFileGenerator.py
etherlab/EthercatCIA402Slave.py
etherlab/EthercatMaster.py
etherlab/EthercatSlave.py
etherlab/etherlab.py
etherlab/runtime_etherlab.py
--- a/etherlab/CommonEtherCATFunction.py	Sat Sep 29 17:39:21 2018 +0300
+++ b/etherlab/CommonEtherCATFunction.py	Sat Sep 29 17:52:33 2018 +0300
@@ -8,6 +8,7 @@
 #
 # See COPYING file for copyrights details.
 
+from __future__ import absolute_import
 import wx
 
 mailbox_protocols = ["AoE", "EoE", "CoE", "FoE", "SoE", "VoE"]
--- a/etherlab/ConfigEditor.py	Sat Sep 29 17:39:21 2018 +0300
+++ b/etherlab/ConfigEditor.py	Sat Sep 29 17:52:33 2018 +0300
@@ -9,6 +9,7 @@
 #
 # See COPYING file for copyrights details.
 
+from __future__ import absolute_import
 import os
 import re
 from types import TupleType
@@ -26,7 +27,7 @@
 from util.TranslationCatalogs import NoTranslate
 
 # -----------------------------------------------------------------------
-from EtherCATManagementEditor import EtherCATManagementTreebook, MasterStatePanelClass
+from etherlab.EtherCATManagementEditor import EtherCATManagementTreebook, MasterStatePanelClass
 # -----------------------------------------------------------------------
 
 [ETHERCAT_VENDOR, ETHERCAT_GROUP, ETHERCAT_DEVICE] = range(3)
--- a/etherlab/EtherCATManagementEditor.py	Sat Sep 29 17:39:21 2018 +0300
+++ b/etherlab/EtherCATManagementEditor.py	Sat Sep 29 17:52:33 2018 +0300
@@ -7,6 +7,7 @@
 #
 # See COPYING file for copyrights details.
 
+from __future__ import absolute_import
 import os
 import string
 from xml.dom import minidom
--- a/etherlab/EthercatCFileGenerator.py	Sat Sep 29 17:39:21 2018 +0300
+++ b/etherlab/EthercatCFileGenerator.py	Sat Sep 29 17:52:33 2018 +0300
@@ -9,9 +9,10 @@
 #
 # See COPYING file for copyrights details.
 
+from __future__ import absolute_import
 import os
 
-from EthercatSlave import ExtractHexDecValue, DATATYPECONVERSION, ExtractName
+from etherlab.EthercatSlave import ExtractHexDecValue, DATATYPECONVERSION, ExtractName
 
 SLAVE_PDOS_CONFIGURATION_DECLARATION = """
 /* Slave %(slave)d, "%(device_type)s"
--- a/etherlab/EthercatCIA402Slave.py	Sat Sep 29 17:39:21 2018 +0300
+++ b/etherlab/EthercatCIA402Slave.py	Sat Sep 29 17:52:33 2018 +0300
@@ -9,6 +9,7 @@
 #
 # See COPYING file for copyrights details.
 
+from __future__ import absolute_import
 import os
 
 import wx
@@ -16,8 +17,8 @@
 from PLCControler import LOCATION_CONFNODE, LOCATION_VAR_INPUT
 
 from MotionLibrary import Headers, AxisXSD
-from EthercatSlave import _EthercatSlaveCTN, _CommonSlave
-from ConfigEditor import CIA402NodeEditor
+from etherlab.EthercatSlave import _EthercatSlaveCTN, _CommonSlave
+from etherlab.ConfigEditor import CIA402NodeEditor
 
 # Definition of node variables that have to be mapped in PDO
 # [(name, index, subindex, type,
--- a/etherlab/EthercatMaster.py	Sat Sep 29 17:39:21 2018 +0300
+++ b/etherlab/EthercatMaster.py	Sat Sep 29 17:52:33 2018 +0300
@@ -9,6 +9,7 @@
 #
 # See COPYING file for copyrights details.
 
+from __future__ import absolute_import
 import os
 from copy import deepcopy
 from lxml import etree
@@ -23,12 +24,18 @@
 from IDEFrame import TITLE, FILEMENU, PROJECTTREE
 from POULibrary import POULibrary
 
-from ConfigEditor import MasterEditor
-from EthercatCFileGenerator import _EthercatCFileGenerator
-from EthercatSlave import _EthercatSlaveCTN, ExtractHexDecValue, GenerateHexDecValue, TYPECONVERSION, VARCLASSCONVERSION, _CommonSlave
+from etherlab.ConfigEditor import MasterEditor
+from etherlab.EthercatCFileGenerator import _EthercatCFileGenerator
+from etherlab.EthercatSlave import \
+    _EthercatSlaveCTN, \
+    ExtractHexDecValue, \
+    GenerateHexDecValue, \
+    TYPECONVERSION, \
+    VARCLASSCONVERSION, \
+    _CommonSlave
 
 try:
-    from EthercatCIA402Slave import _EthercatCIA402SlaveCTN
+    from etherlab.EthercatCIA402Slave import _EthercatCIA402SlaveCTN
     HAS_MCL = True
 except Exception:
     HAS_MCL = False
--- a/etherlab/EthercatSlave.py	Sat Sep 29 17:39:21 2018 +0300
+++ b/etherlab/EthercatSlave.py	Sat Sep 29 17:52:33 2018 +0300
@@ -9,13 +9,15 @@
 #
 # See COPYING file for copyrights details.
 
+from __future__ import absolute_import
+
 from PLCControler import LOCATION_CONFNODE, LOCATION_VAR_INPUT, LOCATION_VAR_OUTPUT, LOCATION_VAR_MEMORY
 from ConfigTreeNode import ConfigTreeNode
 
-from ConfigEditor import NodeEditor
+from etherlab.ConfigEditor import NodeEditor
 
 # ------------------------------------------
-from CommonEtherCATFunction import _CommonSlave
+from etherlab.CommonEtherCATFunction import _CommonSlave
 # ------------------------------------------
 
 
--- a/etherlab/etherlab.py	Sat Sep 29 17:39:21 2018 +0300
+++ b/etherlab/etherlab.py	Sat Sep 29 17:52:33 2018 +0300
@@ -9,6 +9,7 @@
 #
 # See COPYING file for copyrights details.
 
+from __future__ import absolute_import
 import os
 import shutil
 import csv
@@ -20,9 +21,9 @@
 
 from ConfigTreeNode import XSDSchemaErrorMessage
 
-from EthercatSlave import ExtractHexDecValue, ExtractName
-from EthercatMaster import _EthercatCTN
-from ConfigEditor import LibraryEditor, ETHERCAT_VENDOR, ETHERCAT_GROUP, ETHERCAT_DEVICE
+from etherlab.EthercatSlave import ExtractHexDecValue, ExtractName
+from etherlab.EthercatMaster import _EthercatCTN
+from etherlab.ConfigEditor import LibraryEditor, ETHERCAT_VENDOR, ETHERCAT_GROUP, ETHERCAT_DEVICE
 
 ScriptDirectory = os.path.split(os.path.realpath(__file__))[0]
 
--- a/etherlab/runtime_etherlab.py	Sat Sep 29 17:39:21 2018 +0300
+++ b/etherlab/runtime_etherlab.py	Sat Sep 29 17:52:33 2018 +0300
@@ -1,3 +1,4 @@
+from __future__ import absolute_import
 import os
 import signal
 import subprocess