From f704dbe64dba4f18878909b22a7d4355e4a69db4 Mon Sep 17 00:00:00 2001 From: boulant Date: Fri, 28 Oct 2011 16:50:35 +0000 Subject: [PATCH] Update the getActiveStudy* functions in studyedit (usage of salome.getActiveStudy()) --- src/KERNEL_PY/kernel/studyedit.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/KERNEL_PY/kernel/studyedit.py b/src/KERNEL_PY/kernel/studyedit.py index 62d416261..f31c6ede6 100644 --- a/src/KERNEL_PY/kernel/studyedit.py +++ b/src/KERNEL_PY/kernel/studyedit.py @@ -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): """ -- 2.39.2