feat: add logo for requesters (#1300)

This commit is contained in:
Junyan Qin (Chin)
2025-04-14 23:32:32 +08:00
committed by GitHub
parent 2fdb53efc9
commit 69435c04cc
27 changed files with 86 additions and 1 deletions

View File

@@ -4,7 +4,7 @@ import typing
import importlib
import os
import inspect
import mimetypes
import yaml
import pydantic
@@ -154,6 +154,11 @@ class Component(pydantic.BaseModel):
"""组件可执行文件信息"""
return self._execution
@property
def icon_rel_path(self) -> str:
"""图标相对路径"""
return os.path.join(self.rel_dir, self.metadata.icon) if self.metadata.icon is not None and self.metadata.icon.strip() != '' else None
def get_python_component_class(self) -> typing.Type[typing.Any]:
"""获取Python组件类"""
module_path = os.path.join(self.rel_dir, self.execution.python.path)