File size: 1,030 Bytes
06fe5c0 4055558 06fe5c0 4055558 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
"""
Lightweight package init.
Avoid importing heavy submodules at import-time to prevent partially
initialized modules and mysterious ImportErrors on Spaces.
PEP 562-style lazy export of symbols from video_processor.
"""
from typing import List
__all__ = ["CoreVideoProcessor", "VideoProcessor", "ProcessorConfig", "ProcessingConfig"]
def __getattr__(name):
if name in __all__:
# Lazy import to avoid circular/early import errors
from .video_processor import (
CoreVideoProcessor,
VideoProcessor,
ProcessorConfig,
ProcessingConfig,
)
mapping = {
"CoreVideoProcessor": CoreVideoProcessor,
"VideoProcessor": VideoProcessor,
"ProcessorConfig": ProcessorConfig,
"ProcessingConfig": ProcessingConfig,
}
return mapping[name]
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
def __dir__() -> List[str]:
return sorted(list(globals().keys()) + __all__)
|