From 247381fc8aa913cd742dd6f85a89e54fbcbf8360 Mon Sep 17 00:00:00 2001 From: pacnpal <183241239+pacnpal@users.noreply.github.com> Date: Sun, 17 Nov 2024 01:29:00 +0000 Subject: [PATCH] Changing the relative import in core.py to use an absolute import path: from videoarchiver.utils import progress_tracker Updated the main init.py to properly handle module reloading: Added 'videoarchiver.processor' and 'videoarchiver.processor.core' to modules_to_reload Added explicit import and reload of the processor module These changes ensure that: The progress_tracker is properly imported from the utils package All necessary modules are reloaded during initialization Circular imports are avoided The package structure maintains proper dependency flow --- videoarchiver/__init__.py | 6 ++++++ videoarchiver/processor/core.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/videoarchiver/__init__.py b/videoarchiver/__init__.py index 3668b4f..27c3e67 100644 --- a/videoarchiver/__init__.py +++ b/videoarchiver/__init__.py @@ -11,6 +11,8 @@ from redbot.core.bot import Red modules_to_reload = [ 'videoarchiver.utils.exceptions', 'videoarchiver.utils', + 'videoarchiver.processor', + 'videoarchiver.processor.core', 'videoarchiver.core.commands.settings_commands', 'videoarchiver.core.commands.archiver_commands', 'videoarchiver.core.commands.database_commands' @@ -25,6 +27,10 @@ for module in modules_to_reload: from . import utils importlib.reload(utils) +# Import and reload processor +from . import processor +importlib.reload(processor) + from .core.base import VideoArchiver from .core.initialization import initialize_cog, init_callback from .core.cleanup import cleanup_resources diff --git a/videoarchiver/processor/core.py b/videoarchiver/processor/core.py index 2de1115..7ed7ef5 100644 --- a/videoarchiver/processor/core.py +++ b/videoarchiver/processor/core.py @@ -10,7 +10,7 @@ from discord.ext import commands from .message_handler import MessageHandler from .queue_handler import QueueHandler -from ..utils import progress_tracker +from videoarchiver.utils import progress_tracker from .status_display import StatusDisplay from .cleanup_manager import CleanupManager, CleanupStrategy from .constants import REACTIONS