-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Ellipsis] Improve Regex Error Handling and Code Cleanup #102
Conversation
This commit introduces the `--exclude-titles` argument to the aw-watcher-window module, allowing users to specify a list of window titles or regular expression patterns to exclude from tracking. This new feature is designed to complement the existing `--exclude-title` flag, providing enhanced flexibility for users who need to exclude multiple window titles without breaking compatibility with existing configurations. Key Changes: - Added the `--exclude-titles` argument to the argparse configuration in `config.py`, enabling the specification of multiple exclusion patterns. - Updated the `heartbeat_loop` function in `main.py` to support both `exclude_title` and `exclude_titles`, with `exclude_titles` allowing for an array of titles to be excluded. - Utilized the `re` module for regex pattern matching against window titles, ensuring case-insensitive comparisons. This enhancement ensures that users can now more precisely control which window titles are excluded from tracking, making the aw-watcher-window module more versatile and user-friendly.
Co-authored-by: Erik Bjäreholt <[email protected]>
…tles` feature for enhanced window title exclusion);
@@ -92,10 +91,10 @@ | |||
poll_time=args.poll_time, | |||
strategy=args.strategy, | |||
exclude_title=args.exclude_title, | |||
exclude_titles=[try: re.compile(title, re.IGNORECASE) except re.error: re.compile(re.escape(title), re.IGNORECASE) for title in args.exclude_titles] |
Check failure
Code scanning / CodeQL
Syntax error Error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol, Ellipsis really butchered this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @ErikBjare , looking into what happened here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ErikBjare you can get much higher quality out of Ellipsis by adding a Dockerfile and build/test commands so that it can verify its changes - see docs here https://docs.ellipsis.dev/build. We have a playground as well where you can test it out at https://app.ellipsis.dev/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
happy to help get you onboarded to that 🙏
This change addresses review comments left by @ErikBjare on PR #99: [Feature] Add
exclude_titles
feature for enhanced window title exclusionSummary:
Enhanced regex error handling in
heartbeat_loop
and cleaned up code in/aw_watcher_window/main.py
.Key points:
heartbeat_loop
in/aw_watcher_window/main.py
to handle regex errors.You can configure Ellipsis to address comments with a direct commit or a side PR, see docs.
Something look wrong?: If this Pull Request doesn't address the comments left on the above pull request, create a new PR review with more details. For more information, check the documentation.
Generated with ❤️ by ellipsis.dev