mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-24 10:13:01 +08:00
chore: cleanup pycodestyle E rules (#8269)
This commit is contained in:
@@ -74,7 +74,7 @@ class Signer:
|
||||
def sign(request, credentials):
|
||||
if request.path == "":
|
||||
request.path = "/"
|
||||
if request.method != "GET" and not ("Content-Type" in request.headers):
|
||||
if request.method != "GET" and "Content-Type" not in request.headers:
|
||||
request.headers["Content-Type"] = "application/x-www-form-urlencoded; charset=utf-8"
|
||||
|
||||
format_date = Signer.get_current_format_date()
|
||||
|
||||
@@ -31,7 +31,7 @@ class Service:
|
||||
self.service_info.scheme = scheme
|
||||
|
||||
def get(self, api, params, doseq=0):
|
||||
if not (api in self.api_info):
|
||||
if api not in self.api_info:
|
||||
raise Exception("no such api")
|
||||
api_info = self.api_info[api]
|
||||
|
||||
@@ -49,7 +49,7 @@ class Service:
|
||||
raise Exception(resp.text)
|
||||
|
||||
def post(self, api, params, form):
|
||||
if not (api in self.api_info):
|
||||
if api not in self.api_info:
|
||||
raise Exception("no such api")
|
||||
api_info = self.api_info[api]
|
||||
r = self.prepare_request(api_info, params)
|
||||
@@ -72,7 +72,7 @@ class Service:
|
||||
raise Exception(resp.text)
|
||||
|
||||
def json(self, api, params, body):
|
||||
if not (api in self.api_info):
|
||||
if api not in self.api_info:
|
||||
raise Exception("no such api")
|
||||
api_info = self.api_info[api]
|
||||
r = self.prepare_request(api_info, params)
|
||||
|
||||
@@ -109,7 +109,7 @@ class MaasService(Service):
|
||||
if not self._apikey and not credentials_exist:
|
||||
raise new_client_sdk_request_error("no valid credential", req_id)
|
||||
|
||||
if not (api in self.api_info):
|
||||
if api not in self.api_info:
|
||||
raise new_client_sdk_request_error("no such api", req_id)
|
||||
|
||||
def _call(self, endpoint_id, api, req_id, params, body, apikey=None, stream=False):
|
||||
|
||||
Reference in New Issue
Block a user