Skip to content

Update subtitle_merger.py - #3

Open
itashia wants to merge 1 commit into
ixabolfazl:mainfrom
itashia:patch-2
Open

Update subtitle_merger.py#3
itashia wants to merge 1 commit into
ixabolfazl:mainfrom
itashia:patch-2

Conversation

@itashia

@itashia itashia commented Jun 8, 2025

Copy link
Copy Markdown

refactor: improve code quality with typing, modularity, and advanced logging

  • Added type hints to all methods and parameters for better readability and IDE support
  • Enhanced temporary file management using context managers (enter, exit)
  • Specialized handling of temporary files for robustness
  • Replaced print statements with Python logging module for leveled error/info messages
  • Implemented parallel processing with ThreadPoolExecutor for concurrent UTF-8 file conversion
  • Modularized code by splitting into smaller single-responsibility methods
  • Introduced SubtitleInfo class for metadata management
  • Added from_directory method to process all files in a directory
  • Improved ASS file header details
  • Better error and exception handling throughout
  • Replaced string-based paths with pathlib.Path for improved path management
  • Added comprehensive docstrings and clearer comments for complex sections

refactor: improve code quality with typing, modularity, and advanced logging

- Added type hints to all methods and parameters for better readability and IDE support
- Enhanced temporary file management using context managers (__enter__, __exit__)
- Specialized handling of temporary files for robustness
- Replaced print statements with Python logging module for leveled error/info messages
- Implemented parallel processing with ThreadPoolExecutor for concurrent UTF-8 file conversion
- Modularized code by splitting into smaller single-responsibility methods
- Introduced SubtitleInfo class for metadata management
- Added from_directory method to process all files in a directory
- Improved ASS file header details
- Better error and exception handling throughout
- Replaced string-based paths with pathlib.Path for improved path management
- Added comprehensive docstrings and clearer comments for complex sections
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant