# HG changeset patch # User Edouard Tisserant # Date 1515671329 -3600 # Node ID d2dbdeffc4266714b55cb010a4484071bb61b8cb # Parent 62f9cae9a25f78505aacdfc474efede4e0779c15 runtime/Wamp : adapt to unicode being enforced in latest crossbar API. Updated some documentation, to explain why there is unused definitions like SubscribedEvents or DoOnJoin. diff -r 62f9cae9a25f -r d2dbdeffc426 runtime/WampClient.py --- a/runtime/WampClient.py Wed Jan 10 15:36:03 2018 +0100 +++ b/runtime/WampClient.py Thu Jan 11 12:48:49 2018 +0100 @@ -54,8 +54,13 @@ "ResetLogCount", ] +# Those two lists are meant to be filled by customized runtime +# or User python code. + +""" crossbar Events to register to """ SubscribedEvents = [] +""" things to do on join (callables) """ DoOnJoin = [] @@ -88,14 +93,14 @@ def onJoin(self, details): global _WampSession _WampSession = self - ID = self.config.extra["ID"] + ID = self.config.extra["ID"] # this is unicode print('WAMP session joined by :', ID) for name in ExposedCalls: regoption = types.RegisterOptions(u'exact',u'last',None, None) - yield self.register(GetCallee(name), '.'.join((ID, name)), regoption) + yield self.register(GetCallee(name), u'.'.join((ID, name)), regoption) for name in SubscribedEvents: - yield self.subscribe(GetCallee(name), name) + yield self.subscribe(GetCallee(name), unicode(name)) for func in DoOnJoin: yield func(self) @@ -150,7 +155,7 @@ # create a WAMP application session factory component_config = types.ComponentConfig( realm=WSClientConf["realm"], - extra=WSClientConf) + extra=WSClientConf) # pass a dict containing unicode values session_factory = wamp.ApplicationSessionFactory( config=component_config) session_factory.session = WampSession