]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1896: Add a script for modules inspection
authorvsv <vitaly.smetannikov@opencascade.com>
Tue, 17 Jan 2017 08:42:29 +0000 (11:42 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Tue, 17 Jan 2017 08:42:29 +0000 (11:42 +0300)
src/PythonAPI/CMakeLists.txt
src/PythonAPI/initConfig.py [new file with mode: 0644]

index 1b837d2acc7e0ff6569f24c7cf5d0c8e80d597c8..f68c872585210383296496a7122f21bb1a9d8a86 100644 (file)
@@ -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 (file)
index 0000000..6e130ee
--- /dev/null
@@ -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)