def connectToSpec(self, specVersion, timeout): SpecCommandA.connectToSpec(self, specVersion, timeout) if not self.connection.isSpecConnected(): with gevent.Timeout(timeout, SpecClientTimeoutError): SpecWaitObject.waitConnection(self.connection, timeout) self._connected()
def connectToSpec(self, specVersion, timeout): SpecCommandA.connectToSpec(self, specVersion, timeout) if not self.connection.isSpecConnected(): with gevent.Timeout(timeout, SpecClientTimeoutError): SpecWaitObject.waitConnection(self.connection, timeout) self._connected()
def connectToSpec(self, specVersion, timeout=200): if self.connection is not None: SpecEventsDispatcher.disconnect(self.connection, 'connected', self.connected) SpecEventsDispatcher.disconnect(self.connection, 'disconnected', self.disconnected) self.connection = SpecConnectionsManager.SpecConnectionsManager().getConnection(specVersion) self.specVersion = specVersion SpecEventsDispatcher.connect(self.connection, 'connected', self.connected) cb = self.__callbacks.get("connected") if cb is not None: cb = cb() SpecEventsDispatcher.connect(self.connection, 'connected', cb) SpecEventsDispatcher.connect(self.connection, 'disconnected', self.disconnected) cb = self.__callbacks.get("disconnected") if cb is not None: cb = cb() SpecEventsDispatcher.connect(self.connection, 'disconnected', cb) self.connection.registerChannel("status/ready", self.statusChanged) cb = self.__callbacks.get("statusChanged") if cb is not None: cb = cb() SpecEventsDispatcher.connect(self.connection, 'statusChanged', cb) if self.connection.isSpecConnected(): self.connected() else: try: SpecWaitObject.waitConnection(self.connection, timeout) except SpecClientTimeoutError: pass SpecEventsDispatcher.dispatch()
def connectToSpec(self, specVersion, timeout=200): if self.connection is not None: SpecEventsDispatcher.disconnect(self.connection, 'connected', self._connected) SpecEventsDispatcher.disconnect(self.connection, 'disconnected', self._disconnected) self.connection = SpecConnectionsManager.SpecConnectionsManager( ).getConnection(specVersion) self.specVersion = specVersion SpecEventsDispatcher.connect(self.connection, 'connected', self._connected) SpecEventsDispatcher.connect(self.connection, 'disconnected', self._disconnected) if self.connection.isSpecConnected(): self._connected() else: try: SpecWaitObject.waitConnection(self.connection, timeout) except SpecClientTimeoutError: pass SpecEventsDispatcher.dispatch()
def connectToSpec(self, specVersion): self.connection = SpecConnectionsManager.SpecConnectionsManager().getConnection(specVersion) self.specVersion = specVersion SpecWaitObject.waitConnection(self.connection, self.__timeout)
def connectToSpec(self, specVersion): self.connection = SpecConnectionsManager.SpecConnectionsManager( ).getConnection(specVersion) self.specVersion = specVersion SpecWaitObject.waitConnection(self.connection, self.__timeout)