|
1 | 1 | # A part of NonVisual Desktop Access (NVDA) |
2 | 2 | # Copyright (C) 2012-2022 Rui Batista, NV Access Limited, Noelia Ruiz Martínez, |
3 | | -# Joseph Lee, Babbage B.V., Arnold Loubriat, Łukasz Golonka |
| 3 | +# Joseph Lee, Babbage B.V., Arnold Loubriat, Łukasz Golonka, Leonard de Ruijter |
4 | 4 | # This file is covered by the GNU General Public License. |
5 | 5 | # See the file COPYING for more details. |
6 | 6 |
|
|
21 | 21 | import zipfile |
22 | 22 | from configobj import ConfigObj |
23 | 23 | from configobj.validate import Validator |
24 | | -from .packaging import initializeModulePackagePaths |
| 24 | +from .packaging import initializeAddonsNamespacePackage, initializeModulePackagePaths |
25 | 25 | import config |
26 | 26 | import languageHandler |
27 | 27 | from logHandler import log |
|
30 | 30 | from . import addonVersionCheck |
31 | 31 | from .addonVersionCheck import isAddonCompatible |
32 | 32 | import extensionPoints |
| 33 | +from types import ModuleType |
33 | 34 |
|
34 | 35 |
|
35 | 36 | MANIFEST_FILENAME = "manifest.ini" |
@@ -168,6 +169,7 @@ def initialize(): |
168 | 169 | getAvailableAddons(refresh=True, isFirstLoad=True) |
169 | 170 | state.cleanupRemovedDisabledAddons() |
170 | 171 | state.save() |
| 172 | + initializeAddonsNamespacePackage() |
171 | 173 | initializeModulePackagePaths() |
172 | 174 |
|
173 | 175 |
|
@@ -395,16 +397,16 @@ def completeRemove(self,runUninstallTask=True): |
395 | 397 | _blockedAddons.discard(self.name) |
396 | 398 | state.save() |
397 | 399 |
|
398 | | - def addToPackagePath(self, package): |
| 400 | + def addToPackagePath(self, package: ModuleType): |
399 | 401 | """ Adds this L{Addon} extensions to the specific package path if those exist. |
400 | 402 | This allows the addon to "run" / be available because the package is able to search its path, |
401 | 403 | looking for particular modules. This is used by the following: |
402 | 404 | - `globalPlugins` |
403 | 405 | - `appModules` |
404 | 406 | - `synthDrivers` |
405 | 407 | - `brailleDisplayDrivers` |
| 408 | + - `visionEnhancementProviders` |
406 | 409 | @param package: the python module representing the package. |
407 | | - @type package: python module. |
408 | 410 | """ |
409 | 411 | # #3090: Ensure that we don't add disabled / blocked add-ons to package path. |
410 | 412 | # By returning here the addon does not "run"/ become active / registered. |
|
0 commit comments