#--------------------------------------------------------------------------
def openStudy(theStudyPath):
- print("openStudy")
+ if verbose(): print("openStudy (begin)")
global myStudy, myStudyName
myStudy.Open(theStudyPath)
myStudyName = myStudy._get_Name()
- print(theStudyPath, myStudy._get_Name())
+ if verbose(): print("openStudy (end):", theStudyPath, myStudy._get_Name())
#--------------------------------------------------------------------------
if isinstance(theStudyPath, bytes):
theStudyPath = str(theStudyPath, 'UTF8')
openStudy(theStudyPath)
+ else:
+ myStudy.Init()
myStudyName = myStudy._get_Name()
return myStudy, myStudyName
+
+def salome_study_close():
+ global myStudy, myStudyName
+ myStudy, myStudyName = None, None
* Purpose : SALOMEDSImpl_Study constructor
*/
//============================================================================
-SALOMEDSImpl_Study::SALOMEDSImpl_Study()
+SALOMEDSImpl_Study::SALOMEDSImpl_Study() : _doc(NULL)
{
_appli = new DF_Application();
_clipboard = _appli->NewDocument("SALOME_STUDY");
//============================================================================
void SALOMEDSImpl_Study::Init()
{
+ if (_doc)
+ return; // noop: already initialized
+
static int _id = 0;
std::stringstream sstrm;
sstrm << ++_id;