Files
Pac-cogs/videoarchiver/core/initialization.py
pacnpal 08d5dc56cf Fixed role_manager.py typing issues by adding missing imports (Optional, Any)
Added process_queue method to EnhancedVideoQueueManager and updated its initialization
Updated component_manager.py to use EnhancedVideoQueueManager correctly
Fixed circular imports in the core module by:
Moving initialization logic to lifecycle.py
Making initialization.py provide thin wrappers that delegate to lifecycle.py
Ensuring proper import order in base.py
Verified all module init.py files are properly exposing their components:
core/init.py exposes VideoArchiver
queue/init.py exposes EnhancedVideoQueueManager and dependencies
processor/init.py exposes VideoProcessor and related components
commands/init.py exposes command setup functions
The import chain is now clean:

base.py imports from lifecycle.py
lifecycle.py contains all initialization logic
initialization.py delegates to lifecycle.py
No circular dependencies
All components are properly exposed through their respective init.py files
2024-11-16 17:13:11 +00:00

17 lines
544 B
Python

"""Module for handling VideoArchiver initialization"""
from typing import TYPE_CHECKING
import asyncio
if TYPE_CHECKING:
from .base import VideoArchiver
# Re-export initialization functions from lifecycle
async def initialize_cog(cog: "VideoArchiver") -> None:
"""Initialize all components with proper error handling"""
await cog.lifecycle_manager.initialize_cog()
def init_callback(cog: "VideoArchiver", task: asyncio.Task) -> None:
"""Handle initialization task completion"""
cog.lifecycle_manager.init_callback(task)