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
This commit is contained in:
pacnpal
2024-11-17 02:58:53 +00:00
parent 0d67bcc4a7
commit 4fe45458bf
16 changed files with 62 additions and 62 deletions

View File

@@ -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

View File

@@ -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")

View File

@@ -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

View File

@@ -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")

View File

@@ -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

View File

@@ -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")

View File

@@ -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")

View File

@@ -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")

View File

@@ -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")

View File

@@ -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")

View File

@@ -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,

View File

@@ -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")

View File

@@ -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

View File

@@ -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")

View File

@@ -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")

View File

@@ -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")