]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
IMP: studyedit, helper functions to convert study in studyId et conversely
authorboulant <boulant>
Mon, 13 Feb 2012 12:49:37 +0000 (12:49 +0000)
committerboulant <boulant>
Mon, 13 Feb 2012 12:49:37 +0000 (12:49 +0000)
src/KERNEL_PY/kernel/studyedit.py

index 8d7c1a3ab4c324247b32e30c5c629caedcb063b5..5359de87e501e3ca1159ebeff5f25fe5f94d5254 100644 (file)
@@ -49,7 +49,16 @@ def getActiveStudyId():
         return salome.myStudyId
 
 def getActiveStudy():
-    return salome.myStudyManager.GetStudyByID(getActiveStudyId())
+    return getStudyFromStudyId(getActiveStudyId())
+
+def getStudyFromStudyId(studyId):
+    salome.salome_init()
+    study = salome.myStudyManager.GetStudyByID(studyId)
+    return study
+
+def getStudyIdFromStudy(study):
+    studyId = study._get_StudyId()
+    return studyId
 
 def getStudyEditor(studyId = None):
     """
@@ -63,7 +72,6 @@ def getStudyEditor(studyId = None):
         _editors[studyId] = StudyEditor(studyId)
     return _editors[studyId]
 
-
 class StudyEditor:
     """
     This class provides utility methods to complement :class:`Study` and