Skip to content

BaseTask

BaseTask

BaseTask(name: str, link_name: str, local_path: Path, prev_task_server: Path, thumbnail: BaseThumbnail, data_to_show, *args, **kwargs)

Represents a unit of work within a plugin, including paths and metadata.

Attributes:

  • name (str) –

    Task name (e.g., 'refine', 'model').

  • link_name (str) –

    Linked entity name.

  • local_path (Path) –

    Local path of the task.

  • prev_task_server (Path) –

    Server path of previous task.

  • thumbnail (BaseThumbnail) –

    Thumbnail metadata.

  • data_to_show (List[Any]) –

    Data rows to display.

Methods:

  • deserialize

    Populate this object from serialized dictionary or JSON string.

  • serialize

    Serialize the task object's public attributes to a dictionary.

data_to_show property writable

data_to_show: List[Any]

Get the data to show in UI list.

link_name: str

Get the link name.

local_path property writable

local_path: Path

Get the task's local path.

name property writable

name: str

Get the task name.

thumbnail property writable

thumbnail

Get the thumbnail object.

deserialize

deserialize(data: Union[str, Dict[str, Any]]) -> None

Populate this object from serialized dictionary or JSON string.

Parameters:

  • data

    (Union[str, Dict[str, Any]]) –

    JSON string or dict.

serialize

serialize() -> Dict[str, Any]

Serialize the task object's public attributes to a dictionary.

Returns:

  • Dict[str, Any]

    Dict[str, Any]: Serialized key-value mapping.