fix (old-style-class) Old-style class defined error for most parts of
the code
only PyJS code is left, because it does some fancy tricks and can't be
easily fixed. So far PyJS doesn't support Python3 anyway.
--- a/Beremiz.py Fri Sep 22 20:12:22 2017 +0300
+++ b/Beremiz.py Thu Sep 28 12:20:40 2017 +0300
@@ -31,7 +31,7 @@
import util.paths as paths
-class BeremizIDELauncher:
+class BeremizIDELauncher(object): --- a/BeremizIDE.py Fri Sep 22 20:12:22 2017 +0300
+++ b/BeremizIDE.py Thu Sep 28 12:20:40 2017 +0300
@@ -115,7 +115,7 @@
+class LogPseudoFile(object): """ Base class for file like objects to facilitate StdOut for the Shell."""
def __init__(self, output, risecall):
--- a/Beremiz_service.py Fri Sep 22 20:12:22 2017 +0300
+++ b/Beremiz_service.py Thu Sep 28 12:20:40 2017 +0300
@@ -393,7 +393,7 @@
def __init__(self, servicename, ip_addr, port,
workdir, argv, autostart=False,
statuschange=None, evaluator=default_evaluator,
--- a/CodeFileTreeNode.py Fri Sep 22 20:12:22 2017 +0300
+++ b/CodeFileTreeNode.py Thu Sep 28 12:20:40 2017 +0300
@@ -83,7 +83,7 @@
SECTION_TAG_ELEMENT = "<xsd:element name=\"%s\" type=\"CodeText\"/>"
CODEFILE_NAME = "CodeFile"
--- a/ConfigTreeNode.py Fri Sep 22 20:12:22 2017 +0300
+++ b/ConfigTreeNode.py Thu Sep 28 12:20:40 2017 +0300
@@ -58,7 +58,7 @@
XSDSchemaErrorMessage = _("{a1} XML file doesn't follow XSD schema at line {a2}:\n{a3}")
+class ConfigTreeNode(object): This class is the one that define confnodes.
--- a/PLCControler.py Fri Sep 22 20:12:22 2017 +0300
+++ b/PLCControler.py Thu Sep 28 12:20:40 2017 +0300
@@ -169,7 +169,7 @@
return _VariableInfos(*[getattr(self, attr) for attr in self.__slots__])
-class VariablesInfosFactory:
+class VariablesInfosFactory(object): def __init__(self, variables):
self.Variables = variables
@@ -242,7 +242,7 @@
return _VariableTreeItem(*[getattr(self, attr) for attr in self.__slots__])
-class VariablesTreeInfosFactory:
+class VariablesTreeInfosFactory(object): @@ -264,7 +264,7 @@
[_BoolValue] * 2, args) + [[]])))
-class InstancesPathFactory:
+class InstancesPathFactory(object): """Helpers object for generating instances path list"""
def __init__(self, instances):
self.Instances = instances
@@ -273,7 +273,7 @@
self.Instances.append(args[0][0])
+class InstanceTagName(object): """Helpers object for generating instance tagname"""
def __init__(self, controller):
@@ -387,7 +387,7 @@
return _ActionInfos(*[getattr(self, attr) for attr in self.__slots__])
-class BlockInstanceFactory:
+class BlockInstanceFactory(object): def __init__(self, block_instances):
self.BlockInstances = block_instances
@@ -461,7 +461,7 @@
+class UndoBuffer(object): Undo Buffer for PLCOpenEditor
Class implementing a buffer of changes made on the current editing model
@@ -544,7 +544,7 @@
return self.LastSave == self.CurrentIndex
+class PLCControler(object): Controler for PLCOpenEditor
Class which controls the operations made on the plcopen model and answers to view requests
--- a/PLCGenerator.py Fri Sep 22 20:12:22 2017 +0300
+++ b/PLCGenerator.py Thu Sep 28 12:20:40 2017 +0300
@@ -99,7 +99,7 @@
# -------------------------------------------------------------------------------
+class ProgramGenerator(object): # Create a new PCL program generator
def __init__(self, controler, project, errors, warnings):
@@ -505,7 +505,7 @@
ActionObjClass = PLCOpenParser.GetElementClass("action", "actions")
-class PouProgramGenerator:
+class PouProgramGenerator(object): # Create a new POU program generator
def __init__(self, parent, name, type, errors, warnings):
--- a/POULibrary.py Fri Sep 22 20:12:22 2017 +0300
+++ b/POULibrary.py Thu Sep 28 12:20:40 2017 +0300
@@ -25,7 +25,7 @@
+class POULibrary(object): def __init__(self, CTR, LibName, TypeStack):
from PLCControler import PLCControler
--- a/ProjectController.py Fri Sep 22 20:12:22 2017 +0300
+++ b/ProjectController.py Thu Sep 28 12:20:40 2017 +0300
@@ -93,7 +93,7 @@
return ExtractMenuItemsFromCatalog(features.catalog)
+class Iec2CSettings(object): self.iec2c_buildopts = None
--- a/canfestival/canfestival.py Fri Sep 22 20:12:22 2017 +0300
+++ b/canfestival/canfestival.py Thu Sep 28 12:20:40 2017 +0300
@@ -483,7 +483,7 @@
return self.Manager.GetCurrentBufferState()
+class RootClass(object): XSD = """<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="CanFestivalInstance">
--- a/canfestival/config_utils.py Fri Sep 22 20:12:22 2017 +0300
+++ b/canfestival/config_utils.py Thu Sep 28 12:20:40 2017 +0300
@@ -156,7 +156,7 @@
return "".join(dcfdata), len(dcfdata)
-class ConciseDCFGenerator:
+class ConciseDCFGenerator(object): def __init__(self, nodelist, nodename):
# Dictionary of location informations classed by name
--- a/controls/DebugVariablePanel/DebugVariableViewer.py Fri Sep 22 20:12:22 2017 +0300
+++ b/controls/DebugVariablePanel/DebugVariableViewer.py Thu Sep 28 12:20:40 2017 +0300
@@ -49,7 +49,7 @@
# -------------------------------------------------------------------------------
-class DebugVariableViewer:
+class DebugVariableViewer(object): Class that implements a generic viewer that display a list of variable values
This class has to be inherited to effectively display variable values
--- a/controls/DebugVariablePanel/GraphButton.py Fri Sep 22 20:12:22 2017 +0300
+++ b/controls/DebugVariablePanel/GraphButton.py Thu Sep 28 12:20:40 2017 +0300
@@ -31,7 +31,7 @@
# -------------------------------------------------------------------------------
+class GraphButton(object): Class that implements a custom button for graphic Viewer
--- a/controls/LogViewer.py Fri Sep 22 20:12:22 2017 +0300
+++ b/controls/LogViewer.py Thu Sep 28 12:20:40 2017 +0300
@@ -183,7 +183,7 @@
+class LogButton(object): def __init__(self, label, callback):
self.Position = wx.Point(0, 0)
@@ -229,7 +229,7 @@
+class LogMessage(object): def __init__(self, tv_sec, tv_nsec, level, level_bitmap, msg):
self.Date = datetime.utcfromtimestamp(tv_sec)
--- a/editors/DebugViewer.py Fri Sep 22 20:12:22 2017 +0300
+++ b/editors/DebugViewer.py Thu Sep 28 12:20:40 2017 +0300
@@ -35,7 +35,7 @@
# -------------------------------------------------------------------------------
+class DebugViewer(object): Class that implements common behavior of every viewers able to display debug
--- a/graphics/DebugDataConsumer.py Fri Sep 22 20:12:22 2017 +0300
+++ b/graphics/DebugDataConsumer.py Thu Sep 28 12:20:40 2017 +0300
@@ -156,7 +156,7 @@
# -------------------------------------------------------------------------------
-class DebugDataConsumer:
+class DebugDataConsumer(object): Class that implements an element that consumes debug values
Value update can be inhibited during the time the associated Debug Viewer is
--- a/graphics/RubberBand.py Fri Sep 22 20:12:22 2017 +0300
+++ b/graphics/RubberBand.py Thu Sep 28 12:20:40 2017 +0300
@@ -32,7 +32,7 @@
# -------------------------------------------------------------------------------
+class RubberBand(object): Class that implements a rubberband for graphic Viewers
--- a/graphics/ToolTipProducer.py Fri Sep 22 20:12:22 2017 +0300
+++ b/graphics/ToolTipProducer.py Thu Sep 28 12:20:40 2017 +0300
@@ -32,7 +32,7 @@
# -------------------------------------------------------------------------------
+class ToolTipProducer(object): Class that implements an element that generate Tool Tip
--- a/plcopen/plcopen.py Fri Sep 22 20:12:22 2017 +0300
+++ b/plcopen/plcopen.py Thu Sep 28 12:20:40 2017 +0300
@@ -84,7 +84,7 @@
Helper class for bounding_box calculation
--- a/runtime/NevowServer.py Fri Sep 22 20:12:22 2017 +0300
+++ b/runtime/NevowServer.py Thu Sep 28 12:20:40 2017 +0300
@@ -191,7 +191,7 @@
+class statuslistener(object): def __init__(self, site):
--- a/runtime/PLCObject.py Fri Sep 22 20:12:22 2017 +0300
+++ b/runtime/PLCObject.py Thu Sep 28 12:20:40 2017 +0300
@@ -277,7 +277,7 @@
self.python_runtime_vars = globals().copy()
self.python_runtime_vars.update(self.pyruntimevars)
+ class PLCSafeGlobals(object): def __getattr__(_self, name):
t = self.python_runtime_vars["_"+name+"_ctype"]
--- a/runtime/ServicePublisher.py Fri Sep 22 20:12:22 2017 +0300
+++ b/runtime/ServicePublisher.py Thu Sep 28 12:20:40 2017 +0300
@@ -30,7 +30,7 @@
service_type = '_PYRO._tcp.local.'
-class ServicePublisher():
+class ServicePublisher(object): # type: fully qualified service type name
self.serviceproperties = {'description': 'Beremiz remote PLC'}
--- a/svgui/svgui_server.py Fri Sep 22 20:12:22 2017 +0300
+++ b/svgui/svgui_server.py Thu Sep 28 12:20:40 2017 +0300
@@ -40,7 +40,7 @@
+class SvguiWidget(object): def __init__(self, classname, id, **kwargs):
self.classname = classname
--- a/targets/toolchain_gcc.py Fri Sep 22 20:12:22 2017 +0300
+++ b/targets/toolchain_gcc.py Thu Sep 28 12:20:40 2017 +0300
@@ -32,7 +32,7 @@
includes_re = re.compile('\s*#include\s*["<]([^">]*)[">].*')
+class toolchain_gcc(object): This abstract class contains GCC specific code.
It cannot be used as this and should be inherited in a target specific
--- a/targets/toolchain_makefile.py Fri Sep 22 20:12:22 2017 +0300
+++ b/targets/toolchain_makefile.py Thu Sep 28 12:20:40 2017 +0300
@@ -33,7 +33,7 @@
includes_re = re.compile('\s*#include\s*["<]([^">]*)[">].*')
-class toolchain_makefile():
+class toolchain_makefile(object): def __init__(self, CTRInstance):
self.CTRInstance = CTRInstance
--- a/tests/tools/check_source.sh Fri Sep 22 20:12:22 2017 +0300
+++ b/tests/tools/check_source.sh Thu Sep 28 12:20:40 2017 +0300
@@ -201,11 +201,14 @@
disable=$disable,W0511 # fixme
- enable=$enable,E1601 # print statement used
- enable=$enable,C0325 # (superfluous-parens) Unnecessary parens after keyword
+ enable=$enable,E1601 # print statement used + enable=$enable,C0325 # (superfluous-parens) Unnecessary parens after keyword enable=$enable,W0404 # reimported module
+ # enable=$enable,C1001 # (old-style-class) Old-style class defined. Problem with PyJS # enable=$enable,W0403 # relative import
+ # enable=$enable,W0622 # (redefined-builtin) Redefining built-in + # enable=$enable,W0612 # unused-variable --- a/util/MiniTextControler.py Fri Sep 22 20:12:22 2017 +0300
+++ b/util/MiniTextControler.py Thu Sep 28 12:20:40 2017 +0300
@@ -29,7 +29,7 @@
-class MiniTextControler:
+class MiniTextControler(object): def __init__(self, filepath, controller):
--- a/util/ProcessLogger.py Fri Sep 22 20:12:22 2017 +0300
+++ b/util/ProcessLogger.py Thu Sep 28 12:20:40 2017 +0300
@@ -72,7 +72,7 @@
self.endcallback(self.Proc.pid, err)
+class ProcessLogger(object): def __init__(self, logger, Command, finish_callback=None,
no_stdout=False, no_stderr=False, no_gui=True,
timeout=None, outlimit=None, errlimit=None,
--- a/xmlclass/xmlclass.py Fri Sep 22 20:12:22 2017 +0300
+++ b/xmlclass/xmlclass.py Thu Sep 28 12:20:40 2017 +0300
@@ -752,7 +752,7 @@
+class ClassFactory(object): Class that generate class from an XML Tree