Salome HOME
Update the getActiveStudy* functions in studyedit (usage of salome.getActiveStudy())
authorboulant <boulant>
Fri, 28 Oct 2011 16:50:35 +0000 (16:50 +0000)
committerboulant <boulant>
Fri, 28 Oct 2011 16:50:35 +0000 (16:50 +0000)
src/KERNEL_PY/kernel/studyedit.py

index 62d4162617e12ecfc59e59a0024bba788ebbeee4..f31c6ede641532afea89b8d6735b5ec208ffd260 100644 (file)
@@ -40,10 +40,12 @@ def getActiveStudyId():
     ``salome.myStudyId`` variable.
     """
     salome.salome_init()
-    if salome.hasDesktop():
-        return salome.sg.getActiveStudyId()
-    else:
-        return salome.myStudyId
+    # _GBO_WARN: note that salome.getActiveStudy() returns an id. It
+    # should return the study or be renammed in getActiveStudyId.
+    return salome.getActiveStudy()
+
+def getActiveStudy():
+    return salome.myStudyManager.GetStudyByID(getActiveStudyId())
 
 def getStudyEditor(studyId = None):
     """