Commit Graph

267 Commits

Author SHA1 Message Date
pacnpal
ca5571750f fix(processor): add fallback to absolute imports in queue_processor 2024-11-17 21:56:25 +00:00
pacnpal
d1b5e4156a fix(core): simplify relative import in core/__init__.py 2024-11-17 21:53:23 +00:00
pacnpal
3fed7a7a6c fix(core): add fallback to absolute imports in component_manager 2024-11-17 21:52:53 +00:00
pacnpal
91e34a6639 fix(processor): correct relative import path for progress_tracker 2024-11-17 21:47:26 +00:00
pacnpal
d9fc0f360f Identified cyclic dependency between processor and utils packages
Created new shared package with centralized progress tracking:

videoarchiver/shared/progress.py
videoarchiver/shared/init.py
Refactored compression_manager.py to use shared progress module instead of importing from processor

Architecture improvements:

Better separation of concerns
Eliminated cyclic dependencies
Centralized progress tracking
Improved maintainability
2024-11-17 21:40:50 +00:00
pacnpal
b8f29341ce fixes 2024-11-17 21:33:12 +00:00
pacnpal
439cf5ff07 Using TYPE_CHECKING for type hints
Moving runtime imports to appropriate locations
Using string literal type annotations
Importing shared utilities through the utils package
2024-11-17 21:24:49 +00:00
pacnpal
e997c6f6b9 Created a proper dependency hierarchy:
core/types.py - Contains shared interfaces and types
queue/types.py - Contains queue-specific types
Components now depend on interfaces rather than concrete implementations
Broke cyclic dependencies:

Removed direct imports between queue_processor.py and manager.py
Removed circular dependencies between core and processor modules
Components now communicate through well-defined interfaces
Improved architecture:

Clear separation of concerns
Better dependency management
More maintainable and testable code
Proper use of dependency injection
2024-11-17 21:11:00 +00:00
pacnpal
063258513e Creating a shared types module (types.py) for common types and interfaces
Updating queue_processor.py to use the shared types
Updating manager.py to use the correct imports and shared types
The cyclic dependency has been resolved by:

Moving shared types to a separate module
Having queue_processor.py only import from shared modules
Having manager.py use the QueueProcessor from queue/processor.py
2024-11-17 20:58:14 +00:00
pacnpal
aa61c738a2 fixed more imports 2024-11-17 20:46:22 +00:00
pacnpal
4fc2afc446 fixed some more imports 2024-11-17 20:43:55 +00:00
pacnpal
ad8a4e3dbe import fix 2024-11-17 20:39:12 +00:00
pacnpal
1fdabee127 Fix: Update processor/__init__.py to use relative imports to resolve ModuleNotFoundError 2024-11-17 20:20:39 +00:00
pacnpal
97dd6d72f2 loads of import fixes 2024-11-17 19:47:18 +00:00
pacnpal
f71e174c0d Fixed incorrect import paths in videoarchiver/utils/__init__.py by removing redundant .utils prefix 2024-11-17 16:27:29 +00:00
pacnpal
b1e3f0c9d6 fixed imports hopefully 2024-11-17 16:22:22 +00:00
pacnpal
3d4d385559 fixed imports hopefully 2024-11-17 16:21:17 +00:00
pacnpal
074b462a1b Updated videoarchiver/__init__.py to include all relevant classes from subdirectories 2024-11-17 16:15:27 +00:00
pacnpal
0db1f31f8f Updated videoarchiver/__init__.py to use relative imports for Red-DiscordBot best practices 2024-11-17 16:11:42 +00:00
pacnpal
29606683d4 Updated videoarchiver/__init__.py to include all imports from cog subdirectories 2024-11-17 16:10:20 +00:00
pacnpal
825ac0ce2c Updated videoarchiver/queue/__init__.py to import all modules from queue and cleaners subdirectory 2024-11-17 16:07:17 +00:00
pacnpal
62c97f0b01 Converted all 'from videoarchiver.' imports to relative imports 2024-11-17 16:05:12 +00:00
pacnpal
c830be2841 videoarchiver/config/validation_manager.py
videoarchiver/config/role_manager.py
videoarchiver/database/connection_manager.py
videoarchiver/database/schema_manager.py
videoarchiver/queue/cleaners/tracking_cleaner.py
videoarchiver/exceptions.py
videoarchiver/processor.py
videoarchiver/commands.py
videoarchiver/update_checker.py
videoarchiver/utils/path_manager.py
videoarchiver/utils/file_ops.py
videoarchiver/processor/message_validator.py
videoarchiver/utils/download_manager.py
2024-11-17 06:12:41 +00:00
pacnpal
973714e281 fix 2024-11-17 03:15:35 +00:00
pacnpal
a5c3101d78 1 2024-11-17 03:12:47 +00:00
pacnpal
4fe45458bf 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
2024-11-17 02:58:53 +00:00
pacnpal
0d67bcc4a7 lol 2024-11-17 02:10:22 +00:00
pacnpal
247381fc8a 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
2024-11-17 01:29:00 +00:00
pacnpal
b10722f05b Moved progress_tracker.py to utils/ as the single source of truth
Implemented proper singleton pattern in ProgressTracker class
Created shared instance in utils/init.py
Updated all files to use relative imports correctly
Removed duplicate progress_tracker.py from processor/
Fixed circular imports by removing ProgressTracker from processor.py re-exports
2024-11-17 01:24:03 +00:00
pacnpal
98ed3dfc6a lol 2024-11-17 01:17:44 +00:00
pacnpal
2557978cf3 lol 2024-11-17 01:03:45 +00:00
pacnpal
d2576df988 ok 2024-11-17 00:25:34 +00:00
pacnpal
c9e24436bb ok 2024-11-17 00:23:15 +00:00
pacnpal
3a5df65661 Add __init__.py to queue/cleaners:
- Export cleaner classes
- Add proper docstring
- Add __all__ list
2024-11-17 00:20:38 +00:00
pacnpal
dfc2e8dad5 Update root __init__.py:
- Force reload of all command modules
- Remove modules from sys.modules before importing
- Reload utils module after importing
- Ensure proper exception imports
2024-11-17 00:13:29 +00:00
pacnpal
824b8870e1 Update root __init__.py:
- Add module reloading to ensure exceptions are available
- Import and re-export all necessary exceptions
- Maintain existing setup and teardown functions
- Add version information
- Update __all__ list with all exports
2024-11-17 00:07:43 +00:00
pacnpal
e08ec2fa84 Update utils/__init__.py:
- Add CommandError and EventError to imports and __all__
- Add CogError to imports and __all__
- Add TrackingError to imports and __all__
- Add helper functions for error handling and progress tracking
- Add version information and shared instances
2024-11-17 00:06:09 +00:00
pacnpal
99fa0864f2 Fix exceptions.py:
- Add CogError with proper details
- Add missing error classes to __all__
- Fix formatting and spacing
- Add proper docstrings
- Fix error class inheritance
2024-11-16 22:56:18 +00:00
pacnpal
7c898e5aee Fix component_manager.py imports:
- Replace string-based imports with direct imports
- Update CORE_COMPONENTS to use actual classes
- Remove dynamic import logic
- Fix relative imports
2024-11-16 22:49:57 +00:00
pacnpal
d2d07c6bf6 Fix import issues:
- Add __all__ list to exceptions.py
- Fix absolute imports to use relative imports
- Fix duplicate imports
- Fix truncated code in download_core.py
- Add missing imports and type hints
- Fix indentation and formatting issues
2024-11-16 22:46:29 +00:00
pacnpal
dac21f2fcd fixed 2024-11-16 22:32:08 +00:00
pacnpal
b7d99490cf refactor: Clean up imports in settings_commands.py
- Remove unused imports (Union, List)
- Add redbot.core.commands import
- Move core.settings import to top of local imports
- Group imports by standard library, discord, and local modules
- Improve import organization for better readability
2024-11-16 22:13:53 +00:00
pacnpal
febfaaeea5 refactor: Clean up imports in database_commands.py
- Remove unused imports (Tuple, Union)
- Add redbot.core.commands import
- Group imports by standard library, discord, and local modules
- Improve import organization for better readability
2024-11-16 22:10:28 +00:00
pacnpal
6493356670 fix: Improve imports in archiver_commands.py
- Add missing redbot.core.commands import
- Organize imports into standard library, discord, and local groups
- Fix CommandContext.__aenter__ to use self.ctx instead of global ctx
2024-11-16 22:00:22 +00:00
pacnpal
b6e397fb95 refactor: Clean up cleanup.py
- Remove duplicate docstring
- Remove unused signal import
- Reorganize imports in a more logical order
- Group standard library imports together
2024-11-16 21:59:13 +00:00
pacnpal
202a909057 fix: Add missing imports in guild.py
- Add pathlib.Path import for download_path usage
- Add Dict, Any, Optional from typing for better type hints
- Organize imports according to best practices
2024-11-16 21:57:26 +00:00
pacnpal
6f545ef7fd Improve database connection management
- Add proper error handling with DatabaseError
- Add proper error context support
- Add better connection state management
- Add proper type hints
- Add proper docstrings
- Add better error recovery
- Add proper error context creation
- Add better metrics tracking
- Add proper status reporting
- Add better connection validation
- Add proper logging
- Add better error messages
- Add proper transaction timing
- Add better pool management
2024-11-16 21:22:00 +00:00
pacnpal
775781b325 Improve command handling with better error handling, type hints, and organization
- Add proper error handling with CommandError
- Add proper error context support
- Add better command organization
- Add proper type hints
- Add proper docstrings
- Add better error recovery
- Add proper error context creation
- Add better response handling
- Add proper validation
- Add better logging
- Add proper response types
- Add better error messages
- Add proper status reporting
- Add new status commands
2024-11-16 21:13:08 +00:00
pacnpal
dd467df5fc Created a new constants.py file to store the REACTIONS dictionary
Updated all files to import REACTIONS from constants.py instead of reactions.py:
queue_processor.py
message_handler.py
reactions.py (now only contains reaction handling functions)
events.py (now imports REACTIONS from constants.py and handle_archived_reaction from reactions.py)
core.py
queue_handler.py
processor/init.py
2024-11-16 18:12:35 +00:00
pacnpal
8fe8ba0766 fixed 2024-11-16 18:01:08 +00:00