def cat(self, resource, params={}, **kwargs): kwargs.update(params) params = _cryptParams(kwargs) response = self.session.post(self.abs_path(resource), params, params={"cyt": 1}) data = crypt.decode(response.content) data = re.sub("&(?!amp;)", "&", data) return data
def cat(self, resource, params={}, **kwargs): kwargs.update(params) if resource in ("~/login", "~/regist"): params = _cryptParams(kwargs, type="RSA") else: params = _cryptParams(kwargs) response = self.session.post(self.abs_path(resource), params, params={"cyt": 1},timeout=30) if response.status_code != 200: time.sleep(1) return self.cat(resource, params, **kwargs) if resource == "~/check_inspection": data = crypt.aes_decode(response.content, key="rBwj1MIAivVN222b") else: data = crypt.aes_decode(response.content) data = re.sub("&(?!amp;)", "&", data) if config.DEBUG and config.PRINT: print data return data
def cat(self, resource, params={}, **kwargs): kwargs.update(params) if resource in ("~/login", "~/regist"): params = _cryptParams(kwargs, type="RSA") else: params = _cryptParams(kwargs) response = self.session.post(self.abs_path(resource), params, params={"cyt": 1}) if response.status_code != 200: time.sleep(1) return self.cat(resource, params, **kwargs) if resource == "~/check_inspection": data = crypt.aes_decode(response.content, key="rBwj1MIAivVN222b") else: data = crypt.aes_decode(response.content) data = re.sub("&(?!amp;)", "&", data) if config.DEBUG and config.PRINT: print data return data