--- a/Beremiz_service.py Thu Jan 11 15:39:58 2018 +0100
+++ b/Beremiz_service.py Thu Jan 11 15:41:20 2018 +0100
@@ -418,8 +418,8 @@
self.daemon = pyro.Daemon(host=self.ip_addr, port=self.port)
- # pyro never frees memory after connection close if no timeout set
- self.daemon.setTimeout(1);
+ # pyro never frees memory after connection close if no timeout set + self.daemon.setTimeout(1) self.daemon.requestLoop()
@@ -467,7 +467,6 @@
if self.plcobj is not None:
@@ -578,7 +577,7 @@
_wampconf = os.path.join(WorkingDir, "wampconf.json")
- if os.path.exists(_wampconf) :
+ if os.path.exists(_wampconf): @@ -605,9 +604,9 @@
- _wampconf = WC.LoadWampClientConf(wampconf) # if project WAMP config is added
- if _wampconf["url"]: #TODO : test more ?
+ _wampconf = WC.LoadWampClientConf(wampconf) + if _wampconf["url"]: # TODO : test more ? WC.RegisterWampClient(wampconf, wampsecret)
pyruntimevars["wampsession"] = WC.GetSession
--- a/py_ext/PythonFileCTNMixin.py Thu Jan 11 15:39:58 2018 +0100
+++ b/py_ext/PythonFileCTNMixin.py Thu Jan 11 15:41:20 2018 +0100
@@ -119,7 +119,7 @@
"configname": configname.upper(),
"uppername": variable.getname().upper(),
"IECtype": variable.gettype(),
- "initial" : repr(variable.getinitial()),
+ "initial": repr(variable.getinitial()), self.CodeFile.variables.variable)
--- a/runtime/WampClient.py Thu Jan 11 15:39:58 2018 +0100
+++ b/runtime/WampClient.py Thu Jan 11 15:41:20 2018 +0100
@@ -24,15 +24,12 @@
from __future__ import absolute_import
from __future__ import print_function
from autobahn.twisted import wamp
from autobahn.twisted.websocket import WampWebSocketClientFactory, connectWS
from autobahn.wamp import types, auth
from autobahn.wamp.serializer import MsgPackSerializer
-from autobahn.wamp.exception import ApplicationError
from twisted.internet.defer import inlineCallbacks
from twisted.internet.protocol import ReconnectingClientFactory
@@ -55,12 +52,12 @@
# Those two lists are meant to be filled by customized runtime
-""" crossbar Events to register to """
+""" crossbar Events to register to """ -""" things to do on join (callables) """
+""" things to do on join (callables) """ @@ -75,7 +72,7 @@
class WampSession(wamp.ApplicationSession):
- if self.config.extra.has_key("secret"):
+ if "secret" in self.config.extra: user = self.config.extra["ID"].encode('utf8')
self.join(u"Automation", [u"wampcra"], user)
@@ -93,10 +90,10 @@
def onJoin(self, details):
- ID = self.config.extra["ID"] # this is unicode
+ ID = self.config.extra["ID"] print('WAMP session joined by :', ID)
for name in ExposedCalls:
- regoption = types.RegisterOptions(u'exact',u'last',None, None)
+ regoption = types.RegisterOptions(u'exact', u'last', None, None) yield self.register(GetCallee(name), u'.'.join((ID, name)), regoption)
for name in SubscribedEvents:
@@ -113,11 +110,11 @@
class ReconnectingWampWebSocketClientFactory(WampWebSocketClientFactory, ReconnectingClientFactory):
def clientConnectionFailed(self, connector, reason):
- print _("WAMP Client connection failed (%s) .. retrying .." %time.ctime())
+ print(_("WAMP Client connection failed (%s) .. retrying .." % time.ctime())) ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
def clientConnectionLost(self, connector, reason):
- print _("WAMP Client connection lost (%s) .. retrying .." %time.ctime())
+ print(_("WAMP Client connection lost (%s) .. retrying .." % time.ctime())) ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
@@ -131,6 +128,7 @@
def LoadWampSecret(secretfname):
WSClientWampSecret = open(secretfname, 'rb').read()
@@ -158,7 +156,7 @@
# create a WAMP application session factory
component_config = types.ComponentConfig(
realm=WSClientConf["realm"],
- extra=WSClientConf) # pass a dict containing unicode values
session_factory = wamp.ApplicationSessionFactory(
session_factory.session = WampSession