-
-
Notifications
You must be signed in to change notification settings - Fork 665
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
Lazily register for custom UIA properties and annotations #14248
Lazily register for custom UIA properties and annotations #14248
Conversation
See test results for failed build of commit 4e089fd1eb |
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.
These changes generally look good.
I'm concerned that removing get
is an API breakage.
If this is an API breakage, please follow the steps in devDocs/deprecations.md
to retain the deprecated methods if possible,
It may be possible to make the get
functions return the class itself?
Rather than initializing these implicitly, would it be possible to explicitly initialize these through an initializer being called? |
Is this PR abandoned? |
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.
I think this is fine to be merged, now that we have reached a breaking release.
Link to issue number:
None. Related to #12971 and #12843 comment
Summary of the issue:
Registering for custom UIA annotations and properties can only be done after
NVDAHelper
is initialized. In normal usage this is not a problem, however since registration occurs on import it is impossible to write unit tests or generate developer documentation for anything which imports fromNVDAObjects.UIA
. The error when generating developer documentation is as follows:Description of user facing changes
This should affect only developers - classes holding custom UIA properties and annotations are no longer singletons.
Description of development approach
Rather than making
UIAHandler.customAnnotations.CustomAnnotationTypesCommon
,UIAHandler.customProps.CustomPropertiesCommon
and the Excel specific annotations and properties singletons, we now register for custom properties and annotations first time they're needed rather than on import. To avoid unnecessary interactions with UIA registered id's are cached for lifetime of NVDA. While at it I've also moved imports below the module level docstring since that is the more standard place.Testing strategy:
NVDAHelper
are shownKnown issues with pull request:
None known
Change log entries:
For Developers:
UIAHandler.customAnnotations.CustomAnnotationTypesCommon
,UIAHandler.customProps.CustomPropertiesCommon
,NVDAObjects.UIA.excel.ExcelCustomProperties
andNVDAObjects.UIA.excel.ExcelCustomAnnotationTypes
are no longer singletons - theirget
method has been removed.Code Review Checklist: