-void PVGUI_Module::execPythonCommand(const QString& cmd, bool inSalomeConsole)
-{
- if ( inSalomeConsole ) {
- if ( PyInterp_Dispatcher::Get()->IsBusy() ) return;
- SalomeApp_Application* app =
- dynamic_cast< SalomeApp_Application* >(SUIT_Session::session()->activeApplication());
- PyConsole_Console* pyConsole = app->pythonConsole();
- if (pyConsole)
- pyConsole->exec(cmd);
- }
- else
- {
- SalomeApp_Application* app =
- dynamic_cast< SalomeApp_Application* >(SUIT_Session::session()->activeApplication());
- PyConsole_Interp* pyInterp = app->pythonConsole()->getInterp();
- PyLockWrapper aGil;
- pyInterp->run(cmd.toStdString().c_str());
-// pqPythonManager* manager = qobject_cast<pqPythonManager*>
-// ( pqApplicationCore::instance()->manager( "PYTHON_MANAGER" ) );
-// if ( manager )
-// {
-// pqPythonDialog* pyDiag = manager->pythonShellDialog();
-// if ( pyDiag )
-// {
-// pqPythonShell* shell = pyDiag->shell();
-// if ( shell ) {
-// shell->executeScript(cmd);
-// }
-// }
-// }
- }
-}
-