Add style filtering features for ASS subtitles - #35
Merged
Conversation
- Introduced `include_styles` and `exclude_styles` options in the `Subtitle` class for advanced filtering. - Added support for `only_default_style` flag to target "Default" styles specifically. - Expanded tests to verify style filtering logic and edge cases. - Implemented CLI commands for listing unique styles and improved export behavior with style filters. - Updated README with detailed examples for style filtering and CLI enhancements.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #35 +/- ##
==========================================
+ Coverage 99.38% 99.60% +0.21%
==========================================
Files 5 5
Lines 163 254 +91
==========================================
+ Hits 162 253 +91
Misses 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Adjusted `requires-python` to `>=3.9` in `uv.lock` for newer Python versions. - Updated resolution markers for compatibility with Python 3.14. - Removed support for Python <3.9 across dependencies. - Cleaned up outdated wheel links and redundant dependencies.
- Removed `main` branch trigger from `python-docs.yml`. - Added explicit `master` branch triggers to `python-linter.yml` and `python-test.yml`.
- Introduced tests for `--only-default`, `--include-styles`, and `--exclude-styles` export options. - Verified mutually exclusive style flag behavior with test cases. - Added tests for `styles` command output in simple list and table formats. - Expanded error handling tests for permission errors, unexpected runtime errors, and non-existent files in both export and styles commands. - Updated test fixtures to include `sub_with_styles` file.
…es` commands - Added tests to verify error handling for `FileNotFoundError` in `export` and `styles` commands. - Simulated missing file scenarios using `monkeypatch` to mock `OriginalSubtitle` initialization failure. - Validated CLI outputs for appropriate error messages.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Changes
include_stylesandexclude_stylesoptions to filter subtitles by style.only_default_styleflag to filter specifically for "Default" styles.