From: mpa Date: Thu, 25 Sep 2014 06:49:48 +0000 (+0400) Subject: Edited python commands for single-study X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3e275c164071d973d11417623f589a1696ea50c4;p=modules%2Fkernel.git Edited python commands for single-study --- diff --git a/src/KERNEL_PY/__init__.py b/src/KERNEL_PY/__init__.py index 7cebb6be8..6d36a78e0 100755 --- a/src/KERNEL_PY/__init__.py +++ b/src/KERNEL_PY/__init__.py @@ -216,7 +216,6 @@ def salome_init(theStudyId=0,embedded=0): global sg global myStudyManager, myStudyId, myStudy, myStudyName - print "*** import salome ***" try: if salome_initial: salome_initial=0 @@ -241,23 +240,22 @@ def salome_init(theStudyId=0,embedded=0): raise def study_close(): - print "*** study_close ***" - if myStudy.IsEmpty(): - raise RuntimeError, "Study is already closed!" - else: + global myStudy + if salome_study.myStudy: + global myStudyId, myStudyName myStudy.Close() - salome_close() - pass + salome_study_close() + myStudyId, myStudy, myStudyName=None,None,None + else: + raise RuntimeError, "Study is already closed!" pass def salome_close(): - print "*** salome_close ***" global salome_initial salome_initial=1 salome_iapp_close() salome_kernel_close() salome_study_close() - myStudyId, myStudy, myStudyName=None,None,None pass diff --git a/src/KERNEL_PY/salome_study.py b/src/KERNEL_PY/salome_study.py index cbe7106cd..7bec02067 100755 --- a/src/KERNEL_PY/salome_study.py +++ b/src/KERNEL_PY/salome_study.py @@ -282,7 +282,6 @@ def getActiveStudy(theStudyId=0): if len(listOpenStudies) == 0: return None else: - print "getActiveStudy: GetStudyByName, salome_study_ID = ",salome_study_ID s = myStudyManager.GetStudyByName(listOpenStudies[0]) salome_study_ID = s._get_StudyId() if verbose(): print"--- Study Id ", salome_study_ID @@ -347,7 +346,6 @@ def salome_study_init(theStudyId=0): n (>0) : try connection to study with Id = n, or create a new one if study not found. """ - print "*** salome_study_init ***" global salome_study_initial global myStudyManager, myStudyId, myStudy, myStudyName global orb, lcc, naming_service, cm @@ -367,7 +365,6 @@ def salome_study_init(theStudyId=0): myStudyId = getActiveStudy(theStudyId) if myStudyId == None : myStudyId = createNewStudy() - print "getActiveStudy: createNewStudy, salome_study_ID = ",salome_study_ID if verbose(): print "myStudyId",myStudyId myStudy = myStudyManager.GetStudyByID(myStudyId) myStudyName = myStudy._get_Name() @@ -375,8 +372,7 @@ def salome_study_init(theStudyId=0): return myStudyManager, myStudyId, myStudy, myStudyName def salome_study_close(): - print "*** salome_study_close ***" - global salome_study_initial, salome_study_ID + global salome_study_initial, salome_study_ID, myStudyId, myStudy, myStudyName salome_study_initial=1 salome_study_ID=-1 myStudyId, myStudy, myStudyName=None,None,None