Salome HOME
[minor] changes in information messages
[modules/kernel.git] / src / SALOMEDSImpl / SALOMEDSImpl_Study.cxx
index 56cde9e3c38dcba755a436d456edbb5523e7388c..9eea0a2d39a9b430c559ba67a7dc6d5a8a0abcec 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -941,11 +941,10 @@ std::string SALOMEDSImpl_Study::_GetStudyVariablesScript()
  *  Purpose  :
  */
 //============================================================================
-std::string SALOMEDSImpl_Study::_GetNoteBookAccess()
+std::string SALOMEDSImpl_Study::_GetNoteBookAccess(const std::string& theStudyVar)
 {
-  std::string accessor = _GetNoteBookAccessor();
   std::string notebook = "import salome_notebook\n";
-  notebook += accessor+" = salome_notebook.NoteBook(";
+  notebook += _GetNoteBookAccessor() + " = salome_notebook.NoteBook(" + theStudyVar + ")" ;
   return notebook;
 }
 
@@ -1275,11 +1274,11 @@ bool SALOMEDSImpl_Study::DumpStudy(const std::string& thePath,
   // initialization function
   sfp << aBatchModeScript << ".salome_init()" << std::endl;
   if ( !isMultiFile ) {
-    sfp << "theStudy = " << aStudyVar <<std::endl << std::endl;
+    sfp << "theStudy = " << aStudyVar << std::endl << std::endl;
     aStudyVar = "theStudy";
   }
   // notebook initialization
-  sfp << _GetNoteBookAccess() << aStudyVar << ")" <<std::endl;
+  sfp << _GetNoteBookAccess(aStudyVar) << 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;