101 @inlineCallbacks |
101 @inlineCallbacks |
102 def onJoin(self, details): |
102 def onJoin(self, details): |
103 global _WampSession |
103 global _WampSession |
104 _WampSession = self |
104 _WampSession = self |
105 ID = self.config.extra["ID"] |
105 ID = self.config.extra["ID"] |
|
106 validRegisterOptions = {} |
106 |
107 |
107 registerOptions = self.config.extra.get('registerOptions', None) |
108 registerOptions = self.config.extra.get('registerOptions', None) |
108 arguments = inspect.getargspec(types.RegisterOptions.__init__).args |
109 if registerOptions: |
109 validRegisterOptions = getValidOptins(registerOptions, arguments) |
110 arguments = inspect.getargspec(types.RegisterOptions.__init__).args |
110 if validRegisterOptions: |
111 validRegisterOptions = getValidOptins(registerOptions, arguments) |
111 registerOptions = types.RegisterOptions(**validRegisterOptions) |
112 if validRegisterOptions: |
112 #print(_("Added custom register options")) |
113 registerOptions = types.RegisterOptions(**validRegisterOptions) |
|
114 #print(_("Added custom register options")) |
113 |
115 |
114 for name in ExposedCalls: |
116 for name in ExposedCalls: |
115 yield self.register(GetCallee(name), u'.'.join((ID, name)), registerOptions) |
117 yield self.register(GetCallee(name), u'.'.join((ID, name)), registerOptions) |
116 |
118 |
117 if ExposedProgressCalls: |
119 if ExposedProgressCalls: |
138 class ReconnectingWampWebSocketClientFactory(WampWebSocketClientFactory, ReconnectingClientFactory): |
140 class ReconnectingWampWebSocketClientFactory(WampWebSocketClientFactory, ReconnectingClientFactory): |
139 def __init__(self, config, *args, **kwargs): |
141 def __init__(self, config, *args, **kwargs): |
140 WampWebSocketClientFactory.__init__(self, *args, **kwargs) |
142 WampWebSocketClientFactory.__init__(self, *args, **kwargs) |
141 |
143 |
142 protocolOptions = config.extra.get('protocolOptions', None) |
144 protocolOptions = config.extra.get('protocolOptions', None) |
143 arguments = inspect.getargspec(self.setProtocolOptions).args |
145 if protocolOptions: |
144 validProtocolOptions = getValidOptins(protocolOptions, arguments) |
146 arguments = inspect.getargspec(self.setProtocolOptions).args |
145 if validProtocolOptions: |
147 validProtocolOptions = getValidOptins(protocolOptions, arguments) |
146 self.setProtocolOptions(**validProtocolOptions) |
148 if validProtocolOptions: |
147 #print(_("Added custom protocol options")) |
149 self.setProtocolOptions(**validProtocolOptions) |
|
150 #print(_("Added custom protocol options")) |
148 |
151 |
149 def buildProtocol(self, addr): |
152 def buildProtocol(self, addr): |
150 self.resetDelay() |
153 self.resetDelay() |
151 return ReconnectingClientFactory.buildProtocol(self, addr) |
154 return ReconnectingClientFactory.buildProtocol(self, addr) |
152 |
155 |