def connect(self, api_key): self._api_key = api_key self.cache = Cache(api_key) self.warnings = WarningLogger() self.con = self.warnings.proxy(BaseConnection(self._api_key, self._secure)) if self._check and not self.ping(): raise MCConnectionFailed() self.is_connected = True
def connect(self, api_key): self._api_key = api_key self.cache = Cache(api_key) self.warnings = WarningLogger() self.con = self.warnings.proxy( BaseConnection(self._api_key, self._secure)) if self._check: status = self.ping() if status != STATUS_OK: raise MCConnectionFailed(status) self.is_connected = True