Files
MoviePilot/app/modules/amll/__init__.py
DDSRem 2de976f6b3 Merge pull request #7050 from DDSRem-Dev/codex-comment-migration
docs: 统一全项目中文注释和结构化契约说明
2026-10-17 19:26:29 +08:00

26 lines
724 B
Python

"""
AMLL 能力清单使用的惰性模块入口。
"""
from importlib import import_module
from typing import Any
_EXPORTS = {
"AmllModule": ("app.modules.amll.module", "AmllModule"),
}
__all__ = ["AmllModule"]
def __getattr__(name: str) -> Any:
"""
按宿主要求保留包级 capability 身份,实现与协议解析分别由子模块拥有。
"""
contract = _EXPORTS.get(name)
if contract is None:
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
module_name, symbol_name = contract
implementation = getattr(import_module(module_name), symbol_name)
implementation.__module__ = __name__
globals()[name] = implementation
return implementation