File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -69,12 +69,19 @@ bool qSlicerWebPythonProxy::isPythonEvaluationAllowed()
6969// --------------------------------------------------------------------------
7070QString qSlicerWebPythonProxy::evalPython (const QString &python)
7171{
72+
7273 QString result;
73- if (this ->isPythonEvaluationAllowed ())
74+ #ifdef Slicer_USE_PYTHONQT
75+ qSlicerCoreApplication * app = qSlicerCoreApplication::application ();
76+ if (app && !qSlicerCoreApplication::testAttribute (qSlicerCoreApplication::AA_DisablePython))
7477 {
75- qSlicerPythonManager *pythonManager = qSlicerApplication::application ()->pythonManager ();
76- result = pythonManager->executeString (python).toString ();
78+ if (this ->isPythonEvaluationAllowed ())
79+ {
80+ qSlicerPythonManager *pythonManager = qSlicerApplication::application ()->pythonManager ();
81+ result = pythonManager->executeString (python).toString ();
82+ }
83+ qDebug () << " Running " << python << " result is " << result;
7784 }
78- qDebug () << " Running " << python << " result is " << result;
85+ # endif
7986 return result;
8087}
You can’t perform that action at this time.
0 commit comments