--- a/Beremiz_service.py Wed Mar 13 10:19:30 2019 +0300
+++ b/Beremiz_service.py Wed Mar 13 11:47:03 2019 +0300
@@ -31,7 +31,6 @@
import getopt
import threading
from threading import Thread, Semaphore, Lock, currentThread
-import __builtin__
from builtins import str as text
from past.builtins import execfile
from six.moves import builtins
--- a/connectors/PYRO/PSK_Adapter.py Wed Mar 13 10:19:30 2019 +0300
+++ b/connectors/PYRO/PSK_Adapter.py Wed Mar 13 11:47:03 2019 +0300
@@ -3,8 +3,8 @@
import socket
import re
+import ssl
import sslpsk
-import ssl
import Pyro
from Pyro.core import PyroURI
from Pyro.protocol import _connect_socket, TCPConnection, PYROAdapter
--- a/connectors/PYRO/__init__.py Wed Mar 13 10:19:30 2019 +0300
+++ b/connectors/PYRO/__init__.py Wed Mar 13 11:47:03 2019 +0300
@@ -54,7 +54,7 @@
scheme, location = uri.split("://")
if scheme == "PYROS":
- import connectors.PYRO.PSK_Adapter # pylint: disable=wrong-import-order,unused-import,wrong-import-position
+ import connectors.PYRO.PSK_Adapter # pylint: disable=wrong-import-order,unused-import,wrong-import-position
schemename = "PYROLOCPSK"
url, ID = location.split('#') # TODO fix exception when # not found
# load PSK from project
--- a/connectors/PYRO_dialog.py Wed Mar 13 10:19:30 2019 +0300
+++ b/connectors/PYRO_dialog.py Wed Mar 13 11:47:03 2019 +0300
@@ -6,7 +6,6 @@
from __future__ import absolute_import
from itertools import repeat, islice, chain
-import wx
from connectors.SchemeEditor import SchemeEditor
--- a/connectors/SchemeEditor.py Wed Mar 13 10:19:30 2019 +0300
+++ b/connectors/SchemeEditor.py Wed Mar 13 11:47:03 2019 +0300
@@ -26,7 +26,7 @@
self.txtctrls[tag] = txtctrl
for win, flag in [
(wx.StaticText(self, label=label),
- wx.ALIGN_CENTER_VERTICAL),
+ wx.ALIGN_CENTER_VERTICAL),
(txtctrl, wx.GROW)]:
self.fieldsizer.AddWindow(win, flag=flag)
@@ -39,7 +39,7 @@
self, parent.ctr,
# use a callafter, as editor can be deleted by calling SetURI
partial(wx.CallAfter, parent.SetURI),
- self.txtctrls[tag].SetValue)
+ self.txtctrls["ID"].SetValue)
self.mainsizer.AddWindow(self.idselector)
self.SetSizer(self.mainsizer)
else:
--- a/connectors/__init__.py Wed Mar 13 10:19:30 2019 +0300
+++ b/connectors/__init__.py Wed Mar 13 11:47:03 2019 +0300
@@ -29,7 +29,6 @@
from __future__ import absolute_import
from os import listdir, path
from connectors.ConnectorBase import ConnectorBase
-from types import ClassType
connectors_packages = ["PYRO", "WAMP"]
@@ -118,8 +117,8 @@
return None
# new class inheriting from generic and specific connector base classes
- return ClassType(_scheme + "_connector",
- (ConnectorBase, connector_specific_class), {})()
+ return type(_scheme + "_connector",
+ (ConnectorBase, connector_specific_class), {})()
def EditorClassFromScheme(scheme):
--- a/controls/IDBrowser.py Wed Mar 13 10:19:30 2019 +0300
+++ b/controls/IDBrowser.py Wed Mar 13 11:47:03 2019 +0300
@@ -98,8 +98,8 @@
args(_("Last URI"), COL_URI, width=300 if big else 80),
args(_("Description"), COL_DESC, width=300 if big else 200,
mode=dv.DATAVIEW_CELL_EDITABLE
- if self.isManager
- else dv.DATAVIEW_CELL_INERT),
+ if self.isManager
+ else dv.DATAVIEW_CELL_INERT),
args(_("Last connection"), COL_LAST, width=120),
]
--- a/runtime/PLCObject.py Wed Mar 13 10:19:30 2019 +0300
+++ b/runtime/PLCObject.py Wed Mar 13 11:47:03 2019 +0300
@@ -28,14 +28,14 @@
import os
import sys
import traceback
+import shutil
from time import time
-import _ctypes # pylint: disable=wrong-import-order
+import md5
+from tempfile import mkstemp
+from functools import wraps, partial
from six.moves import xrange
from past.builtins import execfile
-import md5
-from tempfile import mkstemp
-import shutil
-from functools import wraps, partial
+import _ctypes
from runtime.typemapping import TypeTranslator
from runtime.loglevels import LogLevelsDefault, LogLevelsCount
--- a/runtime/WampClient.py Wed Mar 13 10:19:30 2019 +0300
+++ b/runtime/WampClient.py Wed Mar 13 11:47:03 2019 +0300
@@ -135,7 +135,7 @@
self.register(GetCallee(name), u'.'.join((ID, name)), registerOptions)
for name in SubscribedEvents:
- self.subscribe(GetCallee(name), unicode(name))
+ self.subscribe(GetCallee(name), text(name))
for func in DoOnJoin:
func(self)
@@ -151,7 +151,7 @@
def publishWithOwnID(self, eventID, value):
ID = self.config.extra["ID"]
- self.publish(unicode(ID+'.'+eventID), value)
+ self.publish(text(ID+'.'+eventID), value)
class ReconnectingWampWebSocketClientFactory(WampWebSocketClientFactory, ReconnectingClientFactory):
@@ -343,12 +343,12 @@
def PublishEvent(eventID, value):
if getWampStatus() == "Attached":
- _WampSession.publish(unicode(eventID), value)
+ _WampSession.publish(text(eventID), value)
def PublishEventWithOwnID(eventID, value):
if getWampStatus() == "Attached":
- _WampSession.publishWithOwnID(unicode(eventID), value)
+ _WampSession.publishWithOwnID(text(eventID), value)
# WEB CONFIGURATION INTERFACE
--- a/runtime/Worker.py Wed Mar 13 10:19:30 2019 +0300
+++ b/runtime/Worker.py Wed Mar 13 11:47:03 2019 +0300
@@ -9,9 +9,9 @@
from __future__ import absolute_import
import sys
-import thread
from threading import Lock, Condition
import six
+from six.moves import _thread
class job(object):
@@ -65,7 +65,7 @@
"""
meant to be called by worker thread (blocking)
"""
- self._threadID = thread.get_ident()
+ self._threadID = _thread.get_ident()
self.mutex.acquire()
if args or kwargs:
_job = job(*args, **kwargs)
@@ -93,7 +93,7 @@
_job = job(*args, **kwargs)
- if self._threadID == thread.get_ident():
+ if self._threadID == _thread.get_ident():
# if caller is worker thread execute immediately
_job.do()
else:
--- a/runtime/spawn_subprocess.py Wed Mar 13 10:19:30 2019 +0300
+++ b/runtime/spawn_subprocess.py Wed Mar 13 11:47:03 2019 +0300
@@ -3,6 +3,7 @@
# subset of subprocess built-in module using posix_spawn rather than fork.
+from __future__ import print_function
from __future__ import absolute_import
import os
import signal