From 388d22052606f091fffd33522607c796336b6c47 Mon Sep 17 00:00:00 2001 From: vsv Date: Tue, 17 Jan 2017 11:42:29 +0300 Subject: [PATCH] Issue #1896: Add a script for modules inspection --- src/PythonAPI/CMakeLists.txt | 1 + src/PythonAPI/initConfig.py | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 src/PythonAPI/initConfig.py diff --git a/src/PythonAPI/CMakeLists.txt b/src/PythonAPI/CMakeLists.txt index 1b837d2ac..f68c87258 100644 --- a/src/PythonAPI/CMakeLists.txt +++ b/src/PythonAPI/CMakeLists.txt @@ -3,6 +3,7 @@ INSTALL(DIRECTORY geom model examples DESTINATION ${SHAPER_INSTALL_PYTHON_API}) INSTALL(FILES __init__.py DESTINATION ${SHAPER_INSTALL_PYTHON_API}) INSTALL(FILES __init__.py DESTINATION ${_pydir}/salome) +INSTALL(FILES initConfig.py DESTINATION ${SHAPER_INSTALL_PYTHON_API}) # --------- Unit tests ----------- INCLUDE(UnitTest) diff --git a/src/PythonAPI/initConfig.py b/src/PythonAPI/initConfig.py new file mode 100644 index 000000000..6e130ee0c --- /dev/null +++ b/src/PythonAPI/initConfig.py @@ -0,0 +1,13 @@ +"""This script inspects existing modules in SALOME and registrs them in +Module reader +""" + +import salome +import SALOME_ModuleCatalog +import ConfigAPI + +obj = salome.naming_service.Resolve('Kernel/ModulCatalog') +catalog = obj._narrow(SALOME_ModuleCatalog.ModuleCatalog) +aCorbaModules = catalog.GetComponentList() +for aName in aCorbaModules: + ConfigAPI.Config_ModuleReader.addDependencyModule(aName) -- 2.39.2