Files
auto_control/core/actions/__init__.py
T

28 lines
977 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""全局操作框架:所有 app 任务共用的 Action 基类与注册机制。
为什么放这里:
抖音的点赞/评论 xpath 只适用抖音,留在 tasks/douyin/actions/。
但"操作"的抽象(BaseAction 接口、概率触发、注册机制)是通用的,
放这里让所有 app 任务共享同一套操作开发范式。
加新 app 的专属操作:
在 tasks/<app>/actions/ 下建 .py,继承本模块的 BaseAction,
用 @register_action 装饰(注册到该 app 自己的注册表,见下方)。
加跨 app 通用操作(如"滑动到下一个"、"等待元素出现"):
在 core/actions/ 下建 .py,继承 BaseAction。
"""
from .base import (
BaseAction, ActionContext,
register_action, create_action_registry,
list_actions, get_action,
should_trigger,
)
__all__ = [
"BaseAction", "ActionContext",
"register_action", "create_action_registry",
"list_actions", "get_action",
"should_trigger",
]