mirror of
https://github.com/pacnpal/Pac-cogs.git
synced 2025-12-20 02:41:06 -05:00
fix(processor): add fallback to absolute imports in __init__.py
This commit is contained in:
@@ -3,16 +3,18 @@
|
|||||||
from typing import Dict, Any, Optional, Union, List, Tuple
|
from typing import Dict, Any, Optional, Union, List, Tuple
|
||||||
import discord # type: ignore
|
import discord # type: ignore
|
||||||
|
|
||||||
from .core import VideoProcessor
|
try:
|
||||||
from .constants import (
|
# Try relative imports first
|
||||||
|
from .core import VideoProcessor
|
||||||
|
from .constants import (
|
||||||
REACTIONS,
|
REACTIONS,
|
||||||
ReactionType,
|
ReactionType,
|
||||||
ReactionEmojis,
|
ReactionEmojis,
|
||||||
ProgressEmojis,
|
ProgressEmojis,
|
||||||
get_reaction,
|
get_reaction,
|
||||||
get_progress_emoji,
|
get_progress_emoji,
|
||||||
)
|
)
|
||||||
from .url_extractor import (
|
from .url_extractor import (
|
||||||
URLExtractor,
|
URLExtractor,
|
||||||
URLMetadata,
|
URLMetadata,
|
||||||
URLPattern,
|
URLPattern,
|
||||||
@@ -20,8 +22,8 @@ from .url_extractor import (
|
|||||||
URLPatternManager,
|
URLPatternManager,
|
||||||
URLValidator,
|
URLValidator,
|
||||||
URLMetadataExtractor,
|
URLMetadataExtractor,
|
||||||
)
|
)
|
||||||
from .message_validator import (
|
from .message_validator import (
|
||||||
MessageValidator,
|
MessageValidator,
|
||||||
ValidationContext,
|
ValidationContext,
|
||||||
ValidationRule,
|
ValidationRule,
|
||||||
@@ -31,16 +33,56 @@ from .message_validator import (
|
|||||||
ValidationStats,
|
ValidationStats,
|
||||||
ValidationCacheEntry,
|
ValidationCacheEntry,
|
||||||
ValidationError,
|
ValidationError,
|
||||||
)
|
)
|
||||||
from .message_handler import MessageHandler
|
from .message_handler import MessageHandler
|
||||||
from .queue_handler import QueueHandler
|
from .queue_handler import QueueHandler
|
||||||
from .reactions import (
|
from .reactions import (
|
||||||
handle_archived_reaction,
|
handle_archived_reaction,
|
||||||
update_queue_position_reaction,
|
update_queue_position_reaction,
|
||||||
update_progress_reaction,
|
update_progress_reaction,
|
||||||
update_download_progress_reaction,
|
update_download_progress_reaction,
|
||||||
)
|
)
|
||||||
from ..utils.progress_tracker import progress_tracker
|
from ..utils.progress_tracker import progress_tracker
|
||||||
|
except ImportError:
|
||||||
|
# Fall back to absolute imports if relative imports fail
|
||||||
|
from videoarchiver.processor.core import VideoProcessor
|
||||||
|
from videoarchiver.processor.constants import (
|
||||||
|
REACTIONS,
|
||||||
|
ReactionType,
|
||||||
|
ReactionEmojis,
|
||||||
|
ProgressEmojis,
|
||||||
|
get_reaction,
|
||||||
|
get_progress_emoji,
|
||||||
|
)
|
||||||
|
from videoarchiver.processor.url_extractor import (
|
||||||
|
URLExtractor,
|
||||||
|
URLMetadata,
|
||||||
|
URLPattern,
|
||||||
|
URLType,
|
||||||
|
URLPatternManager,
|
||||||
|
URLValidator,
|
||||||
|
URLMetadataExtractor,
|
||||||
|
)
|
||||||
|
from videoarchiver.processor.message_validator import (
|
||||||
|
MessageValidator,
|
||||||
|
ValidationContext,
|
||||||
|
ValidationRule,
|
||||||
|
ValidationResult,
|
||||||
|
ValidationRuleManager,
|
||||||
|
ValidationCache,
|
||||||
|
ValidationStats,
|
||||||
|
ValidationCacheEntry,
|
||||||
|
ValidationError,
|
||||||
|
)
|
||||||
|
from videoarchiver.processor.message_handler import MessageHandler
|
||||||
|
from videoarchiver.processor.queue_handler import QueueHandler
|
||||||
|
from videoarchiver.processor.reactions import (
|
||||||
|
handle_archived_reaction,
|
||||||
|
update_queue_position_reaction,
|
||||||
|
update_progress_reaction,
|
||||||
|
update_download_progress_reaction,
|
||||||
|
)
|
||||||
|
from videoarchiver.utils.progress_tracker import progress_tracker
|
||||||
|
|
||||||
# Export public classes and constants
|
# Export public classes and constants
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
|||||||
Reference in New Issue
Block a user