chore: cleanup pycodestyle E rules (#8269)

This commit is contained in:
Bowen Liang
2024-09-11 18:55:00 +08:00
committed by GitHub
parent f515af2232
commit 781d294f49
14 changed files with 25 additions and 24 deletions

View File

@@ -71,7 +71,7 @@ class BingSearchTool(BuiltinTool):
text = ""
if search_results:
for i, result in enumerate(search_results):
text += f'{i+1}: {result.get("name", "")} - {result.get("snippet", "")}\n'
text += f'{i + 1}: {result.get("name", "")} - {result.get("snippet", "")}\n'
if computation and "expression" in computation and "value" in computation:
text += "\nComputation:\n"

View File

@@ -83,5 +83,5 @@ class DIDApp:
if status["status"] == "done":
return status
elif status["status"] == "error" or status["status"] == "rejected":
raise HTTPError(f'Talks {id} failed: {status["status"]} {status.get("error",{}).get("description")}')
raise HTTPError(f'Talks {id} failed: {status["status"]} {status.get("error", {}).get("description")}')
time.sleep(poll_interval)

View File

@@ -142,7 +142,7 @@ class ListWorksheetRecordsTool(BuiltinTool):
for control in controls:
control_type_id = self.get_real_type_id(control)
if (control_type_id in self._get_ignore_types()) or (
allow_fields and not control["controlId"] in allow_fields
allow_fields and control["controlId"] not in allow_fields
):
continue
else:

View File

@@ -67,7 +67,7 @@ class ListWorksheetsTool(BuiltinTool):
items = []
tables = ""
for item in section.get("items", []):
if item.get("type") == 0 and (not "notes" in item or item.get("notes") != "NO"):
if item.get("type") == 0 and ("notes" not in item or item.get("notes") != "NO"):
if type == "json":
filtered_item = {"id": item["id"], "name": item["name"], "notes": item.get("notes", "")}
items.append(filtered_item)