Returns a python script, which is being played back reproduces
the data model of component
*/
- TMPFile DumpPython(in Object theStudy,
- in boolean isPublished,
+ TMPFile DumpPython(in boolean isPublished,
in boolean isMultiFile,
out boolean isValidScript);
*/
//=============================================================================
-Engines::TMPFile* Engines_Component_i::DumpPython(CORBA::Object_ptr theStudy,
- CORBA::Boolean isPublished,
+Engines::TMPFile* Engines_Component_i::DumpPython(CORBA::Boolean isPublished,
CORBA::Boolean isMultiFile,
CORBA::Boolean& isValidScript)
{
- const char* aScript = isMultiFile ? "def RebuildData(theStudy): pass" : "";
+ const char* aScript = isMultiFile ? "def RebuildData(): pass" : "";
char* aBuffer = new char[strlen(aScript)+1];
strcpy(aBuffer, aScript);
CORBA::Octet* anOctetBuf = (CORBA::Octet*)aBuffer;
#-------------------------------------------------------------------------
- def DumpPython(self, theStudy, isPublished, isMultiFile):
+ def DumpPython(self, isPublished, isMultiFile):
aBuffer = "\0"
if isMultiFile :
- aBuffer = "def RebuildData(theStudy): pass\n\0"
+ aBuffer = "def RebuildData(): pass\n\0"
return (aBuffer, 1)
#-------------------------------------------------------------------------
bool Resume_impl();
CORBA::Long CpuUsed_impl() ;
- virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
- CORBA::Boolean isPublished,
+ virtual Engines::TMPFile* DumpPython(CORBA::Boolean isPublished,
CORBA::Boolean isMultiFile,
CORBA::Boolean& isValidScript);
*/
//=============================================================================
-Engines::TMPFile* Engines_Parallel_Component_i::DumpPython(CORBA::Object_ptr theStudy,
- CORBA::Boolean isPublished,
+Engines::TMPFile* Engines_Parallel_Component_i::DumpPython(CORBA::Boolean isPublished,
CORBA::Boolean isMultiFile,
CORBA::Boolean& isValidScript)
{
- const char* aScript = isMultiFile ? "def RebuildData(theStudy): pass" : "";
+ const char* aScript = isMultiFile ? "def RebuildData(): pass" : "";
char* aBuffer = new char[strlen(aScript)+1];
strcpy(aBuffer, aScript);
CORBA::Octet* anOctetBuf = (CORBA::Octet*)aBuffer;
bool Resume_impl();
CORBA::Long CpuUsed_impl() ;
- virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
- CORBA::Boolean isPublished,
+ virtual Engines::TMPFile* DumpPython(CORBA::Boolean isPublished,
CORBA::Boolean isMultiFile,
CORBA::Boolean& isValidScript);
CORBA::Boolean aValidScript = true; // VSR: maybe should be false by default ???
if ( !CORBA::is_nil( _engine ) )
- aStream = _engine->DumpPython(st.in(), isPublished, isMultiFile, aValidScript);
+ aStream = _engine->DumpPython(isPublished, isMultiFile, aValidScript);
SALOMEDSImpl_TMPFile* aTMPFile = new Engines_TMPFile_i(aStream._retn());
theStreamLength = aTMPFile->Size();
* Purpose :
*/
//============================================================================
-std::string SALOMEDSImpl_Study::_GetNoteBookAccess(const std::string& theStudyVar)
+std::string SALOMEDSImpl_Study::_GetNoteBookAccess()
{
- std::string notebook = "import salome_notebook\n";
- notebook += _GetNoteBookAccessor() + " = salome_notebook.NoteBook(" + theStudyVar + ")" ;
- return notebook;
+ return std::string("import salome_notebook\n");
}
bool SALOMEDSImpl_Study::IsLocked()
sfp << "import sys" << std::endl;
sfp << "import " << aBatchModeScript << std::endl << std::endl;
- std::string aStudyVar = "salome.myStudy";
// initialization function
sfp << aBatchModeScript << ".salome_init()" << std::endl;
- if ( !isMultiFile ) {
- sfp << "theStudy = " << aStudyVar << std::endl << std::endl;
- aStudyVar = "theStudy";
- }
+
// notebook initialization
- sfp << _GetNoteBookAccess(aStudyVar) << std::endl;
+ sfp << _GetNoteBookAccess() << std::endl;
// extend sys.path with the directory where the script is being dumped to
sfp << "sys.path.insert( 0, r\'" << thePath << "\')" << std::endl << std::endl;
//Add to the main script a call to RebuildData of the generated by the component the Python script
sfp << "import " << aScriptName << std::endl;
- sfp << aScriptName << ".RebuildData(" << aBatchModeScript << ".myStudy)" << std::endl;
+ sfp << aScriptName << ".RebuildData()" << std::endl;
}
else
sfp << sfp2.str();
std::string _GetStudyVariablesScript();
std::string _GetNoteBookAccessor();
- std::string _GetNoteBookAccess(const std::string& theStudyVar);
+ std::string _GetNoteBookAccess();
public: