]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix of bug IPAL21005 - Dump/load python script works only with absolute path
authorouv <ouv@opencascade.com>
Thu, 30 Apr 2009 07:28:18 +0000 (07:28 +0000)
committerouv <ouv@opencascade.com>
Thu, 30 Apr 2009 07:28:18 +0000 (07:28 +0000)
src/SalomeApp/SalomeApp_Application.cxx

index 54a4ce85c96ff2d11d077f5e2b31a93bbed43887..ad7b6314f4f91e1b1454055f83e23993cfb61328 100644 (file)
@@ -785,7 +785,10 @@ void SalomeApp_Application::onLoadScript( )
 
   if ( !aFile.isEmpty() )
   {
-    QString command = QString("execfile(\"%1\")").arg(aFile);
+    QFileInfo aFileInfo( aFile );
+    QString anAbsPath = aFileInfo.dirPath( true );
+    QString aFileName = aFileInfo.baseName();
+    QString command = QString("import sys; sys.path.insert(0,\"%1\"); import %2").arg(anAbsPath, aFileName);
 
     PythonConsole* pyConsole = pythonConsole();