]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
control the presence of active studies in Python salome.salome_init() pre/fix_single_study V7_4_0b1
authorPaul RASCLE <paul.rascle@edf.fr>
Sat, 12 Apr 2014 16:20:27 +0000 (18:20 +0200)
committerPaul RASCLE <paul.rascle@edf.fr>
Sat, 12 Apr 2014 16:20:27 +0000 (18:20 +0200)
src/KERNEL_PY/salome_study.py

index 5e01b758c3eecd61d4fbc4ee62a03c6b0e1ce74d..29ba67d032871cf78eba9da6cde40be6fcc56d25 100755 (executable)
@@ -285,7 +285,14 @@ def getActiveStudy(theStudyId=0):
                     if verbose(): print "connection to existing study ", theStudyId
                     salome_study_ID = theStudyId
             if salome_study_ID == -1:
-                salome_study_ID = createNewStudy()
+                listOpenStudies = myStudyManager.GetOpenStudies()
+                if len(listOpenStudies) == 0:
+                    salome_study_ID = createNewStudy()
+                else:
+                    s = myStudyManager.GetStudyByName(listOpenStudies[0])
+                    salome_study_ID = s._get_StudyId()
+            else:
+                pass
             if verbose(): print"--- Study Id ", salome_study_ID
     return salome_study_ID