From: boulant Date: Mon, 13 Feb 2012 12:49:37 +0000 (+0000) Subject: IMP: studyedit, helper functions to convert study in studyId et conversely X-Git-Tag: V6_5_0a1~43 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=733d349ff6da8ffe728ca98267ee5a79a2f2d594;p=modules%2Fkernel.git IMP: studyedit, helper functions to convert study in studyId et conversely --- diff --git a/src/KERNEL_PY/kernel/studyedit.py b/src/KERNEL_PY/kernel/studyedit.py index 8d7c1a3ab..5359de87e 100644 --- a/src/KERNEL_PY/kernel/studyedit.py +++ b/src/KERNEL_PY/kernel/studyedit.py @@ -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