mirror of
https://github.com/pacnpal/Pac-cogs.git
synced 2025-12-20 10:51:05 -05:00
Database components with proper schema management FFmpeg components with process management Queue system with state management Processor components with proper handlers Utility components with shared instances Configuration components with validation Initialization sequence is now properly ordered: Config Manager initialization Path setup Database initialization FFmpeg setup Queue Manager initialization Video Processor setup Guild Components initialization Update Checker startup Queue Processing start Proper cleanup handling is in place: Component cleanup in reverse order Resource cleanup with timeouts Force cleanup for hung processes System-wide FFmpeg process cleanup Health monitoring is implemented for all components: Database connection monitoring Queue health checks Processor status tracking Component state validation
61 lines
1.4 KiB
Python
61 lines
1.4 KiB
Python
"""Utility functions and classes for VideoArchiver"""
|
|
|
|
from .file_ops import (
|
|
cleanup_downloads,
|
|
ensure_directory,
|
|
get_file_size,
|
|
is_valid_path,
|
|
safe_delete
|
|
)
|
|
from .file_deletion import FileDeleter
|
|
from .directory_manager import DirectoryManager
|
|
from .permission_manager import PermissionManager
|
|
from .download_manager import DownloadManager
|
|
from .compression_manager import CompressionManager
|
|
from .progress_tracker import ProgressTracker
|
|
from .path_manager import PathManager
|
|
from .exceptions import (
|
|
FileOperationError,
|
|
DirectoryError,
|
|
PermissionError,
|
|
DownloadError,
|
|
CompressionError,
|
|
TrackingError,
|
|
PathError
|
|
)
|
|
|
|
__all__ = [
|
|
# File Operations
|
|
'cleanup_downloads',
|
|
'ensure_directory',
|
|
'get_file_size',
|
|
'is_valid_path',
|
|
'safe_delete',
|
|
|
|
# Managers
|
|
'FileDeleter',
|
|
'DirectoryManager',
|
|
'PermissionManager',
|
|
'DownloadManager',
|
|
'CompressionManager',
|
|
'ProgressTracker',
|
|
'PathManager',
|
|
|
|
# Exceptions
|
|
'FileOperationError',
|
|
'DirectoryError',
|
|
'PermissionError',
|
|
'DownloadError',
|
|
'CompressionError',
|
|
'TrackingError',
|
|
'PathError'
|
|
]
|
|
|
|
# Initialize shared instances for module-level access
|
|
directory_manager = DirectoryManager()
|
|
permission_manager = PermissionManager()
|
|
download_manager = DownloadManager()
|
|
compression_manager = CompressionManager()
|
|
progress_tracker = ProgressTracker()
|
|
path_manager = PathManager()
|