global sg
global myStudyManager, myStudyId, myStudy, myStudyName
- print "*** import salome ***"
try:
if salome_initial:
salome_initial=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
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
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
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()
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