From 4fe45458bf04805196816b3e392397334899f829 Mon Sep 17 00:00:00 2001 From: pacnpal <183241239+pacnpal@users.noreply.github.com> Date: Sun, 17 Nov 2024 02:58:53 +0000 Subject: [PATCH] In the core module: Updated base.py to use absolute imports Updated cleanup.py to use absolute imports Updated events.py to use absolute imports Updated error_handler.py to use absolute imports Updated guild.py to use absolute imports Updated initialization.py to use absolute imports Updated lifecycle.py to use absolute imports Updated response_handler.py to use absolute imports Updated settings.py to use absolute imports In the core/commands module: Updated archiver_commands.py to use absolute imports Updated database_commands.py to use absolute imports Updated settings_commands.py to use absolute imports Left init.py unchanged as its relative imports are appropriate In the processor module: Updated core.py to use absolute imports Updated processor/init.py to use absolute imports Updated queue_handler.py to use absolute imports Updated queue_processor.py to use absolute imports Updated status_display.py to use absolute imports Updated cleanup_manager.py to use absolute imports --- videoarchiver/core/base.py | 30 +++++++++---------- videoarchiver/core/cleanup.py | 6 ++-- .../core/commands/archiver_commands.py | 4 +-- .../core/commands/database_commands.py | 6 ++-- .../core/commands/settings_commands.py | 6 ++-- videoarchiver/core/component_manager.py | 12 ++++---- videoarchiver/core/error_handler.py | 4 +-- videoarchiver/core/events.py | 14 ++++----- videoarchiver/core/guild.py | 10 +++---- videoarchiver/core/initialization.py | 6 ++-- videoarchiver/core/lifecycle.py | 4 +-- videoarchiver/core/response_handler.py | 2 +- videoarchiver/core/settings.py | 2 +- videoarchiver/processor/cleanup_manager.py | 6 ++-- videoarchiver/processor/queue_processor.py | 10 +++---- videoarchiver/processor/status_display.py | 2 +- 16 files changed, 62 insertions(+), 62 deletions(-) diff --git a/videoarchiver/core/base.py b/videoarchiver/core/base.py index 5963a92..ebd8200 100644 --- a/videoarchiver/core/base.py +++ b/videoarchiver/core/base.py @@ -12,22 +12,22 @@ import discord from redbot.core.bot import Red from redbot.core.commands import GroupCog, Context -from .settings import Settings -from .lifecycle import LifecycleManager, LifecycleState -from .component_manager import ComponentManager, ComponentState -from .error_handler import error_manager, handle_command_error -from .response_handler import response_manager -from .commands.archiver_commands import setup_archiver_commands -from .commands.database_commands import setup_database_commands -from .commands.settings_commands import setup_settings_commands -from .events import setup_events, EventManager +from videoarchiver.core.settings import Settings +from videoarchiver.core.lifecycle import LifecycleManager, LifecycleState +from videoarchiver.core.component_manager import ComponentManager, ComponentState +from videoarchiver.core.error_handler import error_manager, handle_command_error +from videoarchiver.core.response_handler import response_manager +from videoarchiver.core.commands.archiver_commands import setup_archiver_commands +from videoarchiver.core.commands.database_commands import setup_database_commands +from videoarchiver.core.commands.settings_commands import setup_settings_commands +from videoarchiver.core.events import setup_events, EventManager -from ..processor.core import Processor -from ..queue.manager import QueueManager -from ..ffmpeg.ffmpeg_manager import FFmpegManager -from ..database.video_archive_db import VideoArchiveDB -from ..config_manager import ConfigManager -from ..utils.exceptions import ( +from videoarchiver.processor.core import Processor +from videoarchiver.queue.manager import QueueManager +from videoarchiver.ffmpeg.ffmpeg_manager import FFmpegManager +from videoarchiver.database.video_archive_db import VideoArchiveDB +from videoarchiver.config_manager import ConfigManager +from videoarchiver.utils.exceptions import ( CogError, ErrorContext, ErrorSeverity diff --git a/videoarchiver/core/cleanup.py b/videoarchiver/core/cleanup.py index a286d1b..b093cec 100644 --- a/videoarchiver/core/cleanup.py +++ b/videoarchiver/core/cleanup.py @@ -8,15 +8,15 @@ from enum import Enum, auto from pathlib import Path from typing import TYPE_CHECKING, Dict, Any, Optional, TypedDict, ClassVar -from ..utils.file_ops import cleanup_downloads -from ..utils.exceptions import ( +from videoarchiver.utils.file_ops import cleanup_downloads +from videoarchiver.utils.exceptions import ( CleanupError, ErrorContext, ErrorSeverity ) if TYPE_CHECKING: - from .base import VideoArchiver + from videoarchiver.core.base import VideoArchiver logger = logging.getLogger("VideoArchiver") diff --git a/videoarchiver/core/commands/archiver_commands.py b/videoarchiver/core/commands/archiver_commands.py index 3923ccc..7062440 100644 --- a/videoarchiver/core/commands/archiver_commands.py +++ b/videoarchiver/core/commands/archiver_commands.py @@ -9,8 +9,8 @@ from discord import app_commands from redbot.core import commands from redbot.core.commands import Context, hybrid_group, guild_only, admin_or_permissions -from ..response_handler import handle_response, ResponseType -from ...utils.exceptions import ( +from videoarchiver.core.response_handler import handle_response, ResponseType +from videoarchiver.utils.exceptions import ( CommandError, ErrorContext, ErrorSeverity diff --git a/videoarchiver/core/commands/database_commands.py b/videoarchiver/core/commands/database_commands.py index f8227a9..45e0fd7 100644 --- a/videoarchiver/core/commands/database_commands.py +++ b/videoarchiver/core/commands/database_commands.py @@ -10,14 +10,14 @@ from discord import app_commands from redbot.core import commands from redbot.core.commands import Context, hybrid_group, guild_only, admin_or_permissions -from ..response_handler import handle_response, ResponseType -from ...utils.exceptions import ( +from videoarchiver.core.response_handler import handle_response, ResponseType +from videoarchiver.utils.exceptions import ( CommandError, ErrorContext, ErrorSeverity, DatabaseError ) -from ...database.video_archive_db import VideoArchiveDB +from videoarchiver.database.video_archive_db import VideoArchiveDB logger = logging.getLogger("VideoArchiver") diff --git a/videoarchiver/core/commands/settings_commands.py b/videoarchiver/core/commands/settings_commands.py index 4fae24d..f16899d 100644 --- a/videoarchiver/core/commands/settings_commands.py +++ b/videoarchiver/core/commands/settings_commands.py @@ -9,9 +9,9 @@ from discord import app_commands from redbot.core import commands from redbot.core.commands import Context, hybrid_group, guild_only, admin_or_permissions -from ...core.settings import VideoFormat, VideoQuality -from ..response_handler import handle_response, ResponseType -from ...utils.exceptions import ( +from videoarchiver.core.settings import VideoFormat, VideoQuality +from videoarchiver.core.response_handler import handle_response, ResponseType +from videoarchiver.utils.exceptions import ( CommandError, ErrorContext, ErrorSeverity diff --git a/videoarchiver/core/component_manager.py b/videoarchiver/core/component_manager.py index 1ffd336..6c6acee 100644 --- a/videoarchiver/core/component_manager.py +++ b/videoarchiver/core/component_manager.py @@ -8,16 +8,16 @@ from datetime import datetime from pathlib import Path import importlib -from ..utils.exceptions import ( +from videoarchiver.utils.exceptions import ( ComponentError, ErrorContext, ErrorSeverity ) -from ..utils.path_manager import ensure_directory -from ..config_manager import ConfigManager -from ..processor.core import Processor -from ..queue.manager import EnhancedVideoQueueManager -from ..ffmpeg.ffmpeg_manager import FFmpegManager +from videoarchiver.utils.path_manager import ensure_directory +from videoarchiver.config_manager import ConfigManager +from videoarchiver.processor.core import Processor +from videoarchiver.queue.manager import EnhancedVideoQueueManager +from videoarchiver.ffmpeg.ffmpeg_manager import FFmpegManager logger = logging.getLogger("VideoArchiver") diff --git a/videoarchiver/core/error_handler.py b/videoarchiver/core/error_handler.py index 6b0223d..da4c099 100644 --- a/videoarchiver/core/error_handler.py +++ b/videoarchiver/core/error_handler.py @@ -14,7 +14,7 @@ from redbot.core.commands import ( CommandError ) -from ..utils.exceptions import ( +from videoarchiver.utils.exceptions import ( VideoArchiverError, ErrorSeverity, ErrorContext, @@ -33,7 +33,7 @@ from ..utils.exceptions import ( ResourceExhaustedError, ConfigurationError ) -from .response_handler import response_manager +from videoarchiver.core.response_handler import response_manager logger = logging.getLogger("VideoArchiver") diff --git a/videoarchiver/core/events.py b/videoarchiver/core/events.py index cfc459a..6fb1440 100644 --- a/videoarchiver/core/events.py +++ b/videoarchiver/core/events.py @@ -9,15 +9,15 @@ from typing import TYPE_CHECKING, Dict, Any, Optional, TypedDict, ClassVar, List import discord -from ..processor.constants import REACTIONS -from ..processor.reactions import handle_archived_reaction -from .guild import initialize_guild_components, cleanup_guild_components -from .error_handler import error_manager -from .response_handler import response_manager -from ..utils.exceptions import EventError, ErrorContext, ErrorSeverity +from videoarchiver.processor.constants import REACTIONS +from videoarchiver.processor.reactions import handle_archived_reaction +from videoarchiver.core.guild import initialize_guild_components, cleanup_guild_components +from videoarchiver.core.error_handler import error_manager +from videoarchiver.core.response_handler import response_manager +from videoarchiver.utils.exceptions import EventError, ErrorContext, ErrorSeverity if TYPE_CHECKING: - from .base import VideoArchiver + from videoarchiver.core.base import VideoArchiver logger = logging.getLogger("VideoArchiver") diff --git a/videoarchiver/core/guild.py b/videoarchiver/core/guild.py index c065299..e6954f6 100644 --- a/videoarchiver/core/guild.py +++ b/videoarchiver/core/guild.py @@ -4,13 +4,13 @@ import logging from pathlib import Path from typing import TYPE_CHECKING, Dict, Any, Optional -from ..utils.download_core import DownloadCore -from ..utils.message_manager import MessageManager -from ..utils.file_ops import cleanup_downloads -from ..utils.exceptions import VideoArchiverError as ProcessingError +from videoarchiver.utils.download_core import DownloadCore +from videoarchiver.utils.message_manager import MessageManager +from videoarchiver.utils.file_ops import cleanup_downloads +from videoarchiver.utils.exceptions import VideoArchiverError as ProcessingError if TYPE_CHECKING: - from .base import VideoArchiver + from videoarchiver.core.base import VideoArchiver logger = logging.getLogger("VideoArchiver") diff --git a/videoarchiver/core/initialization.py b/videoarchiver/core/initialization.py index 2444991..5573842 100644 --- a/videoarchiver/core/initialization.py +++ b/videoarchiver/core/initialization.py @@ -4,15 +4,15 @@ from typing import TYPE_CHECKING, Optional, Dict, Any import asyncio import logging -from ..utils.exceptions import ( +from videoarchiver.utils.exceptions import ( ComponentError, ErrorContext, ErrorSeverity ) -from .lifecycle import LifecycleState +from videoarchiver.core.lifecycle import LifecycleState if TYPE_CHECKING: - from .base import VideoArchiver + from videoarchiver.core.base import VideoArchiver logger = logging.getLogger("VideoArchiver") diff --git a/videoarchiver/core/lifecycle.py b/videoarchiver/core/lifecycle.py index 5e52213..32f46ed 100644 --- a/videoarchiver/core/lifecycle.py +++ b/videoarchiver/core/lifecycle.py @@ -7,8 +7,8 @@ from typing import Optional, Dict, Any, Set, List, Callable, TypedDict, ClassVar from enum import Enum, auto from datetime import datetime -from .cleanup import cleanup_resources, force_cleanup_resources -from ..utils.exceptions import ( +from videoarchiver.core.cleanup import cleanup_resources, force_cleanup_resources +from videoarchiver.utils.exceptions import ( VideoArchiverError, ErrorContext, ErrorSeverity, diff --git a/videoarchiver/core/response_handler.py b/videoarchiver/core/response_handler.py index d1a9fdd..4a8b9f2 100644 --- a/videoarchiver/core/response_handler.py +++ b/videoarchiver/core/response_handler.py @@ -7,7 +7,7 @@ from datetime import datetime import discord from redbot.core.commands import Context -from ..utils.exceptions import ErrorSeverity +from videoarchiver.utils.exceptions import ErrorSeverity logger = logging.getLogger("VideoArchiver") diff --git a/videoarchiver/core/settings.py b/videoarchiver/core/settings.py index 544fc2c..0bf9c3f 100644 --- a/videoarchiver/core/settings.py +++ b/videoarchiver/core/settings.py @@ -4,7 +4,7 @@ from typing import Dict, Any, List, Optional, Union, TypedDict, ClassVar from dataclasses import dataclass, field from enum import Enum, auto -from ..utils.exceptions import ( +from videoarchiver.utils.exceptions import ( ConfigurationError, ErrorContext, ErrorSeverity diff --git a/videoarchiver/processor/cleanup_manager.py b/videoarchiver/processor/cleanup_manager.py index 6e0d330..e4667c4 100644 --- a/videoarchiver/processor/cleanup_manager.py +++ b/videoarchiver/processor/cleanup_manager.py @@ -18,9 +18,9 @@ from typing import ( ) from datetime import datetime, timedelta -from .queue_handler import QueueHandler -from ..ffmpeg.ffmpeg_manager import FFmpegManager -from ..utils.exceptions import CleanupError +from videoarchiver.processor.queue_handler import QueueHandler +from videoarchiver.ffmpeg.ffmpeg_manager import FFmpegManager +from videoarchiver.utils.exceptions import CleanupError logger = logging.getLogger("VideoArchiver") diff --git a/videoarchiver/processor/queue_processor.py b/videoarchiver/processor/queue_processor.py index 0292906..0e690b2 100644 --- a/videoarchiver/processor/queue_processor.py +++ b/videoarchiver/processor/queue_processor.py @@ -7,11 +7,11 @@ from typing import List, Optional, Dict, Any, Set, Union, TypedDict, ClassVar from datetime import datetime import discord -from ..queue.models import QueueItem -from ..queue.manager import EnhancedVideoQueueManager -from .constants import REACTIONS -from .url_extractor import URLMetadata -from ..utils.exceptions import QueueProcessingError +from videoarchiver.queue.models import QueueItem +from videoarchiver.queue.manager import EnhancedVideoQueueManager +from videoarchiver.processor.constants import REACTIONS +from videoarchiver.processor.url_extractor import URLMetadata +from videoarchiver.utils.exceptions import QueueProcessingError logger = logging.getLogger("VideoArchiver") diff --git a/videoarchiver/processor/status_display.py b/videoarchiver/processor/status_display.py index 278f6fe..a921247 100644 --- a/videoarchiver/processor/status_display.py +++ b/videoarchiver/processor/status_display.py @@ -7,7 +7,7 @@ from datetime import datetime from typing import Dict, Any, List, Optional, Callable, TypeVar, Union, TypedDict, ClassVar, Tuple import discord -from ..utils.exceptions import DisplayError +from videoarchiver.utils.exceptions import DisplayError logger = logging.getLogger("VideoArchiver")