Skip to content
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

Require NVDA 2024.1 #164

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Require NVDA 2024.1 #164

wants to merge 11 commits into from

Conversation

josephsl
Copy link
Collaborator

Hi Chris,

This pull request enables full compliance with Python 3.11/NVDA 2024.1. I have edited the sources to use structural pattern matching, type hints, and other changes.

Thanks.

@ChrisDuffley
Copy link
Owner

ChrisDuffley commented Dec 26, 2024

Thank you very much for this. However, thanks to the commits pushed just now to main it seems we've run into a conflict issue with this PR (which I was afraid would happen). Sorry, I've had a lot going on and, while I did see this, I haven't had the chance to fully test with this PR yet.

What do you suggest?

Thanks and merry Christmas/happy holidays!

@josephsl
Copy link
Collaborator Author

josephsl commented Dec 26, 2024 via email

@ChrisDuffley
Copy link
Owner

Hi,
I think control keys enabled status has been around for a very long time actually. This was around for quite a while. I remember seeing it possibly earlier but not remembering now and am not about to reinstall 5.x to look.
Thanks!

@josephsl
Copy link
Collaborator Author

Hi,

As for control keys toggle status announcement, it can be done today so can be part of upcoming 25.01 (separate from this PR).

Thanks.

@ChrisDuffley
Copy link
Owner

Great, sounds good. SPL assistant then control+d should be fine for this as this is not a conflict since of course we're in a new gesture map.
Thanks!

@josephsl
Copy link
Collaborator Author

josephsl commented Dec 26, 2024 via email

@josephsl
Copy link
Collaborator Author

josephsl commented Dec 26, 2024 via email

@josephsl
Copy link
Collaborator Author

And with that, everything is done and ready for review. There are other things to be done after this PR is merged such as using speechOnDemand flag directly in script decorator (2024.1). Thanks.

As NVDA 2024.1 requirement is in effect, there is no need to import __future__ as NVDA is powered by Python 3.11.
Replace typing.Optional with type | None. This affects main app module and support modules. In some cases, only Optional was imported from typing, so this commit also removes this import.
…efinition to after ConfigHub class code.

Satisfying Flake8: move SPLConfig definition to after ConfigHub class definition and use new type union syntax (Optional[type] -> type | NOne).
Use the new union operator (type1 | type2) when returning profile flags (either a string or a set of strings). This also removes typing.Union import.
…ing overlay classes and object property overrides.

Replace if/elif statements in overlay class chooser and object init methods with structural pattern matching (match/case). The subject of the match is object window class name, with different cases representing different window class names for specific elements. Other statements that were part of the class name check were moved inside case statements - for example, obj.name check in object init method.
…s into match/case statements.

Use structural pattern matching when determining if track finder/column search/track range finder can be used. This makes the code more descriptive.
…atch/case statements.

Convert playlist analysis entry conditions into match/case statements to make the code more descriptive.
…ions into match/case statements.

Convert conditionals used to open columns explorer for Studio (0)/Track Tool (1)/Creator (2) from if statements to match/case to make the code more descriptive.
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.

NVDA 2024.1: switch to requiring 2024.1 or later Introduce annotations throughout add-on source code
2 participants