Salome HOME
Issue 0020342: EDF 1025 GUI: Impossible to choose the container for a Python module
authorvsr <vsr@opencascade.com>
Wed, 6 May 2009 08:41:37 +0000 (08:41 +0000)
committervsr <vsr@opencascade.com>
Wed, 6 May 2009 08:41:37 +0000 (08:41 +0000)
src/PYHELLO/PYHELLO_utils.py
src/PYHELLOGUI/PYHELLOGUI.py

index 03186fc1c5a47ed123857481234be63c83b316bd..29442cda4913815fc6c55e100e22be3e905c97c0 100644 (file)
@@ -37,6 +37,7 @@ __all__ = [
     "getLCC",
     "getStudyManager",
     "getEngine",
+    "getEngineIOR",
     "findOrCreateComponent",
     "getObjectID",
     ]
@@ -152,6 +153,16 @@ def getEngine():
         pass
     return __engine__
 
+###
+# Get PYHELLO engine IOR
+###
+def getEngineIOR():
+    IOR = ""
+    if getORB() and getEngine():
+        IOR = getORB().object_to_string( getEngine() )
+        pass
+    return IOR
+
 ###
 # Find or create PYHELLO component object in a study
 ###
index 86a86dee78babbd352cb67a355af18cd0427aac1..e931a440910b312c7a4da82fd248a30a13f2c6f3 100644 (file)
@@ -268,7 +268,7 @@ def createPopupMenu( popup, context ):
     ctx = _setContext( _getStudyId() )
     study = _getStudy()
     selcount, selected = _getSelection()
-    print selcount, selected
+    if verbose() : print selcount, selected
     if selcount == 1:
         # one object is selected
         if moduleID() in selected:
@@ -333,6 +333,12 @@ def viewClosed( viewID ):
     if verbose() : print "PYHELLOGUI.viewClosed(): %d" % viewID
     pass
 
+# called when study is opened
+# returns engine IOR
+def engineIOR():
+    if verbose() : print "PYHELLOGUI.engineIOR()"
+    return getEngineIOR()
+
 ################################################
 # GUI actions implementation
 ################################################