Skip to content

In DynamicNVDAObjectType.__call__, move code that governs fetching of app module and global plugin overlay classes into their own methods on the NVDAObject class and add a variable on the NVDAObject class that decides if NVDAObjectInit should be called or not #18242

@Emil-18

Description

@Emil-18

Related issues, PRs or discussions

None.

What is the current state of the codebase?

In DynamicNVDAObjectType.call, the fetching of overlay classes for app modules and global plugins are done directly in the call method.

Why are changes required?

In the current implementation, there is no way for an add-on author to create an API class and garantee that no unwanted overlay classes gets included as well without setting the metaclass to a new class and writing the call method from scratch. For example, if an add-on creates a new API class classA, and if another add-on includes an overlay class classB that overwrites properties that classA needs, the author of classA can't decide to not include classB. I also think that an API class should be able to decide if its appModule can run the NVDAObjectInit function on it.

What technical changes are required?

Move the code that governs the fetching of app module and global plugin overlay classes into two seperet methods on the NVDAObject class. I think they should be called findAppModuleClasses and findGlobalPluginClasses. Add a variable on the NVDAObject class that decides if NVDAObjectInit should be called or not.

Are the proposed technical changes API breaking?

No.

Are there potential risks or issues with the proposed implementation?

No.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions