refactor(executors): 移除私有函数前缀并修正导入
This commit is contained in:
@@ -53,7 +53,7 @@ class Strategy(enum.Enum):
|
||||
ASYNC = "async"
|
||||
|
||||
|
||||
def _normalize_strategy(strategy: str | Strategy) -> Strategy:
|
||||
def normalize_strategy(strategy: str | Strategy) -> Strategy:
|
||||
"""将字符串或 Strategy 归一化为 Strategy 枚举.
|
||||
|
||||
Parameters
|
||||
@@ -436,7 +436,7 @@ def run(
|
||||
任何任务耗尽重试后仍失败时。运行在失败层中止;后续层的任务
|
||||
不会被执行。
|
||||
"""
|
||||
normalized = _normalize_strategy(strategy)
|
||||
normalized = normalize_strategy(strategy)
|
||||
|
||||
graph.validate()
|
||||
layers = graph.layers()
|
||||
|
||||
@@ -26,7 +26,7 @@ import sys
|
||||
from typing import Sequence
|
||||
|
||||
from .errors import PyFlowXError
|
||||
from .executors import Strategy, _normalize_strategy, run
|
||||
from .executors import Strategy, normalize_strategy, run
|
||||
from .graph import Graph
|
||||
|
||||
__all__ = ["CliExitCode", "CliRunner"]
|
||||
@@ -132,7 +132,7 @@ class CliRunner:
|
||||
f"CliRunner 命令 {name!r} 的值必须是 Graph 实例, 实际是 {type(graph).__name__}"
|
||||
)
|
||||
self._graphs: dict[str, Graph] = dict(graphs)
|
||||
self._strategy: Strategy = _normalize_strategy(strategy)
|
||||
self._strategy: Strategy = normalize_strategy(strategy)
|
||||
self._description: str = description
|
||||
self._verbose: bool = verbose
|
||||
|
||||
|
||||
Reference in New Issue
Block a user