mirror of
https://github.com/pacnpal/Pac-cogs.git
synced 2025-12-20 10:51:05 -05:00
fixed imports hopefully
This commit is contained in:
@@ -9,57 +9,57 @@ from redbot.core.bot import Red
|
|||||||
|
|
||||||
# Force reload of all modules
|
# Force reload of all modules
|
||||||
modules_to_reload = [
|
modules_to_reload = [
|
||||||
'.utils.exceptions',
|
".utils.exceptions",
|
||||||
'.utils',
|
".utils",
|
||||||
'.processor',
|
".processor",
|
||||||
'.processor.core',
|
".processor.core",
|
||||||
'.processor.queue_processor',
|
".processor.queue_processor",
|
||||||
'.queue',
|
".queue",
|
||||||
'.queue.models',
|
".queue.models",
|
||||||
'.queue.manager',
|
".queue.manager",
|
||||||
'.queue.cleaners',
|
".queue.cleaners",
|
||||||
'.queue.cleaners.guild_cleaner',
|
".queue.cleaners.guild_cleaner",
|
||||||
'.queue.cleaners.history_cleaner',
|
".queue.cleaners.history_cleaner",
|
||||||
'.queue.cleaners.tracking_cleaner',
|
".queue.cleaners.tracking_cleaner",
|
||||||
'.queue.monitoring',
|
".queue.monitoring",
|
||||||
'.queue.recovery_manager',
|
".queue.recovery_manager",
|
||||||
'.queue.state_manager',
|
".queue.state_manager",
|
||||||
'.ffmpeg',
|
".ffmpeg",
|
||||||
'.ffmpeg.binary_manager',
|
".ffmpeg.binary_manager",
|
||||||
'.ffmpeg.encoder_params',
|
".ffmpeg.encoder_params",
|
||||||
'.ffmpeg.exceptions',
|
".ffmpeg.exceptions",
|
||||||
'.ffmpeg.ffmpeg_downloader',
|
".ffmpeg.ffmpeg_downloader",
|
||||||
'.ffmpeg.ffmpeg_manager',
|
".ffmpeg.ffmpeg_manager",
|
||||||
'.ffmpeg.gpu_detector',
|
".ffmpeg.gpu_detector",
|
||||||
'.ffmpeg.process_manager',
|
".ffmpeg.process_manager",
|
||||||
'.ffmpeg.verification_manager',
|
".ffmpeg.verification_manager",
|
||||||
'.ffmpeg.video_analyzer',
|
".ffmpeg.video_analyzer",
|
||||||
'.database',
|
".database",
|
||||||
'.database.connection_manager',
|
".database.connection_manager",
|
||||||
'.database.query_manager',
|
".database.query_manager",
|
||||||
'.database.schema_manager',
|
".database.schema_manager",
|
||||||
'.database.video_archive_db',
|
".database.video_archive_db",
|
||||||
'.config',
|
".config",
|
||||||
'.config.channel_manager',
|
".config.channel_manager",
|
||||||
'.config.exceptions',
|
".config.exceptions",
|
||||||
'.config.role_manager',
|
".config.role_manager",
|
||||||
'.config.settings_formatter',
|
".config.settings_formatter",
|
||||||
'.config.validation_manager',
|
".config.validation_manager",
|
||||||
'.core',
|
".core",
|
||||||
'.core.base',
|
".core.base",
|
||||||
'.core.cleanup',
|
".core.cleanup",
|
||||||
'.core.commands',
|
".core.commands",
|
||||||
'.core.commands.archiver_commands',
|
".core.commands.archiver_commands",
|
||||||
'.core.commands.database_commands',
|
".core.commands.database_commands",
|
||||||
'.core.commands.settings_commands',
|
".core.commands.settings_commands",
|
||||||
'.core.component_manager',
|
".core.component_manager",
|
||||||
'.core.error_handler',
|
".core.error_handler",
|
||||||
'.core.events',
|
".core.events",
|
||||||
'.core.guild',
|
".core.guild",
|
||||||
'.core.initialization',
|
".core.initialization",
|
||||||
'.core.lifecycle',
|
".core.lifecycle",
|
||||||
'.core.response_handler',
|
".core.response_handler",
|
||||||
'.core.settings'
|
".core.settings",
|
||||||
]
|
]
|
||||||
|
|
||||||
# Remove modules to force fresh import
|
# Remove modules to force fresh import
|
||||||
@@ -69,30 +69,37 @@ for module in modules_to_reload:
|
|||||||
|
|
||||||
# Import and reload utils
|
# Import and reload utils
|
||||||
from . import utils
|
from . import utils
|
||||||
|
|
||||||
importlib.reload(utils)
|
importlib.reload(utils)
|
||||||
|
|
||||||
# Import and reload processor
|
# Import and reload processor
|
||||||
from . import processor
|
from . import processor
|
||||||
|
|
||||||
importlib.reload(processor)
|
importlib.reload(processor)
|
||||||
|
|
||||||
# Import and reload queue
|
# Import and reload queue
|
||||||
from . import queue
|
from . import queue
|
||||||
|
|
||||||
importlib.reload(queue)
|
importlib.reload(queue)
|
||||||
|
|
||||||
# Import and reload ffmpeg
|
# Import and reload ffmpeg
|
||||||
from . import ffmpeg
|
from . import ffmpeg
|
||||||
|
|
||||||
importlib.reload(ffmpeg)
|
importlib.reload(ffmpeg)
|
||||||
|
|
||||||
# Import and reload database
|
# Import and reload database
|
||||||
from . import database
|
from . import database
|
||||||
|
|
||||||
importlib.reload(database)
|
importlib.reload(database)
|
||||||
|
|
||||||
# Import and reload config
|
# Import and reload config
|
||||||
from . import config
|
from . import config
|
||||||
|
|
||||||
importlib.reload(config)
|
importlib.reload(config)
|
||||||
|
|
||||||
# Import and reload core
|
# Import and reload core
|
||||||
from . import core
|
from . import core
|
||||||
|
|
||||||
importlib.reload(core)
|
importlib.reload(core)
|
||||||
|
|
||||||
from .core.base import VideoArchiver
|
from .core.base import VideoArchiver
|
||||||
@@ -105,22 +112,21 @@ from .utils.exceptions import (
|
|||||||
CogError,
|
CogError,
|
||||||
ErrorContext,
|
ErrorContext,
|
||||||
ErrorSeverity,
|
ErrorSeverity,
|
||||||
ProcessingError
|
ProcessingError,
|
||||||
)
|
)
|
||||||
from .database import VideoArchiveDB
|
from .database import *
|
||||||
from .ffmpeg import FFmpegManager
|
from .ffmpeg import *
|
||||||
from .queue import EnhancedVideoQueueManager
|
from .queue import *
|
||||||
from .processor import VideoProcessor
|
from .processor import *
|
||||||
from .config_manager import ConfigManager
|
from .config_manager import *
|
||||||
from .update_checker import UpdateChecker
|
from .update_checker import *
|
||||||
|
from .queue.cleaners import *
|
||||||
# Additional imports from subdirectories
|
from .database import *
|
||||||
from .queue.cleaners import QueueCleaner
|
from .utils import *
|
||||||
from .queue import QueueStateManager, QueueMetricsManager, QueueProcessor
|
from .core import *
|
||||||
from .ffmpeg import BinaryManager, EncoderParams, GPUDetector, ProcessManager
|
from .config import *
|
||||||
from .database import DatabaseConnectionManager, DatabaseQueryManager, DatabaseSchemaManager
|
from config_manager import *
|
||||||
from .processor import CleanupManager, MessageHandler, QueueProcessor
|
from update_checker import *
|
||||||
from .utils import CompressionManager, DirectoryManager, DownloadManager, FileOperations
|
|
||||||
|
|
||||||
logger = logging.getLogger("VideoArchiver")
|
logger = logging.getLogger("VideoArchiver")
|
||||||
|
|
||||||
@@ -132,6 +138,7 @@ __version__ = "1.0.0"
|
|||||||
__author__ = "VideoArchiver Team"
|
__author__ = "VideoArchiver Team"
|
||||||
__description__ = "Video archiving cog for Red-DiscordBot"
|
__description__ = "Video archiving cog for Red-DiscordBot"
|
||||||
|
|
||||||
|
|
||||||
async def setup(bot: Red) -> None:
|
async def setup(bot: Red) -> None:
|
||||||
"""Load VideoArchiver with proper initialization."""
|
"""Load VideoArchiver with proper initialization."""
|
||||||
try:
|
try:
|
||||||
@@ -202,7 +209,6 @@ __all__ = [
|
|||||||
"DirectoryManager",
|
"DirectoryManager",
|
||||||
"DownloadManager",
|
"DownloadManager",
|
||||||
"FileOperations",
|
"FileOperations",
|
||||||
|
|
||||||
# Base exceptions
|
# Base exceptions
|
||||||
"VideoArchiverError",
|
"VideoArchiverError",
|
||||||
"CommandError",
|
"CommandError",
|
||||||
@@ -211,8 +217,7 @@ __all__ = [
|
|||||||
"ErrorContext",
|
"ErrorContext",
|
||||||
"ErrorSeverity",
|
"ErrorSeverity",
|
||||||
"ProcessingError",
|
"ProcessingError",
|
||||||
|
|
||||||
# Setup functions
|
# Setup functions
|
||||||
"setup",
|
"setup",
|
||||||
"teardown"
|
"teardown",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
"""Re-export commands from core.base"""
|
|
||||||
from .core.base import VideoArchiver
|
|
||||||
|
|
||||||
__all__ = ['VideoArchiver']
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
"""Base exceptions for VideoArchiver"""
|
|
||||||
|
|
||||||
from .utils.exceptions import (
|
|
||||||
VideoArchiverError,
|
|
||||||
ConfigurationError,
|
|
||||||
VideoVerificationError,
|
|
||||||
QueueError,
|
|
||||||
FileCleanupError,
|
|
||||||
ResourceExhaustedError,
|
|
||||||
ProcessingError,
|
|
||||||
CleanupError,
|
|
||||||
FileOperationError,
|
|
||||||
VideoDownloadError,
|
|
||||||
VideoProcessingError,
|
|
||||||
VideoUploadError,
|
|
||||||
VideoCleanupError,
|
|
||||||
PermissionError,
|
|
||||||
NetworkError,
|
|
||||||
ResourceError,
|
|
||||||
ComponentError,
|
|
||||||
DiscordAPIError,
|
|
||||||
)
|
|
||||||
|
|
||||||
# Re-export all exceptions
|
|
||||||
__all__ = [
|
|
||||||
"VideoArchiverError",
|
|
||||||
"ConfigurationError",
|
|
||||||
"VideoVerificationError",
|
|
||||||
"QueueError",
|
|
||||||
"FileCleanupError",
|
|
||||||
"ResourceExhaustedError",
|
|
||||||
"ProcessingError",
|
|
||||||
"CleanupError",
|
|
||||||
"FileOperationError",
|
|
||||||
"VideoDownloadError",
|
|
||||||
"VideoProcessingError",
|
|
||||||
"VideoUploadError",
|
|
||||||
"VideoCleanupError",
|
|
||||||
"PermissionError",
|
|
||||||
"NetworkError",
|
|
||||||
"ResourceError",
|
|
||||||
"ComponentError",
|
|
||||||
"DiscordAPIError",
|
|
||||||
]
|
|
||||||
|
|
||||||
# Alias exceptions for backward compatibility
|
|
||||||
ConfigError = ConfigurationError
|
|
||||||
UpdateError = VideoVerificationError
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
"""Re-export video processing components from processor module"""
|
|
||||||
|
|
||||||
from .processor import (
|
|
||||||
VideoProcessor,
|
|
||||||
REACTIONS,
|
|
||||||
MessageHandler,
|
|
||||||
QueueHandler
|
|
||||||
)
|
|
||||||
|
|
||||||
__all__ = [
|
|
||||||
'VideoProcessor',
|
|
||||||
'REACTIONS',
|
|
||||||
'MessageHandler',
|
|
||||||
'QueueHandler'
|
|
||||||
]
|
|
||||||
Reference in New Issue
Block a user