loader
¶
- class invoke.loader.Loader(config: Config | None = None)¶
定义如何查找/导入会话基的抽象类
Collection
.在 1.0 版本加入.
- __init__(config: Config | None = None) None ¶
设置一个新的加载器
Config
。- 参数:
config -- 一个显式的
Config
使用;它被引用用于与加载相关的配置选项。默认为匿名Config()
如果没有给予的话。
- find(name: str) ModuleSpec | None ¶
特定于实现的查找器方法,用于查找集合
name
。Must return a ModuleSpec valid for use by
importlib
, which is typically a name string followed by the contents of the 3-tuple returned byimportlib.module_from_spec
(name
,loader
,origin
.)有关示例实现,请参见
FilesystemLoader
。在 1.0 版本加入.
- class invoke.loader.FilesystemLoader(start: str | None = None, **kwargs: Any)¶
从文件系统加载python文件(例如
tasks.py
)从给定的起点递归搜索文件系统根目录。
在 1.0 版本加入.
- __init__(start: str | None = None, **kwargs: Any) None ¶
设置一个新的加载器
Config
。- 参数:
config -- 一个显式的
Config
使用;它被引用用于与加载相关的配置选项。默认为匿名Config()
如果没有给予的话。
- find(name: str) ModuleSpec | None ¶
特定于实现的查找器方法,用于查找集合
name
。Must return a ModuleSpec valid for use by
importlib
, which is typically a name string followed by the contents of the 3-tuple returned byimportlib.module_from_spec
(name
,loader
,origin
.)有关示例实现,请参见
FilesystemLoader
。在 1.0 版本加入.