]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Easy access to the shared dataserver manager from SALOME client
authorAnthony Geay <anthony.geay@edf.fr>
Wed, 28 Aug 2019 12:06:52 +0000 (14:06 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Wed, 28 Aug 2019 12:06:52 +0000 (14:06 +0200)
src/KERNEL_PY/__init__.py
src/KERNEL_PY/salome_kernel.py
src/KERNEL_PY/salome_study.py

index 4ac646bcc0fb1b575133f237b1b0b82b025cfbf5..70c310e6e83961badf1a682b13cd4a455cfe2b9f 100644 (file)
@@ -161,7 +161,7 @@ if not flags:
 #    sys.setdlopenflags(flags)
 #    pass
 
-orb, lcc, naming_service, cm, sg, esm = None,None,None,None,None,None
+orb, lcc, naming_service, cm, sg, esm, dsm = None,None,None,None,None,None,None
 myStudy, myStudyName = None,None
 
 salome_initial=True
@@ -174,12 +174,13 @@ def salome_init(path=None, embedded=False):
     naming_service  a naming service instance
     cm              reference to the container manager
     esm             reference to external server manager
+    dsm             reference to shared dataserver manager
     sg              access to SALOME GUI (when linked with IAPP GUI)
     myStudy         active study itself (CORBA reference)
     myStudyName     active study name
     """
     global salome_initial
-    global orb, lcc, naming_service, cm, esm
+    global orb, lcc, naming_service, cm, esm, dsm
     global sg
     global myStudy, myStudyName
 
@@ -187,7 +188,7 @@ def salome_init(path=None, embedded=False):
         if salome_initial:
             salome_initial=False
             sg = salome_iapp_init(embedded)
-            orb, lcc, naming_service, cm, esm = salome_kernel_init()
+            orb, lcc, naming_service, cm, esm, dsm = salome_kernel_init()
             myStudy, myStudyName = salome_study_init(path)
             pass
         pass
index 098d2d9f22cd53cf732f8755346d5e8bc3d40949..371262ced32612550e3c43a954c8260f33369595 100644 (file)
@@ -38,9 +38,10 @@ lcc = None
 naming_service = None
 cm = None
 esm = None
+dsm = None
 
 def salome_kernel_init():
-    global orb, lcc, naming_service, cm, esm
+    global orb, lcc, naming_service, cm, esm, dsm
     
     if not orb:
         # initialise the ORB
@@ -58,5 +59,8 @@ def salome_kernel_init():
         # get External Server Manager
         obj = naming_service.Resolve('/ExternalServers')
         esm = obj._narrow(SALOME.ExternalServerLauncher)
+        #
+        obj = naming_service.Resolve('/DataServerManager')
+        dsm = obj._narrow(SALOME.DataServerManager)
         
-    return orb, lcc, naming_service, cm, esm
+    return orb, lcc, naming_service, cm, esm, dsm
index b2574c66c5f83f17ccae803d74489edd49564865..f1612e7e117f2cda4fa64ba022e49d6b5d508fc9 100644 (file)
@@ -292,7 +292,7 @@ def salome_study_init(theStudyPath=None):
 
     if verbose(): print("theStudyPath:", theStudyPath)
     if not myStudy:
-        orb, lcc, naming_service, cm, _ = salome_kernel.salome_kernel_init()
+        orb, lcc, naming_service, cm, _, _ = salome_kernel.salome_kernel_init()
 
         # get Study reference
         if verbose(): print("looking for study...")