Handle(SALOMEDSImpl_SComponent) sco = itcomponent.Value();
aCompType = sco->ComponentDataType();
//GEOM and MED are independent components
- if(aCompType == "GEOM" || aCompType == "MED") aSeq.Prepend(TCollection_ExtendedString(aCompType));
- else aSeq.Append(TCollection_ExtendedString(aCompType));
+ if (aCompType == "GEOM" || aCompType == "MED")
+ aSeq.Prepend(TCollection_ExtendedString(aCompType));
+ else
+ aSeq.Append(TCollection_ExtendedString(aCompType));
}
#ifdef WIN32
- TCollection_AsciiString aFileName=thePath+TCollection_AsciiString("\\")+theBaseName+TCollection_AsciiString(".py");
+ TCollection_AsciiString aFileName =
+ thePath + TCollection_AsciiString("\\") + theBaseName + TCollection_AsciiString(".py");
#else
- TCollection_AsciiString aFileName=thePath+TCollection_AsciiString("/")+theBaseName+TCollection_AsciiString(".py");
+ TCollection_AsciiString aFileName =
+ thePath + TCollection_AsciiString("/") + theBaseName + TCollection_AsciiString(".py");
#endif
//Create a file that will contain a main Study script
TCollection_AsciiString aBatchModeScript = "salome";
- //Output to the main Study script required Python modules import, set sys.path and add a creation of the study.
+ //Output to the main Study script required Python modules import,
+ //set sys.path and add a creation of the study.
fp << GetDumpStudyComment().ToCString() << endl << endl;
fp << "import sys" << endl;
fp << "import " << aBatchModeScript << "\n" << endl;
fp2.open(aFileName.ToCString(), ios::out);
#ifdef WIN32
- isOpened = fp.is_open();
+ isOpened = fp2.is_open();
#else
- isOpened = fp.rdbuf()->is_open();
+ isOpened = fp2.rdbuf()->is_open();
#endif
if(!isOpened) {
fp2 << aStream;
fp2.close();
+ if (aStream != NULL) delete [] aStream;
+
//Add to the main script a call to RebuildData of the generated by the component the Python script
fp << "import " << aScriptName << endl;
fp << aScriptName << ".RebuildData(" << aBatchModeScript << ".myStudy)" << endl;