From: Ovidiu Mircescu Date: Wed, 23 Apr 2014 09:29:13 +0000 (+0200) Subject: Documentation about loading the module catalog. X-Git-Tag: V7_5_0a1~7^2~1^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9ab365f9ab292d5efd7c70341a0e277c54d0554d;p=modules%2Fyacs.git Documentation about loading the module catalog. Add an example on how to load a catalog in the documentation of the python programming interface. --- diff --git a/doc/schemapy.rst b/doc/schemapy.rst index 8bf42ca15..19b6df984 100644 --- a/doc/schemapy.rst +++ b/doc/schemapy.rst @@ -26,6 +26,20 @@ Before YACS modules can be imported, the environment must be correctly configure SALOME application is used. Otherwise, the PYTHONPATH environment variable has to be set to /lib/pythonX.Y/site-packages/salome. +When you build your own Salome application and use your own modules and components (using YACSGEN for example), you may need to load +the module catalog:: + + import SALOMERuntime + SALOMERuntime.RuntimeSALOME_setRuntime() + salome_runtime = SALOMERuntime.getSALOMERuntime() + import salome + salome.salome_init() + mc = salome.naming_service.Resolve('/Kernel/ModulCatalog') + ior = salome.orb.object_to_string(mc) + session_catalog = salome_runtime.loadCatalog("session", ior) + salome_runtime.addCatalog(session_catalog) + + .. _loadxml: Create a calculation scheme by loading an XML file