nvda
d025cd1a - UIA handler reorganization: gather UIA modules into a public "UIAHandler" package (#13089)

Commit
4 years ago
UIA handler reorganization: gather UIA modules into a public "UIAHandler" package (#13089) Closes #10916 Summary of the issue: The bulk of UIA support code resides in a private UIA handler module (_UIAHandler.py). It was done that way to support Windows releases without usable UIA implementations such as Windows XP. Also, other UIA support modules such as custom annotations were added to support specific UIA scenarios. Commits: * UIA handler reorg: move contents of private UIA handler module to the public module. Re #10916. When UIA handler first appeared in 2008, it was housed in UIAHandler.py, the public-facing module. In 2011, a private _UIAHandler.py module was created to handle lack of usable UIA implementation in Windows XP, Server 2003, and older releases of Windows Vista and Server 2008. Since NVDA 2017.4, Windows 7 SP1 and Server 2008 R2 SP1 are required, meaning a usable UIA implementation is available. For backward compatibility, the private/public split was kept. Recognizing maintenance issues with private/public module, a reorganization effort was proposed in 2020, with the work taking place in 2021. This effort aims to combine private and public UIA handler modules under one file, as well as bring UIA support modules under a package, similar to IAccessible handler reorganization in 2021. As a first step, contents of private UIA handler module is now part of public UIA handler, with other NVDA modules importing the private module to be edited to use the public module (later commit). Module header is based on a combination of both public and private modules. Combined module contents: 1. Module header 2. Public module contents (UIA handler object definition, init/terminate methods) placed between bulk of private module content and UIA debug check function * NVDAObjects/UIA/Excel: _UIAHandler -> UIAHandler. Re #10916 * UIA handler: remove private module. Re #10916. With the contents of the private module moved to public UIA handler module, there is no need to keep the private module around anymore. Therefore remove the private module. * UIA handler reorganization: convert UIA handler module into a package. Re #10916. Reorganization: convert UIA handler from a module to a package (source/UIAHandler/__init__.py). The new UIA handler package will be home of various UIA related modules such as UIA custom properties and annotations support. * UIA handler package: create a package version of UIA constants, custom props, and custom annotations modules. Re #10916 * UIA handler reorg: change imports. Re #10916. Import changes: * _UIAConstants -> UIAHandler.constants * _UIACustomAnnotations -> UIAHandler.customAnnocations * _UIACustomProps -> UIAHandler.customProps * UIA handler reorg: transfer and edit UIA utilities module into UIA handler. Re #10916. Transfer UIA utils module to UIA handler package, along with editing UIA constants module import to be relative import. * UIA handler reorg: remove private UIA constants, custom annotations, and custom props modules as contents were transferred to UIA handler package and renamed. Re #10916 * UIA handler reorg: UIAUtils -> UIAHandler.utils. Re #10916 * UIA handler reorg: remove UIA utilities module as it is now part of UIA handler and was renamed to utils. Re #10916 * UIA handler reorg: transfer UIA browse mode module to UIA handler and rename it to browseMode.py. Re #10916 * UIA handler reorg: UIABrowseMode -> UIAHandler.browseMode. Re #10916 * UIA handler reorg: remove UIA browse mode module as it is transferred to UIA handler package and renamed. Re #10916 * UIA handler reorg: fix attribute names. Re #10916 * UIA handler reorg: lint. Re #10916. In addition to resolving lint issues (Flake8), linted UIAHandler.handler.getNearistWindowHandle method. * UIA handler reorg: remove UIAHandler.utils.getUIATextAttributeValueFromRange import from UIAHandler.browseMode module as it is not used. Re #10916. According to Flake8, UIAHandler.utils.getUIATextAttributeValueFromRange is imported but unused in UIAHandler.browseMode.py, therefore remove this import. * NVDAObjects/UIA/word document: remove UIAHandler.utils import as no attribute from that module is used. Re #10916. Comment from Lukasz Golonka: since word document module (UIA) imports UIAHandler.utils but no attribute is used, remove the import altogether. * update changes Co-authored-by: buddsean <sean@nvaccess.org>
Author
Parents
Loading