X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSalomeApp%2FSalomeApp_Application.cxx;h=70646990ff82c781655a0ed9b82d00033a64bd11;hb=6ea08066cb76ea0e557d89789037f3fd1a03e0fb;hp=12a733584f9f9a98abad23a815311544ccee5f4e;hpb=a02bf230b856e127c34d5b1f7b529f0116fc4123;p=modules%2Fgui.git diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 12a733584..70646990f 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -280,7 +280,7 @@ void SalomeApp_Application::start() script.remove( QRegExp("^python.*[\\s]+") ); QString cmd = script+" "+args; - QString command = QString( "execfile(r\"%1\")" ).arg(cmd.trimmed()); + QString command = QString( "exec(open(\"%1\").read())" ).arg(cmd.trimmed()); pyConsole->exec(command); } } // end for loop on pyfiles QStringList @@ -503,7 +503,7 @@ void SalomeApp_Application::onNewWithScript() { onNewDoc(); - QString command = QString("execfile(r\"%1\")").arg(aFile); + QString command = QString("exec(open(\"%1\").read())").arg(aFile); #ifndef DISABLE_PYCONSOLE PyConsole_Console* pyConsole = pythonConsole(); @@ -934,7 +934,7 @@ void SalomeApp_Application::onLoadScript( ) if ( !aFile.isEmpty() ) { - QString command = QString("execfile(r\"%1\")").arg(aFile); + QString command = QString("exec(open(\"%1\").read())").arg(aFile); #ifndef DISABLE_PYCONSOLE PyConsole_Console* pyConsole = pythonConsole(); @@ -1998,7 +1998,7 @@ bool SalomeApp_Application::onRestoreStudy( const QString& theDumpScript, SalomeApp_Application* app = dynamic_cast( SUIT_Session::session()->activeApplication() ); // load study from the temporary directory - QString command = QString( "execfile(r\"%1\")" ).arg( theDumpScript ); + QString command = QString( "exec(open(\"%1\").read())" ).arg( theDumpScript ); #ifndef DISABLE_PYCONSOLE PyConsole_Console* pyConsole = app->pythonConsole();