salome_init_with_session(path, embedded)
class StandAloneLifecyle:
+ def __init__(self, containerManager, resourcesManager):
+ self._cm = containerManager
+ self._rm = resourcesManager
+
def FindOrLoadComponent(self,contName,moduleName):
global orb
import importlib
return result
#raise RuntimeError("Undealed situation cont = {} module = {}".format(contName,moduleName))
+ def getContainerManager(self):
+ return self._cm
+
+ def getResourcesManager(self):
+ return self._rm
+
def salome_init_without_session():
global lcc,myStudy,orb,modulcat,sg,cm
- lcc = StandAloneLifecyle()
import KernelBasis
KernelBasis.setSSLMode(True)
import KernelDS
modulcat = KernelModuleCatalog.myModuleCatalog( list_of_catalogs_regarding_environement() )
import KernelLauncher
cm = KernelLauncher.myContainerManager()
+ lcc = StandAloneLifecyle(cm, KernelLauncher.myResourcesManager())
# activate poaManager to accept co-localized CORBA calls.
poa = orb.resolve_initial_references("RootPOA")
poaManager = poa._get_the_POAManager()
#include "SALOME_ContainerManager.hxx"
#include "SALOME_Fake_NamingService.hxx"
#include "SALOME_KernelServices.hxx"
+#include "SALOME_ResourcesManager.hxx"
#include <cstring>
CORBA::String_var ior = orb->object_to_string(cm);
return std::string(ior.in());
}
+
+std::string GetResourcesManagerInstance()
+{
+ SALOME_Launcher *launcher = KERNEL::getLauncherSA();
+ SALOME_Fake_NamingService ns;
+ CORBA::Object_var cm = ns.Resolve(SALOME_ResourcesManager::_ResourcesManagerNameInNS);
+ CORBA::ORB_ptr orb = KERNEL::getORB();
+ CORBA::String_var ior = orb->object_to_string(cm);
+ return std::string(ior.in());
+}
%inline
{
std::string GetContainerManagerInstance();
+ std::string GetResourcesManagerInstance();
}
%pythoncode %{
import CORBA
orb=CORBA.ORB_init([''])
return orb.string_to_object(GetContainerManagerInstance())
+
+def myResourcesManager():
+ import Engines
+ import CORBA
+ orb=CORBA.ORB_init([''])
+ return orb.string_to_object(GetResourcesManagerInstance())
%}