python3 support: pylint, W1613 # (xrange-builtin) xrange built-in referenced
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Thu, 04 Oct 2018 12:07:16 +0300
changeset 2432 dbc065a2f7a5
parent 2431 6923074540dd
child 2433 2e8bf28a8909
python3 support: pylint, W1613 # (xrange-builtin) xrange built-in referenced
BeremizIDE.py
IDEFrame.py
PLCGenerator.py
ProjectController.py
controls/CustomStyledTextCtrl.py
controls/DebugVariablePanel/DebugVariableGraphicViewer.py
controls/FolderTree.py
controls/LogViewer.py
controls/VariablePanel.py
dialogs/DiscoveryDialog.py
editors/CodeFileEditor.py
editors/DataTypeEditor.py
editors/LDViewer.py
editors/ResourceEditor.py
editors/TextViewer.py
editors/Viewer.py
graphics/FBD_Objects.py
graphics/GraphicCommons.py
graphics/LD_Objects.py
graphics/SFC_Objects.py
modbus/mb_utils.py
modbus/modbus.py
plcopen/plcopen.py
runtime/PLCObject.py
tests/tools/check_source.sh
xmlclass/xmlclass.py
--- a/BeremizIDE.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/BeremizIDE.py	Thu Oct 04 12:07:16 2018 +0300
@@ -35,7 +35,7 @@
 from time import time as gettime
 from threading import Lock, Timer, currentThread
 
-from six.moves import cPickle
+from six.moves import cPickle, xrange
 import wx.lib.buttons
 import wx.lib.statbmp
 import wx.stc
--- a/IDEFrame.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/IDEFrame.py	Thu Oct 04 12:07:16 2018 +0300
@@ -30,7 +30,7 @@
 import wx
 import wx.grid
 import wx.aui
-from six.moves import cPickle
+from six.moves import cPickle, xrange
 
 from editors.EditorPanel import EditorPanel
 from editors.SFCViewer import SFC_Viewer
--- a/PLCGenerator.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/PLCGenerator.py	Thu Oct 04 12:07:16 2018 +0300
@@ -26,6 +26,8 @@
 from __future__ import absolute_import
 from types import *
 import re
+from six.moves import xrange
+
 from plcopen import PLCOpenParser
 from plcopen.structures import *
 from plcopen.types_enums import *
--- a/ProjectController.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/ProjectController.py	Thu Oct 04 12:07:16 2018 +0300
@@ -41,6 +41,7 @@
 from datetime import datetime
 from weakref import WeakKeyDictionary
 from itertools import izip
+from six.moves import xrange
 
 import wx
 
--- a/controls/CustomStyledTextCtrl.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/controls/CustomStyledTextCtrl.py	Thu Oct 04 12:07:16 2018 +0300
@@ -26,6 +26,7 @@
 from __future__ import absolute_import
 import wx
 import wx.stc
+from six.moves import xrange
 
 if wx.Platform == '__WXMSW__':
     faces = {
--- a/controls/DebugVariablePanel/DebugVariableGraphicViewer.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/controls/DebugVariablePanel/DebugVariableGraphicViewer.py	Thu Oct 04 12:07:16 2018 +0300
@@ -36,6 +36,7 @@
 from matplotlib.backends.backend_wxagg import _convert_agg_to_wx_bitmap
 from matplotlib.backends.backend_agg import FigureCanvasAgg
 from mpl_toolkits.mplot3d import Axes3D
+from six.moves import xrange
 
 from editors.DebugViewer import REFRESH_PERIOD
 from controls.DebugVariablePanel.DebugVariableViewer import *
--- a/controls/FolderTree.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/controls/FolderTree.py	Thu Oct 04 12:07:16 2018 +0300
@@ -27,6 +27,7 @@
 import os
 
 import wx
+from six.moves import xrange
 
 from util.BitmapLibrary import GetBitmap
 
--- a/controls/LogViewer.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/controls/LogViewer.py	Thu Oct 04 12:07:16 2018 +0300
@@ -30,6 +30,7 @@
 
 import numpy
 import wx
+from six.moves import xrange
 
 from controls.CustomToolTip import CustomToolTip, TOOLTIP_WAIT_PERIOD
 from editors.DebugViewer import DebugViewer, REFRESH_PERIOD
--- a/controls/VariablePanel.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/controls/VariablePanel.py	Thu Oct 04 12:07:16 2018 +0300
@@ -30,6 +30,7 @@
 import wx
 import wx.grid
 import wx.lib.buttons
+from six.moves import xrange
 
 from plcopen.structures import LOCATIONDATATYPES, TestIdentifier, IEC_KEYWORDS, DefaultType
 from plcopen.VariableInfoCollector import _VariableInfos
--- a/dialogs/DiscoveryDialog.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/dialogs/DiscoveryDialog.py	Thu Oct 04 12:07:16 2018 +0300
@@ -26,10 +26,12 @@
 
 from __future__ import absolute_import
 import socket
+from six.moves import xrange
 import wx
 import wx.lib.mixins.listctrl as listmix
 from zeroconf import ServiceBrowser, Zeroconf
 
+
 service_type = '_PYRO._tcp.local.'
 
 
--- a/editors/CodeFileEditor.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/editors/CodeFileEditor.py	Thu Oct 04 12:07:16 2018 +0300
@@ -30,6 +30,7 @@
 import wx.grid
 import wx.stc as stc
 import wx.lib.buttons
+from six.moves import xrange
 
 from plcopen.plcopen import TestTextElement
 from plcopen.structures import TestIdentifier, IEC_KEYWORDS, DefaultType
--- a/editors/DataTypeEditor.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/editors/DataTypeEditor.py	Thu Oct 04 12:07:16 2018 +0300
@@ -27,6 +27,7 @@
 from __future__ import absolute_import
 import re
 from types import TupleType
+from six.moves import xrange
 
 import wx
 import wx.grid
--- a/editors/LDViewer.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/editors/LDViewer.py	Thu Oct 04 12:07:16 2018 +0300
@@ -27,6 +27,7 @@
 from types import *
 
 import wx
+from six.moves import xrange
 
 from editors.Viewer import *
 
--- a/editors/ResourceEditor.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/editors/ResourceEditor.py	Thu Oct 04 12:07:16 2018 +0300
@@ -27,6 +27,7 @@
 import wx
 import wx.lib.buttons
 import wx.grid
+from six.moves import xrange
 
 from graphics.GraphicCommons import REFRESH_HIGHLIGHT_PERIOD, ERROR_HIGHLIGHT
 from controls import CustomGrid, CustomTable, DurationCellEditor
--- a/editors/TextViewer.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/editors/TextViewer.py	Thu Oct 04 12:07:16 2018 +0300
@@ -29,6 +29,7 @@
 
 import wx
 import wx.stc
+from six.moves import xrange
 
 from graphics.GraphicCommons import ERROR_HIGHLIGHT, SEARCH_RESULT_HIGHLIGHT, REFRESH_HIGHLIGHT_PERIOD
 from plcopen.structures import ST_BLOCK_START_KEYWORDS, IEC_BLOCK_START_KEYWORDS, LOCATIONDATATYPES
--- a/editors/Viewer.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/editors/Viewer.py	Thu Oct 04 12:07:16 2018 +0300
@@ -30,6 +30,7 @@
 from threading import Lock
 
 import wx
+from six.moves import xrange
 
 from plcopen.structures import *
 from plcopen.types_enums import ComputePouName
--- a/graphics/FBD_Objects.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/graphics/FBD_Objects.py	Thu Oct 04 12:07:16 2018 +0300
@@ -25,6 +25,7 @@
 
 from __future__ import absolute_import
 import wx
+from six.moves import xrange
 
 from graphics.GraphicCommons import *
 from plcopen.structures import *
--- a/graphics/GraphicCommons.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/graphics/GraphicCommons.py	Thu Oct 04 12:07:16 2018 +0300
@@ -26,6 +26,7 @@
 from __future__ import absolute_import
 from math import *
 from types import *
+from six.moves import xrange
 
 import wx
 from graphics.ToolTipProducer import ToolTipProducer
--- a/graphics/LD_Objects.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/graphics/LD_Objects.py	Thu Oct 04 12:07:16 2018 +0300
@@ -25,6 +25,7 @@
 
 from __future__ import absolute_import
 import wx
+from six.moves import xrange
 
 from graphics.GraphicCommons import *
 from graphics.DebugDataConsumer import DebugDataConsumer
--- a/graphics/SFC_Objects.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/graphics/SFC_Objects.py	Thu Oct 04 12:07:16 2018 +0300
@@ -25,6 +25,7 @@
 
 from __future__ import absolute_import
 import wx
+from six.moves import xrange
 
 from graphics.GraphicCommons import *
 from graphics.DebugDataConsumer import DebugDataConsumer
--- a/modbus/mb_utils.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/modbus/mb_utils.py	Thu Oct 04 12:07:16 2018 +0300
@@ -22,6 +22,8 @@
 # This code is made available on the understanding that it will not be
 # used in safety-critical situations without a full and competent review.
 
+from __future__ import absolute_import
+from six.moves import xrange
 
 # dictionary implementing:
 # key   - string with the description we want in the request plugin GUI
--- a/modbus/modbus.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/modbus/modbus.py	Thu Oct 04 12:07:16 2018 +0300
@@ -25,8 +25,9 @@
 
 from __future__ import absolute_import
 import os
+from six.moves import xrange
+
 from modbus.mb_utils import *
-
 from ConfigTreeNode import ConfigTreeNode
 from PLCControler import LOCATION_CONFNODE, LOCATION_VAR_MEMORY
 
--- a/plcopen/plcopen.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/plcopen/plcopen.py	Thu Oct 04 12:07:16 2018 +0300
@@ -29,6 +29,7 @@
 import re
 from collections import OrderedDict
 
+from six.moves import xrange
 from lxml import etree
 
 from xmlclass import *
--- a/runtime/PLCObject.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/runtime/PLCObject.py	Thu Oct 04 12:07:16 2018 +0300
@@ -32,7 +32,7 @@
 import _ctypes  # pylint: disable=wrong-import-order
 import Pyro.core as pyro
 import six
-from six.moves import _thread
+from six.moves import _thread, xrange
 
 from runtime.typemapping import TypeTranslator
 from runtime.loglevels import LogLevelsDefault, LogLevelsCount
--- a/tests/tools/check_source.sh	Thu Oct 04 11:25:42 2018 +0300
+++ b/tests/tools/check_source.sh	Thu Oct 04 12:07:16 2018 +0300
@@ -350,6 +350,7 @@
 
     # python3 compatibility checks
     enable=$enable,W1648          # (bad-python3-import) Module moved in Python 3
+    enable=$enable,W1613          # (xrange-builtin) xrange built-in referenced
     # enable=
 
     options=
--- a/xmlclass/xmlclass.py	Thu Oct 04 11:25:42 2018 +0300
+++ b/xmlclass/xmlclass.py	Thu Oct 04 12:07:16 2018 +0300
@@ -32,7 +32,7 @@
 from xml.dom import minidom
 from xml.sax.saxutils import unescape
 from collections import OrderedDict
-
+from six.moves import xrange
 from lxml import etree