--- a/Beremiz.py Fri Oct 28 13:06:52 2022 +0800
+++ b/Beremiz.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,12 +23,9 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
import os
import sys
import getopt
-from past.builtins import execfile
import wx
from wx.lib.agw.advancedsplash import AdvancedSplash, AS_NOTIMEOUT, AS_CENTER_ON_SCREEN
--- a/BeremizIDE.py Fri Oct 28 13:06:52 2022 +0800
+++ b/BeremizIDE.py Fri Oct 28 14:07:13 2022 +0800
@@ -24,8 +24,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
import os
import sys
import shutil
@@ -34,7 +32,7 @@
from time import time as gettime
from threading import Lock, Timer, currentThread
-from six.moves import cPickle, xrange
+from six.moves import cPickle
import wx.lib.buttons
import wx.lib.statbmp
import wx.stc
--- a/Beremiz_service.py Fri Oct 28 13:06:52 2022 +0800
+++ b/Beremiz_service.py Fri Oct 28 14:07:13 2022 +0800
@@ -24,8 +24,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
import os
import sys
import getopt
@@ -34,9 +32,7 @@
import traceback
import threading
from threading import Thread, Semaphore, Lock, currentThread
-from builtins import str as text
-from past.builtins import execfile
-from six.moves import builtins
+import builtins
from functools import partial
import runtime
@@ -363,7 +359,7 @@
def OnTaskBarChangePort(self, evt):
dlg = ParamsEntryDialog(None, _("Enter a port number "), defaultValue=str(self.pyroserver.port))
- dlg.SetTests([(text.isdigit, _("Port number must be an integer!")), (lambda port: 0 <= int(port) <= 65535, _("Port number must be 0 <= port <= 65535!"))])
+ dlg.SetTests([(str.isdigit, _("Port number must be an integer!")), (lambda port: 0 <= int(port) <= 65535, _("Port number must be 0 <= port <= 65535!"))])
if dlg.ShowModal() == wx.ID_OK:
self.pyroserver.port = int(dlg.GetValue())
self.pyroserver.Restart()
--- a/CodeFileTreeNode.py Fri Oct 28 13:06:52 2022 +0800
+++ b/CodeFileTreeNode.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,11 +23,9 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
import os
import re
import traceback
-from builtins import str as text
from copy import deepcopy
from lxml import etree
@@ -128,7 +126,7 @@
self.GetCTRoot().logger.write_warning(XSDSchemaErrorMessage.format(a1=fname, a2=lnum, a3=src))
self.CreateCodeFileBuffer(True)
except Exception as exc:
- msg = _("Couldn't load confnode parameters {a1} :\n {a2}").format(a1=self.CTNName(), a2=text(exc))
+ msg = _("Couldn't load confnode parameters {a1} :\n {a2}").format(a1=self.CTNName(), a2=str(exc))
self.GetCTRoot().logger.write_error(msg)
self.GetCTRoot().logger.write_error(traceback.format_exc())
raise Exception
--- a/ConfigTreeNode.py Fri Oct 28 13:06:52 2022 +0800
+++ b/ConfigTreeNode.py Fri Oct 28 14:07:13 2022 +0800
@@ -38,8 +38,6 @@
import shutil
from operator import add
from functools import reduce
-from builtins import str as text
-from past.builtins import execfile
from lxml import etree
@@ -294,7 +292,7 @@
LDFLAGS = []
if CTNLDFLAGS is not None:
# LDFLAGS can be either string
- if isinstance(CTNLDFLAGS, (str, text)):
+ if isinstance(CTNLDFLAGS, str):
LDFLAGS += [CTNLDFLAGS]
# or list of strings
elif isinstance(CTNLDFLAGS, list):
@@ -647,7 +645,7 @@
self.MandatoryParams = ("BaseParams", self.BaseParams)
basexmlfile.close()
except Exception as exc:
- msg = _("Couldn't load confnode base parameters {a1} :\n {a2}").format(a1=ConfNodeName, a2=text(exc))
+ msg = _("Couldn't load confnode base parameters {a1} :\n {a2}").format(a1=ConfNodeName, a2=str(exc))
self.GetCTRoot().logger.write_error(msg)
self.GetCTRoot().logger.write_error(traceback.format_exc())
@@ -664,7 +662,7 @@
self.CTNParams = (name, obj)
xmlfile.close()
except Exception as exc:
- msg = _("Couldn't load confnode parameters {a1} :\n {a2}").format(a1=ConfNodeName, a2=text(exc))
+ msg = _("Couldn't load confnode parameters {a1} :\n {a2}").format(a1=ConfNodeName, a2=str(exc))
self.GetCTRoot().logger.write_error(msg)
self.GetCTRoot().logger.write_error(traceback.format_exc())
@@ -677,7 +675,7 @@
try:
self.CTNAddChild(pname, ptype)
except Exception as exc:
- msg = _("Could not add child \"{a1}\", type {a2} :\n{a3}\n").format(a1=pname, a2=ptype, a3=text(exc))
+ msg = _("Could not add child \"{a1}\", type {a2} :\n{a3}\n").format(a1=pname, a2=ptype, a3=str(exc))
self.GetCTRoot().logger.write_error(msg)
self.GetCTRoot().logger.write_error(traceback.format_exc())
--- a/IDEFrame.py Fri Oct 28 13:06:52 2022 +0800
+++ b/IDEFrame.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,17 +23,13 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
import sys
import base64
-from future.builtins import \
- round, \
- str as text
import wx
import wx.grid
import wx.aui
-from six.moves import cPickle, xrange
+from six.moves import cPickle
from editors.EditorPanel import EditorPanel
from editors.SFCViewer import SFC_Viewer
@@ -111,7 +107,7 @@
def DecodeFileSystemPath(path, is_base64=True):
if is_base64:
path = base64.decodestring(path)
- return text(path, sys.getfilesystemencoding())
+ return str(path, sys.getfilesystemencoding())
def AppendMenu(parent, help, kind, text, id=wx.ID_ANY):
--- a/PLCControler.py Fri Oct 28 13:06:52 2022 +0800
+++ b/PLCControler.py Fri Oct 28 14:07:13 2022 +0800
@@ -24,15 +24,12 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
from copy import deepcopy
import os
import re
import datetime
from time import localtime
from functools import reduce
-from future.builtins import round
import util.paths as paths
from plcopen import *
--- a/PLCGenerator.py Fri Oct 28 13:06:52 2022 +0800
+++ b/PLCGenerator.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,10 +23,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
import re
from functools import reduce
-from six.moves import xrange
from plcopen import PLCOpenParser
from plcopen.structures import *
--- a/ProjectController.py Fri Oct 28 13:06:52 2022 +0800
+++ b/ProjectController.py Fri Oct 28 14:07:13 2022 +0800
@@ -28,7 +28,6 @@
"""
-
import os
import traceback
import time
@@ -42,7 +41,6 @@
from functools import reduce
from distutils.dir_util import copy_tree
-from six.moves import xrange
import wx
--- a/canfestival/config_utils.py Fri Oct 28 13:06:52 2022 +0800
+++ b/canfestival/config_utils.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,12 +23,9 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
import os
import sys
import getopt
-from past.builtins import int
from functools import reduce
# Translation between IEC types and Can Open types
--- a/connectors/WAMP/__init__.py Fri Oct 28 13:06:52 2022 +0800
+++ b/connectors/WAMP/__init__.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,13 +23,10 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
import sys
import traceback
from functools import partial
from threading import Thread, Event
-from six import text_type as text
from twisted.internet import reactor, threads
from autobahn.twisted import wamp
@@ -85,7 +82,7 @@
# create a WAMP application session factory
component_config = types.ComponentConfig(
- realm=text(realm),
+ realm=str(realm),
extra={"ID": ID})
session_factory = wamp.ApplicationSessionFactory(
config=component_config)
@@ -111,7 +108,7 @@
reactor.run(installSignalHandlers=False)
def WampSessionProcMapper(funcname):
- wampfuncname = text('.'.join((ID, funcname)))
+ wampfuncname = str('.'.join((ID, funcname)))
def catcher_func(*args, **kwargs):
if _WampSession is not None:
--- a/controls/CustomStyledTextCtrl.py Fri Oct 28 13:06:52 2022 +0800
+++ b/controls/CustomStyledTextCtrl.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,11 +23,9 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
from functools import reduce
import wx
import wx.stc
-from six.moves import xrange
if wx.Platform == '__WXMSW__':
faces = {
--- a/controls/DebugVariablePanel/DebugVariableGraphicViewer.py Fri Oct 28 13:06:52 2022 +0800
+++ b/controls/DebugVariablePanel/DebugVariableGraphicViewer.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,8 +23,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
from time import time as gettime
from cycler import cycler
@@ -36,7 +34,6 @@
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/DiscoveryPanel.py Fri Oct 28 13:06:52 2022 +0800
+++ b/controls/DiscoveryPanel.py Fri Oct 28 14:07:13 2022 +0800
@@ -24,9 +24,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
import socket
-from six.moves import xrange
import wx
import wx.lib.mixins.listctrl as listmix
from zeroconf import ServiceBrowser, Zeroconf, get_all_addresses
--- a/controls/FolderTree.py Fri Oct 28 13:06:52 2022 +0800
+++ b/controls/FolderTree.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,11 +23,9 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
import os
import wx
-from six.moves import xrange
from util.BitmapLibrary import GetBitmap
--- a/controls/LogViewer.py Fri Oct 28 13:06:52 2022 +0800
+++ b/controls/LogViewer.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,15 +23,12 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
from datetime import datetime
from time import time as gettime
from weakref import proxy
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 Fri Oct 28 13:06:52 2022 +0800
+++ b/controls/VariablePanel.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,17 +23,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
import re
-from builtins import str as text
import wx
import wx.grid
import wx.lib.buttons
-from six import string_types
-from six.moves import xrange
-
from plcopen.structures import LOCATIONDATATYPES, TestIdentifier, IEC_KEYWORDS, DefaultType
from plcopen.VariableInfoCollector import _VariableInfos
@@ -144,7 +138,7 @@
if colname == "Type" and isinstance(value, tuple):
if value[0] == "array":
return "ARRAY [%s] OF %s" % (",".join(map("..".join, value[2])), value[1])
- if not isinstance(value, string_types):
+ if not isinstance(value, str):
value = str(value)
if colname in ["Class", "Option"]:
return _(value)
@@ -609,7 +603,7 @@
model = re.compile(r"%[IQM][XBWLD]?(.*\.|)")
prefix = model.match(old_location).group(0)
addr = int(re.split(model, old_location)[-1]) + 1
- row_content.Location = prefix + text(addr)
+ row_content.Location = prefix + str(addr)
if not row_content.Class:
row_content.Class = self.DefaultTypes.get(self.Filter, self.Filter)
--- a/dialogs/ForceVariableDialog.py Fri Oct 28 13:06:52 2022 +0800
+++ b/dialogs/ForceVariableDialog.py Fri Oct 28 14:07:13 2022 +0800
@@ -22,10 +22,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
import re
import datetime
-from builtins import str as text
import wx
@@ -224,7 +222,7 @@
Returns text representation for a variable value
@return: variable value as a string
"""
- return text(self.ValueCtrl.GetValue())
+ return str(self.ValueCtrl.GetValue())
# -----------------------------------------------
# integer and floating point number type methods
@@ -247,7 +245,7 @@
if value is not None:
up = evt.GetEventType() == wx.EVT_SPIN_UP._getEvtType()
value = value + 1 if up else value - 1
- self.ValueCtrl.SetValue(text(value))
+ self.ValueCtrl.SetValue(str(value))
evt.Skip()
# -----------------------------------------------
--- a/editors/CodeFileEditor.py Fri Oct 28 13:06:52 2022 +0800
+++ b/editors/CodeFileEditor.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,16 +23,12 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
import re
-from builtins import str as text
import wx
import wx.grid
import wx.stc as stc
import wx.lib.buttons
-from six.moves import xrange
from plcopen.plcopen import TestTextElement
@@ -636,7 +632,7 @@
if col == 0:
return row + 1
else:
- return text(self.data[row].get(self.GetColLabelValue(col, False), ""))
+ return str(self.data[row].get(self.GetColLabelValue(col, False), ""))
def _updateColAttrs(self, grid):
"""
--- a/editors/DataTypeEditor.py Fri Oct 28 13:06:52 2022 +0800
+++ b/editors/DataTypeEditor.py Fri Oct 28 14:07:13 2022 +0800
@@ -24,9 +24,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
import re
-from six.moves import xrange
import wx
import wx.grid
--- a/editors/LDViewer.py Fri Oct 28 13:06:52 2022 +0800
+++ b/editors/LDViewer.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,12 +23,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
-from future.builtins import round
-
import wx
-from six.moves import xrange
from editors.Viewer import *
--- a/editors/ResourceEditor.py Fri Oct 28 13:06:52 2022 +0800
+++ b/editors/ResourceEditor.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,11 +23,9 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
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 Fri Oct 28 13:06:52 2022 +0800
+++ b/editors/TextViewer.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,14 +23,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
import re
from functools import reduce
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 Fri Oct 28 13:06:52 2022 +0800
+++ b/editors/Viewer.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,15 +23,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
import math
from time import time as gettime
from threading import Lock
-from future.builtins import round
import wx
-from six.moves import xrange
from plcopen.structures import *
from plcopen.types_enums import ComputePouName
@@ -3400,7 +3396,7 @@
middle = True
new_pos = [bbx.x, bbx.y]
result = self.Controler.PasteEditedElementInstances(self.TagName, element, new_pos, middle, self.Debug)
- if not isinstance(result, string_types):
+ if not isinstance(result, str):
self.RefreshBuffer()
self.RefreshView(selection=result)
self.RefreshVariablePanel()
--- a/etherlab/etherlab.py Fri Oct 28 13:06:52 2022 +0800
+++ b/etherlab/etherlab.py Fri Oct 28 14:07:13 2022 +0800
@@ -13,7 +13,6 @@
import os
import shutil
import csv
-from builtins import str as text
from lxml import etree
import wx
@@ -425,7 +424,7 @@
# self.GetCTRoot().logger.write_warning(
# XSDSchemaErrorMessage % (filepath + error))
except Exception as exc:
- self.modules_infos, error = None, text(exc)
+ self.modules_infos, error = None, str(exc)
xmlfile.close()
if self.modules_infos is not None:
--- a/fake_wx.py Fri Oct 28 13:06:52 2022 +0800
+++ b/fake_wx.py Fri Oct 28 14:07:13 2022 +0800
@@ -105,7 +105,7 @@
parentmod = mod
-from six.moves import builtins
+import builtins
builtins.__dict__['_'] = get_translation
--- a/graphics/FBD_Objects.py Fri Oct 28 13:06:52 2022 +0800
+++ b/graphics/FBD_Objects.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,10 +23,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
import wx
-from six.moves import xrange
from graphics.GraphicCommons import *
from plcopen.structures import *
--- a/graphics/GraphicCommons.py Fri Oct 28 13:06:52 2022 +0800
+++ b/graphics/GraphicCommons.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,12 +23,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
from math import *
-from future.builtins import round
-from six import string_types
-from six.moves import xrange
import wx
from graphics.ToolTipProducer import ToolTipProducer
@@ -1084,7 +1079,7 @@
y -= 5
height += 5
rect = wx.Rect(x - abs(movex), y - abs(movey), width + 2 * abs(movex), height + 2 * abs(movey))
- if self.ValueSize is None and isinstance(self.ComputedValue, string_types):
+ if self.ValueSize is None and isinstance(self.ComputedValue, str):
self.ValueSize = self.ParentBlock.Parent.GetMiniTextExtent(self.ComputedValue)
if self.ValueSize is not None:
width, height = self.ValueSize
@@ -1542,7 +1537,7 @@
if self.Value is not None and not isinstance(self.Value, bool) and self.Value != "undefined":
dc.SetFont(self.ParentBlock.Parent.GetMiniFont())
dc.SetTextForeground(wx.NamedColour("purple"))
- if self.ValueSize is None and isinstance(self.ComputedValue, string_types):
+ if self.ValueSize is None and isinstance(self.ComputedValue, str):
self.ValueSize = self.ParentBlock.Parent.GetMiniTextExtent(self.ComputedValue)
if self.ValueSize is not None:
width, height = self.ValueSize
@@ -1610,7 +1605,7 @@
rect = rect.Union(self.StartConnected.GetRedrawRect(movex, movey))
if self.EndConnected:
rect = rect.Union(self.EndConnected.GetRedrawRect(movex, movey))
- if self.ValueSize is None and isinstance(self.ComputedValue, string_types):
+ if self.ValueSize is None and isinstance(self.ComputedValue, str):
self.ValueSize = self.Parent.GetMiniTextExtent(self.ComputedValue)
if self.ValueSize is not None:
width, height = self.ValueSize
@@ -2750,7 +2745,7 @@
if self.Value is not None and not isinstance(self.Value, bool) and self.Value != "undefined":
dc.SetFont(self.Parent.GetMiniFont())
dc.SetTextForeground(wx.NamedColour("purple"))
- if self.ValueSize is None and isinstance(self.ComputedValue, string_types):
+ if self.ValueSize is None and isinstance(self.ComputedValue, str):
self.ValueSize = self.Parent.GetMiniTextExtent(self.ComputedValue)
if self.ValueSize is not None:
width, height = self.ValueSize
--- a/graphics/LD_Objects.py Fri Oct 28 13:06:52 2022 +0800
+++ b/graphics/LD_Objects.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,11 +23,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
import wx
-from future.builtins import round
-from six.moves import xrange
from graphics.GraphicCommons import *
from graphics.DebugDataConsumer import DebugDataConsumer
--- a/graphics/SFC_Objects.py Fri Oct 28 13:06:52 2022 +0800
+++ b/graphics/SFC_Objects.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,12 +23,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
-from future.builtins import round
-
import wx
-from six.moves import xrange
from graphics.GraphicCommons import *
from graphics.DebugDataConsumer import DebugDataConsumer
--- a/i18n/mki18n.py Fri Oct 28 13:06:52 2022 +0800
+++ b/i18n/mki18n.py Fri Oct 28 14:07:13 2022 +0800
@@ -80,11 +80,9 @@
#
-
import os
import sys
import re
-from builtins import str as text
import wx
@@ -515,7 +513,7 @@
makePO(appDirPath, option['domain'], option['verbose'])
exit_code = 0
except IOError as e:
- printUsage(text(e) + '\n You must write a file app.fil that contains the list of all files to parse.')
+ printUsage(str(e) + '\n You must write a file app.fil that contains the list of all files to parse.')
if option['mo']:
makeMO(appDirPath, option['moTarget'], option['domain'], option['verbose'], option['forceEnglish'])
exit_code = 0
--- a/modbus/mb_utils.py Fri Oct 28 13:06:52 2022 +0800
+++ b/modbus/mb_utils.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,9 +23,6 @@
# used in safety-critical situations without a full and competent review.
-
-from six.moves import xrange
-
# dictionary implementing:
# key - string with the description we want in the request plugin GUI
# tuple - (modbus function number, request type, max count value,
--- a/modbus/modbus.py Fri Oct 28 13:06:52 2022 +0800
+++ b/modbus/modbus.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,9 +23,7 @@
# used in safety-critical situations without a full and competent review.
-
import os
-from six.moves import xrange
from modbus.mb_utils import *
from ConfigTreeNode import ConfigTreeNode
--- a/plcopen/plcopen.py Fri Oct 28 13:06:52 2022 +0800
+++ b/plcopen/plcopen.py Fri Oct 28 14:07:13 2022 +0800
@@ -24,12 +24,9 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
import re
from collections import OrderedDict
-from six.moves import xrange
from lxml import etree
from xmlclass import *
--- a/py_ext/PythonFileCTNMixin.py Fri Oct 28 13:06:52 2022 +0800
+++ b/py_ext/PythonFileCTNMixin.py Fri Oct 28 14:07:13 2022 +0800
@@ -24,10 +24,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
import os
import re
-from builtins import str as text
import util.paths as paths
from xmlclass import GenerateParserFromXSD
@@ -77,7 +75,7 @@
self.CreateCodeFileBuffer(False)
self.OnCTNSave()
except Exception as exc:
- error = text(exc)
+ error = str(exc)
if error is not None:
self.GetCTRoot().logger.write_error(
--- a/runtime/PLCObject.py Fri Oct 28 13:06:52 2022 +0800
+++ b/runtime/PLCObject.py Fri Oct 28 14:07:13 2022 +0800
@@ -22,7 +22,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
from threading import Thread, Lock, Event, Condition
import ctypes
import os
@@ -33,8 +32,6 @@
import hashlib
from tempfile import mkstemp
from functools import wraps, partial
-from six.moves import xrange
-from past.builtins import execfile
import _ctypes
from runtime.typemapping import TypeTranslator
--- a/runtime/WampClient.py Fri Oct 28 13:06:52 2022 +0800
+++ b/runtime/WampClient.py Fri Oct 28 14:07:13 2022 +0800
@@ -22,13 +22,10 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-
import time
import json
import os
import re
-from six import text_type as text
from autobahn.twisted import wamp
from autobahn.twisted.websocket import WampWebSocketClientFactory, connectWS
from autobahn.wamp import types, auth
@@ -142,7 +139,7 @@
self.register(GetCallee(name), '.'.join((ID, name)), registerOptions)
for name in SubscribedEvents:
- self.subscribe(GetCallee(name), text(name))
+ self.subscribe(GetCallee(name), str(name))
for func in DoOnJoin:
func(self)
@@ -158,7 +155,7 @@
def publishWithOwnID(self, eventID, value):
ID = self.config.extra["ID"]
- self.publish(text(ID+'.'+eventID), value)
+ self.publish(str(ID+'.'+eventID), value)
class ReconnectingWampWebSocketClientFactory(WampWebSocketClientFactory, ReconnectingClientFactory):
@@ -370,12 +367,12 @@
def PublishEvent(eventID, value):
if getWampStatus() == "Attached":
- _WampSession.publish(text(eventID), value)
+ _WampSession.publish(str(eventID), value)
def PublishEventWithOwnID(eventID, value):
if getWampStatus() == "Attached":
- _WampSession.publishWithOwnID(text(eventID), value)
+ _WampSession.publishWithOwnID(str(eventID), value)
# WEB CONFIGURATION INTERFACE
@@ -446,7 +443,7 @@
def getDownloadUrl(ctx, argument):
if lastKnownConfig is not None:
- return url.URL.fromContext(ctx).\
+ return url.URL.fromConstr(ctx).\
child(WAMP_SECRET_URL).\
child(lastKnownConfig["ID"] + ".secret")
--- a/util/TranslationCatalogs.py Fri Oct 28 13:06:52 2022 +0800
+++ b/util/TranslationCatalogs.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,9 +23,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
import os
-from six.moves import builtins
+import builtins
import wx
--- a/util/paths.py Fri Oct 28 13:06:52 2022 +0800
+++ b/util/paths.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,14 +23,12 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
import os
import sys
-from builtins import str as text
def AbsFile(file):
if isinstance(file, str):
- file = text(file, sys.getfilesystemencoding())
+ file = str(file, sys.getfilesystemencoding())
return file
--- a/xmlclass/xmlclass.py Fri Oct 28 13:06:52 2022 +0800
+++ b/xmlclass/xmlclass.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,8 +23,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
import os
import re
import datetime
@@ -32,10 +30,7 @@
from xml.dom import minidom
from xml.sax.saxutils import unescape
from collections import OrderedDict
-from builtins import str as text
-
-from six import string_types
-from six.moves import xrange
+
from lxml import etree
@@ -141,14 +136,14 @@
if not extract:
return attr
if len(attr.childNodes) == 1:
- return text(unescape(attr.childNodes[0].data))
+ return str(unescape(attr.childNodes[0].data))
else:
# content is a CDATA
txt = ''
for node in attr.childNodes:
if not (node.nodeName == "#text" and node.data.strip() == ''):
- txt += text(unescape(node.data))
- return text
+ txt += str(unescape(node.data))
+ return txt
def GetNormalizedString(attr, extract=True):
@@ -576,7 +571,7 @@
"extract": ExtractAny,
"generate": GenerateAny,
"initial": InitialAny,
- "check": lambda x: isinstance(x, (string_types, etree.ElementBase))
+ "check": lambda x: isinstance(x, (str, etree.ElementBase))
}
@@ -612,7 +607,7 @@
def FindTypeInfos(factory, infos):
- if isinstance(infos, string_types):
+ if isinstance(infos, str):
namespace, name = DecomposeQualifiedName(infos)
return factory.GetQualifiedNameInfos(name, namespace)
return infos
@@ -968,7 +963,7 @@
def AddToLookupClass(self, name, parent, typeinfos):
lookup_name = self.etreeNamespaceFormat % name
- if isinstance(typeinfos, string_types):
+ if isinstance(typeinfos, str):
self.AddEquivalentClass(name, typeinfos)
typeinfos = self.etreeNamespaceFormat % typeinfos
lookup_classes = self.ComputedClassesLookUp.get(lookup_name)
@@ -986,7 +981,7 @@
self.ComputedClassesLookUp[lookup_name] = lookup_classes
def ExtractTypeInfos(self, name, parent, typeinfos):
- if isinstance(typeinfos, string_types):
+ if isinstance(typeinfos, str):
namespace, type_name = DecomposeQualifiedName(typeinfos)
infos = self.GetQualifiedNameInfos(type_name, namespace)
if name != "base":
@@ -997,13 +992,13 @@
if infos["type"] == COMPLEXTYPE:
type_name, parent = self.SplitQualifiedName(type_name, namespace)
result = self.CreateClass(type_name, parent, infos)
- if result is not None and not isinstance(result, string_types):
+ if result is not None and not isinstance(result, str):
self.Namespaces[self.TargetNamespace][result["name"]] = result
return result
elif infos["type"] == ELEMENT and infos["elmt_type"]["type"] == COMPLEXTYPE:
type_name, parent = self.SplitQualifiedName(type_name, namespace)
result = self.CreateClass(type_name, parent, infos["elmt_type"])
- if result is not None and not isinstance(result, string_types):
+ if result is not None and not isinstance(result, str):
self.Namespaces[self.TargetNamespace][result["name"]] = result
return result
else:
@@ -1025,19 +1020,19 @@
self.ParseSchema()
for name, infos in list(self.Namespaces[self.TargetNamespace].items()):
if infos["type"] == ELEMENT:
- if not isinstance(infos["elmt_type"], string_types) and \
+ if not isinstance(infos["elmt_type"], str) and \
infos["elmt_type"]["type"] == COMPLEXTYPE:
self.ComputeAfter.append((name, None, infos["elmt_type"], True))
while len(self.ComputeAfter) > 0:
result = self.CreateClass(*self.ComputeAfter.pop(0))
- if result is not None and not isinstance(result, string_types):
+ if result is not None and not isinstance(result, str):
self.Namespaces[self.TargetNamespace][result["name"]] = result
elif infos["type"] == COMPLEXTYPE:
self.ComputeAfter.append((name, None, infos))
while len(self.ComputeAfter) > 0:
result = self.CreateClass(*self.ComputeAfter.pop(0))
if result is not None and \
- not isinstance(result, string_types):
+ not isinstance(result, str):
self.Namespaces[self.TargetNamespace][result["name"]] = result
elif infos["type"] == ELEMENTSGROUP:
elements = []
@@ -1046,13 +1041,13 @@
elif "choices" in infos:
elements = infos["choices"]
for element in elements:
- if not isinstance(element["elmt_type"], string_types) and \
+ if not isinstance(element["elmt_type"], str) and \
element["elmt_type"]["type"] == COMPLEXTYPE:
self.ComputeAfter.append((element["name"], infos["name"], element["elmt_type"]))
while len(self.ComputeAfter) > 0:
result = self.CreateClass(*self.ComputeAfter.pop(0))
if result is not None and \
- not isinstance(result, string_types):
+ not isinstance(result, str):
self.Namespaces[self.TargetNamespace][result["name"]] = result
for name, parents in self.ComputedClassesLookUp.items():
@@ -1752,12 +1747,12 @@
def GetElementClass(self, element_tag, parent_tag=None, default=DefaultElementClass):
element_class = self.LookUpClasses.get(element_tag, (default, None))
if not isinstance(element_class, dict):
- if isinstance(element_class[0], string_types):
+ if isinstance(element_class[0], str):
return self.GetElementClass(element_class[0], default=default)
return element_class[0]
element_with_parent_class = element_class.get(parent_tag, default)
- if isinstance(element_with_parent_class, string_types):
+ if isinstance(element_with_parent_class, str):
return self.GetElementClass(element_with_parent_class, default=default)
return element_with_parent_class
@@ -1819,7 +1814,7 @@
"%s " % etree.QName(child.tag).localname
for child in element])
for possible_class in element_class:
- if isinstance(possible_class, string_types):
+ if isinstance(possible_class, str):
possible_class = self.GetElementClass(possible_class)
if possible_class.StructurePattern.match(children) is not None:
return possible_class
--- a/xmlclass/xsdschema.py Fri Oct 28 13:06:52 2022 +0800
+++ b/xmlclass/xsdschema.py Fri Oct 28 14:07:13 2022 +0800
@@ -23,16 +23,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
import os
import re
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 int
from xmlclass.xmlclass import *
@@ -170,7 +165,7 @@
if typeinfos["type"] in ["restriction", "extension"]:
# Search for base type definition
- if isinstance(typeinfos["base"], string_types):
+ if isinstance(typeinfos["base"], str):
basetypeinfos = factory.FindSchemaElement(typeinfos["base"], SIMPLETYPE)
if basetypeinfos is None:
raise "\"%s\" isn't defined!" % typeinfos["base"]
@@ -394,7 +389,7 @@
elif typeinfos["type"] == "list":
# Search for item type definition
- if isinstance(typeinfos["itemType"], string_types):
+ if isinstance(typeinfos["itemType"], str):
itemtypeinfos = factory.FindSchemaElement(typeinfos["itemType"], SIMPLETYPE)
if itemtypeinfos is None:
raise "\"%s\" isn't defined!" % typeinfos["itemType"]
@@ -440,7 +435,7 @@
# Search for member types definition
membertypesinfos = []
for membertype in typeinfos["memberTypes"]:
- if isinstance(membertype, string_types):
+ if isinstance(membertype, str):
infos = factory.FindSchemaElement(membertype, SIMPLETYPE)
if infos is None:
raise ValueError("\"%s\" isn't defined!" % membertype)
@@ -514,7 +509,7 @@
attrnames = {}
if base is not None:
basetypeinfos = factory.FindSchemaElement(base)
- if not isinstance(basetypeinfos, string_types) and basetypeinfos["type"] == COMPLEXTYPE:
+ if not isinstance(basetypeinfos, str) and basetypeinfos["type"] == COMPLEXTYPE:
attrnames = dict([(x["name"], True) for x in basetypeinfos["attributes"]])
for element in elements:
@@ -815,7 +810,7 @@
raise ValueError("Only group composed of \"choice\" can be referenced in \"choice\" element!")
choices_tmp = []
for choice in elmtgroup["choices"]:
- if not isinstance(choice["elmt_type"], string_types) and choice["elmt_type"]["type"] == COMPLEXTYPE:
+ if not isinstance(choice["elmt_type"], str) and choice["elmt_type"]["type"] == COMPLEXTYPE:
elmt_type = "%s_%s" % (elmtgroup["name"], choice["name"])
if factory.TargetNamespace is not None:
elmt_type = "%s:%s" % (factory.TargetNamespace, elmt_type)
@@ -849,7 +844,7 @@
raise ValueError("Only group composed of \"sequence\" can be referenced in \"sequence\" element!")
elements_tmp = []
for element in elmtgroup["elements"]:
- if not isinstance(element["elmt_type"], string_types) and element["elmt_type"]["type"] == COMPLEXTYPE:
+ if not isinstance(element["elmt_type"], str) and element["elmt_type"]["type"] == COMPLEXTYPE:
elmt_type = "%s_%s" % (elmtgroup["name"], element["name"])
if factory.TargetNamespace is not None:
elmt_type = "%s:%s" % (factory.TargetNamespace, elmt_type)
@@ -2215,7 +2210,7 @@
"facets": STRING_FACETS,
"generate": GenerateSimpleTypeXMLText(lambda x: x),
"initial": lambda: "",
- "check": lambda x: isinstance(x, string_types)},
+ "check": lambda x: isinstance(x, str)},
"normalizedString": {
"type": SIMPLETYPE,
@@ -2224,7 +2219,7 @@
"facets": STRING_FACETS,
"generate": GenerateSimpleTypeXMLText(lambda x: x),
"initial": lambda: "",
- "check": lambda x: isinstance(x, string_types)
+ "check": lambda x: isinstance(x, str)
},
"token": {
@@ -2234,7 +2229,7 @@
"facets": STRING_FACETS,
"generate": GenerateSimpleTypeXMLText(lambda x: x),
"initial": lambda: "",
- "check": lambda x: isinstance(x, string_types)
+ "check": lambda x: isinstance(x, str)
},
"base64Binary": {
@@ -2434,7 +2429,7 @@
"facets": NUMBER_FACETS,
"generate": GenerateSimpleTypeXMLText(str),
"initial": lambda: "",
- "check": lambda x: isinstance(x, string_types)
+ "check": lambda x: isinstance(x, str)
},
"dateTime": {
@@ -2474,7 +2469,7 @@
"facets": NUMBER_FACETS,
"generate": GenerateSimpleTypeXMLText(str),
"initial": lambda: "",
- "check": lambda x: isinstance(x, string_types)
+ "check": lambda x: isinstance(x, str)
},
"gYearMonth": {
@@ -2484,7 +2479,7 @@
"facets": NUMBER_FACETS,
"generate": GenerateSimpleTypeXMLText(str),
"initial": lambda: "",
- "check": lambda x: isinstance(x, string_types)
+ "check": lambda x: isinstance(x, str)
},
"gMonth": {
@@ -2494,7 +2489,7 @@
"facets": NUMBER_FACETS,
"generate": GenerateSimpleTypeXMLText(str),
"initial": lambda: "",
- "check": lambda x: isinstance(x, string_types)
+ "check": lambda x: isinstance(x, str)
},
"gMonthDay": {
@@ -2504,7 +2499,7 @@
"facets": NUMBER_FACETS,
"generate": GenerateSimpleTypeXMLText(str),
"initial": lambda: "",
- "check": lambda x: isinstance(x, string_types)
+ "check": lambda x: isinstance(x, str)
},
"gDay": {
@@ -2514,7 +2509,7 @@
"facets": NUMBER_FACETS,
"generate": GenerateSimpleTypeXMLText(str),
"initial": lambda: "",
- "check": lambda x: isinstance(x, string_types)
+ "check": lambda x: isinstance(x, str)
},
"Name": {
@@ -2524,7 +2519,7 @@
"facets": STRING_FACETS,
"generate": GenerateSimpleTypeXMLText(lambda x: x),
"initial": lambda: "",
- "check": lambda x: isinstance(x, string_types)
+ "check": lambda x: isinstance(x, str)
},
"QName": {
@@ -2534,7 +2529,7 @@
"facets": STRING_FACETS,
"generate": GenerateSimpleTypeXMLText(lambda x: x),
"initial": lambda: "",
- "check": lambda x: isinstance(x, string_types)
+ "check": lambda x: isinstance(x, str)
},
"NCName": {
@@ -2544,7 +2539,7 @@
"facets": STRING_FACETS,
"generate": GenerateSimpleTypeXMLText(lambda x: x),
"initial": lambda: "",
- "check": lambda x: isinstance(x, string_types)
+ "check": lambda x: isinstance(x, str)
},
"anyURI": {
@@ -2554,7 +2549,7 @@
"facets": STRING_FACETS,
"generate": GenerateSimpleTypeXMLText(lambda x: x),
"initial": lambda: "",
- "check": lambda x: isinstance(x, string_types)
+ "check": lambda x: isinstance(x, str)
},
"language": {
@@ -2564,7 +2559,7 @@
"facets": STRING_FACETS,
"generate": GenerateSimpleTypeXMLText(lambda x: x),
"initial": lambda: "en",
- "check": lambda x: isinstance(x, string_types)
+ "check": lambda x: isinstance(x, str)
},
"ID": {
@@ -2574,7 +2569,7 @@
"facets": STRING_FACETS,
"generate": GenerateSimpleTypeXMLText(lambda x: x),
"initial": lambda: "",
- "check": lambda x: isinstance(x, string_types)
+ "check": lambda x: isinstance(x, str)
},
"IDREF": {
@@ -2584,7 +2579,7 @@
"facets": STRING_FACETS,
"generate": GenerateSimpleTypeXMLText(lambda x: x),
"initial": lambda: "",
- "check": lambda x: isinstance(x, string_types)
+ "check": lambda x: isinstance(x, str)
},
"IDREFS": {
@@ -2594,7 +2589,7 @@
"facets": STRING_FACETS,
"generate": GenerateSimpleTypeXMLText(lambda x: x),
"initial": lambda: "",
- "check": lambda x: isinstance(x, string_types)
+ "check": lambda x: isinstance(x, str)
},
"ENTITY": {
@@ -2604,7 +2599,7 @@
"facets": STRING_FACETS,
"generate": GenerateSimpleTypeXMLText(lambda x: x),
"initial": lambda: "",
- "check": lambda x: isinstance(x, string_types)
+ "check": lambda x: isinstance(x, str)
},
"ENTITIES": {
@@ -2614,7 +2609,7 @@
"facets": STRING_FACETS,
"generate": GenerateSimpleTypeXMLText(lambda x: x),
"initial": lambda: "",
- "check": lambda x: isinstance(x, string_types)
+ "check": lambda x: isinstance(x, str)
},
"NOTATION": {
@@ -2624,7 +2619,7 @@
"facets": STRING_FACETS,
"generate": GenerateSimpleTypeXMLText(lambda x: x),
"initial": lambda: "",
- "check": lambda x: isinstance(x, string_types)
+ "check": lambda x: isinstance(x, str)
},
"NMTOKEN": {
@@ -2634,7 +2629,7 @@
"facets": STRING_FACETS,
"generate": GenerateSimpleTypeXMLText(lambda x: x),
"initial": lambda: "",
- "check": lambda x: isinstance(x, string_types)
+ "check": lambda x: isinstance(x, str)
},
"NMTOKENS": {
@@ -2644,7 +2639,7 @@
"facets": STRING_FACETS,
"generate": GenerateSimpleTypeXMLText(lambda x: x),
"initial": lambda: "",
- "check": lambda x: isinstance(x, string_types)
+ "check": lambda x: isinstance(x, str)
},
# Complex Types