Fix mixed Python dump of a new and a closed study

This commit is contained in:
eap 2018-08-01 18:41:11 +03:00
parent a8d98187a5
commit 35012b0a3d
3 changed files with 21 additions and 19 deletions

View File

@ -4971,6 +4971,9 @@ void SMESH_Gen_i::Close( SALOMEDS::SComponent_ptr theComponent )
// remove the tmp files meshes are loaded from
SMESH_PreMeshInfo::RemoveStudyFiles_TMP_METHOD( theComponent );
// Clean trace of API methods calls
CleanPythonTrace();
return;
}

View File

@ -678,14 +678,13 @@ namespace SMESH
cout << "Exception in SMESH_Gen_i::DumpPython(): " << text << endl;
#endif
}
}
//=======================================================================
//function : RemoveTabulation
//purpose :
//=======================================================================
void RemoveTabulation( TCollection_AsciiString& theScript )
{
void RemoveTabulation( TCollection_AsciiString& theScript )
{
std::string aString( theScript.ToCString() );
std::string::size_type aPos = 0;
while( aPos < aString.length() )
@ -697,6 +696,7 @@ void RemoveTabulation( TCollection_AsciiString& theScript )
aPos++;
}
theScript = aString.c_str();
}
}
//=======================================================================
@ -995,10 +995,9 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
std::list< TCollection_AsciiString > lines; // lines of a script
std::list< TCollection_AsciiString >::iterator linesIt;
if ( isPublished )
lines.push_back( aSMESHGen + " = smeshBuilder.New()" );
else
lines.push_back( aSMESHGen + " = smeshBuilder.New(False)" );
if ( !isPublished )
lines.push_back( aSMESHGen + ".SetEnablePublish( False )" );
lines.push_back( helper + "aFilterManager = " + aSMESHGen + ".CreateFilterManager()" );
lines.push_back( helper + "aMeasurements = " + aSMESHGen + ".CreateMeasurements()" );