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
{
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();
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();
objectBrowserColumnsVisibility();
}
-/*!Gets file filter.
- *\retval QString "(*.hdf)"
- */
-QString SalomeApp_Application::getFileFilter() const
-{
- return "(*.hdf)";
-}
-
/*!Create window.*/
QWidget* SalomeApp_Application::createWindow( const int flag )
{
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( 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();
{
#ifndef DISABLE_PYCONSOLE
_PTR(Study) aStudyDS = newStudy->studyDS();
- app->getNoteBook()->Init( aStudyDS );
+ if ( app->getNoteBook() )
+ app->getNoteBook()->Init( aStudyDS );
newStudy->updateFromNotebook(theStudyName, theIsStudySaved);
newStudy->Modified();
updateDesktopTitle();
PyConsole_Interp* SalomeApp_Application::createPyInterp()
{
- return new SalomeApp_PyInterp();
+ return new SalomeApp_PyInterp;
}
#endif // DISABLE_PYCONSOLE