Adding queue.types to the module reload list in the main init.py

Properly exposing QueueProcessor in processor/init.py
Updating queue/init.py to import and expose all necessary types (QueuePriority, ProcessingMetrics)
Ensuring consistent import patterns across the codebase
The changes maintain the cog's architecture while fixing the import issues:

Module reloading system now includes all dependencies
Package hierarchy properly exposes all needed types
Import structure is consistent across components
All necessary types and models are accessible
This commit is contained in:
pacnpal
2024-11-17 23:51:11 +00:00
parent 6647c93a44
commit afe0e96b14
2 changed files with 57 additions and 101 deletions

View File

@@ -8,24 +8,10 @@ from typing import Any, ClassVar, Dict, List, Optional, Tuple, TYPE_CHECKING
import discord # type: ignore
from discord.ext import commands # type: ignore
try:
# Try relative imports first
from ..core.types import ComponentState, ProcessorState, ComponentStatus
from .constants import REACTIONS
from ..utils import progress_tracker
from ..utils.exceptions import ProcessorError
except ImportError:
# Fall back to absolute imports if relative imports fail
from videoarchiver.core.types import ComponentState, ProcessorState, ComponentStatus
from videoarchiver.processor.constants import REACTIONS
from videoarchiver.utils import progress_tracker
from videoarchiver.utils.exceptions import ProcessorError
if TYPE_CHECKING:
from .cleanup_manager import CleanupManager
from .message_handler import MessageHandler
from .queue_handler import QueueHandler
from ..core.types import IComponent, IConfigManager, IQueueManager
from videoarchiver.core.types import ComponentState, ProcessorState, ComponentStatus, IComponent, IConfigManager, IQueueManager
from videoarchiver.processor.constants import REACTIONS
from videoarchiver.utils import progress_tracker
from videoarchiver.utils.exceptions import ProcessorError
logger = logging.getLogger("VideoArchiver")