mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-23 09:46:53 +08:00
chore: refurish python code by applying Pylint linter rules (#8322)
This commit is contained in:
@@ -133,9 +133,9 @@ class GetWorksheetFieldsTool(BuiltinTool):
|
||||
|
||||
def _extract_options(self, control: dict) -> list:
|
||||
options = []
|
||||
if control["type"] in [9, 10, 11]:
|
||||
if control["type"] in {9, 10, 11}:
|
||||
options.extend([{"key": opt["key"], "value": opt["value"]} for opt in control.get("options", [])])
|
||||
elif control["type"] in [28, 36]:
|
||||
elif control["type"] in {28, 36}:
|
||||
itemnames = control["advancedSetting"].get("itemnames")
|
||||
if itemnames and itemnames.startswith("[{"):
|
||||
try:
|
||||
|
||||
@@ -183,11 +183,11 @@ class ListWorksheetRecordsTool(BuiltinTool):
|
||||
type_id = field.get("typeId")
|
||||
if type_id == 10:
|
||||
value = value if isinstance(value, str) else "、".join(value)
|
||||
elif type_id in [28, 36]:
|
||||
elif type_id in {28, 36}:
|
||||
value = field.get("options", {}).get(value, value)
|
||||
elif type_id in [26, 27, 48, 14]:
|
||||
elif type_id in {26, 27, 48, 14}:
|
||||
value = self.process_value(value)
|
||||
elif type_id in [35, 29]:
|
||||
elif type_id in {35, 29}:
|
||||
value = self.parse_cascade_or_associated(field, value)
|
||||
elif type_id == 40:
|
||||
value = self.parse_location(value)
|
||||
|
||||
Reference in New Issue
Block a user