python3 support: pylint, W1633 # (round-builtin) round built-in referenced
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Fri, 12 Oct 2018 13:24:47 +0300
changeset 2457 9deec258ab1a
parent 2456 7373e3048167
child 2459 21164625b393
child 2494 a30dfc8a0c29
python3 support: pylint, W1633 # (round-builtin) round built-in referenced

because round behavior is changed to default behavior in Python3
(Banker round). It can cause slight differences in some cases.
Mostly graphical editors are affected, there could be single pixel differences.
Now I couldn't locate any visual differences in test programs.
IDEFrame.py
PLCControler.py
editors/LDViewer.py
editors/Viewer.py
graphics/GraphicCommons.py
graphics/LD_Objects.py
graphics/SFC_Objects.py
tests/tools/check_source.sh
xmlclass/xsdschema.py
--- a/IDEFrame.py	Fri Oct 12 12:06:45 2018 +0300
+++ b/IDEFrame.py	Fri Oct 12 13:24:47 2018 +0300
@@ -26,7 +26,9 @@
 from __future__ import division
 import sys
 import base64
-from builtins import str as text
+from future.builtins import \
+    round, \
+    str as text
 
 import wx
 import wx.grid
--- a/PLCControler.py	Fri Oct 12 12:06:45 2018 +0300
+++ b/PLCControler.py	Fri Oct 12 13:24:47 2018 +0300
@@ -32,6 +32,7 @@
 import datetime
 from time import localtime
 from functools import reduce
+from future.builtins import round
 
 import util.paths as paths
 from plcopen import *
--- a/editors/LDViewer.py	Fri Oct 12 12:06:45 2018 +0300
+++ b/editors/LDViewer.py	Fri Oct 12 13:24:47 2018 +0300
@@ -25,6 +25,7 @@
 
 from __future__ import absolute_import
 from __future__ import division
+from future.builtins import round
 
 import wx
 from six.moves import xrange
--- a/editors/Viewer.py	Fri Oct 12 12:06:45 2018 +0300
+++ b/editors/Viewer.py	Fri Oct 12 13:24:47 2018 +0300
@@ -28,6 +28,7 @@
 import math
 from time import time as gettime
 from threading import Lock
+from future.builtins import round
 
 import wx
 from six.moves import xrange
--- a/graphics/GraphicCommons.py	Fri Oct 12 12:06:45 2018 +0300
+++ b/graphics/GraphicCommons.py	Fri Oct 12 13:24:47 2018 +0300
@@ -26,6 +26,7 @@
 from __future__ import absolute_import
 from __future__ import division
 from math import *
+from future.builtins import round
 from six import string_types
 from six.moves import xrange
 
--- a/graphics/LD_Objects.py	Fri Oct 12 12:06:45 2018 +0300
+++ b/graphics/LD_Objects.py	Fri Oct 12 13:24:47 2018 +0300
@@ -26,6 +26,7 @@
 from __future__ import absolute_import
 from __future__ import division
 import wx
+from future.builtins import round
 from six.moves import xrange
 
 from graphics.GraphicCommons import *
--- a/graphics/SFC_Objects.py	Fri Oct 12 12:06:45 2018 +0300
+++ b/graphics/SFC_Objects.py	Fri Oct 12 13:24:47 2018 +0300
@@ -25,6 +25,8 @@
 
 from __future__ import absolute_import
 from __future__ import division
+from future.builtins import round
+
 import wx
 from six.moves import xrange
 
--- a/tests/tools/check_source.sh	Fri Oct 12 12:06:45 2018 +0300
+++ b/tests/tools/check_source.sh	Fri Oct 12 13:24:47 2018 +0300
@@ -375,6 +375,7 @@
     enable=$enable,W1622          # (next-method-called) Called a next() method on an object
     enable=$enable,W1653          # (next-method-defined) next method defined
     enable=$enable,W1610          # (reduce-builtin) reduce built-in referenced
+    enable=$enable,W1633          # (round-builtin) round built-in referenced
     # enable=
 
     options=
--- a/xmlclass/xsdschema.py	Fri Oct 12 12:06:45 2018 +0300
+++ b/xmlclass/xsdschema.py	Fri Oct 12 13:24:47 2018 +0300
@@ -30,6 +30,7 @@
 import datetime
 from types import FunctionType
 from xml.dom import minidom
+from future.builtins import round
 from six import string_types
 from past.builtins import long