-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SubModules: Switch WebModules package to
webModulesSM
for easier te…
…sting
- Loading branch information
1 parent
edc58eb
commit f4d9f8c
Showing
2 changed files
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# -*- coding: utf-8 -*- | ||
|
||
# This file is part of Web Access for NVDA. | ||
# Copyright (C) 2015-2021 Accessolutions (http://accessolutions.fr) | ||
# Copyright (C) 2015-2024 Accessolutions (http://accessolutions.fr) | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
@@ -22,7 +22,7 @@ | |
"""Web Module data store.""" | ||
|
||
|
||
__version__ = "2021.03.12" | ||
__version__ = "2024.07.25" | ||
__author__ = "Julien Cochuyt <[email protected]>" | ||
|
||
|
||
|
@@ -56,7 +56,7 @@ | |
|
||
class WebModuleJsonFileDataStore(Store): | ||
|
||
def __init__(self, name, basePath, dirName="webModulesMC"): | ||
def __init__(self, name, basePath, dirName="webModulesSM"): | ||
super().__init__(name=name) | ||
self.basePath = basePath | ||
self.path = os.path.join(basePath, dirName) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# -*- coding: utf-8 -*- | ||
|
||
# This file is part of Web Access for NVDA. | ||
# Copyright (C) 2015-2021 Accessolutions (http://accessolutions.fr) | ||
# Copyright (C) 2015-2024 Accessolutions (http://accessolutions.fr) | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
@@ -22,7 +22,7 @@ | |
"""Web Access GUI.""" | ||
|
||
|
||
__version__ = "2021.03.13" | ||
__version__ = "2024.07.25" | ||
__author__ = "Julien Cochuyt <[email protected]>" | ||
|
||
|
||
|
@@ -440,9 +440,9 @@ def getWebModuleFactory(name): | |
mod = None | ||
try: | ||
import importlib | ||
mod = importlib.import_module("webModulesMC.{}".format(name), package="webModulesMC") | ||
mod = importlib.import_module("webModulesSM.{}".format(name), package="webModulesSM") | ||
except Exception: | ||
log.exception("Could not import custom module webModulesMC.{}".format(name)) | ||
log.exception("Could not import custom module webModulesSM.{}".format(name)) | ||
if not mod: | ||
return WebModule | ||
apiVersion = getattr(mod, "API_VERSION", None) | ||
|
@@ -464,7 +464,7 @@ def getWebModuleFactory(name): | |
|
||
def hasCustomModule(name): | ||
return any( | ||
importer.find_module("webModulesMC.{}".format(name)) | ||
importer.find_module("webModulesSM.{}".format(name)) | ||
for importer in _importers | ||
if importer | ||
) | ||
|
@@ -475,12 +475,12 @@ def initialize(): | |
global _importers | ||
|
||
import imp | ||
webModules = imp.new_module("webModulesMC") | ||
webModules = imp.new_module("webModulesSM") | ||
webModules.__path__ = list() | ||
import sys | ||
sys.modules["webModulesMC"] = webModules | ||
sys.modules["webModulesSM"] = webModules | ||
addDirsToPythonPackagePath(webModules) | ||
_importers = list(pkgutil.iter_importers("webModulesMC.__init__")) | ||
_importers = list(pkgutil.iter_importers("webModulesSM.__init__")) | ||
|
||
from ..store.webModule import WebModuleStore | ||
store = WebModuleStore() | ||
|
@@ -489,7 +489,7 @@ def initialize(): | |
def terminate(): | ||
import sys | ||
try: | ||
del sys.modules["webModulesMC"] | ||
del sys.modules["webModulesSM"] | ||
except KeyError: | ||
pass | ||
_importers = None |