Skip to content

Commit

Permalink
Fixup recent change
Browse files Browse the repository at this point in the history
Change-Id: I70f9c556643bd1221f4f9c3b861e5f5b3d658922
  • Loading branch information
LarsMichelsen committed Nov 9, 2023
1 parent 263592b commit 5ad9faf
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions cmk/gui/main_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

@contextmanager
def suppress_module_not_found(name: str) -> Iterator[None]:
"""Specialised to contextlib.supress with additional module name matching"""
"""Specialized to contextlib.supress with additional module name matching"""
try:
yield
except ModuleNotFoundError as e:
Expand All @@ -31,24 +31,23 @@ def suppress_module_not_found(name: str) -> Iterator[None]:
# The following imports trigger loading of built-in main modules.
# Note: They are loaded once more in `_import_main_module_plugins()` and
# possibly a third time over the plugin discovery mechanism.
with suppress_module_not_found("cmk.gui.plugins.main_modules"):
import cmk.gui.plugins.main_modules # pylint: disable=no-name-in-module,unused-import,cmk-module-layer-violation
import cmk.gui.plugins.main_modules # pylint: disable=cmk-module-layer-violation

with suppress_module_not_found("cmk.gui.raw.plugins.main_modules"):
with suppress_module_not_found("cmk.gui.raw"):
import cmk.gui.raw.plugins.main_modules # pylint: disable=unused-import,cmk-module-layer-violation

with suppress_module_not_found("cmk.gui.cee.plugins.main_modules"):
with suppress_module_not_found("cmk.gui.cee"):
import cmk.gui.cee.plugins.main_modules # pylint: disable=no-name-in-module,unused-import,cmk-module-layer-violation

with suppress_module_not_found("cmk.gui.cme.registration"):
with suppress_module_not_found("cmk.gui.cme"):
import cmk.gui.cme.registration # pylint: disable=no-name-in-module,cmk-module-layer-violation

cmk.gui.cme.registration.register()

with suppress_module_not_found("cmk.gui.cce.plugins.main_modules"):
with suppress_module_not_found("cmk.gui.cce"):
import cmk.gui.cce.plugins.main_modules # noqa: F401 # pylint: disable=no-name-in-module,unused-import,cmk-module-layer-violation

with suppress_module_not_found("cmk.gui.cse.plugins.main_modules"):
with suppress_module_not_found("cmk.gui.cse"):
import cmk.gui.cse.plugins.main_modules # noqa: F401 # pylint: disable=no-name-in-module,unused-import,cmk-module-layer-violation


Expand Down

0 comments on commit 5ad9faf

Please sign in to comment.