MCPcopy Create free account
hub / github.com/Kitware/ParaView / processScript

Method processScript

Qt/ApplicationComponents/pqCommandLineOptionsBehavior.cxx:221–242  ·  view source on GitHub ↗

-----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

219
220//-----------------------------------------------------------------------------
221void pqCommandLineOptionsBehavior::processScript()
222{
223 auto cConfig = pqCoreConfiguration::instance();
224 const auto& fname = cConfig->pythonScript();
225 if (!fname.empty())
226 {
227#if VTK_MODULE_ENABLE_VTK_PythonInterpreter
228 QFile file(QString::fromStdString(fname));
229 if (file.open(QIODevice::ReadOnly))
230 {
231 QByteArray code = file.readAll();
232 vtkPythonInterpreter::RunSimpleString(code.data());
233 }
234 else
235 {
236 qCritical() << "Cannot open Python script specified: '" << fname.c_str() << "'";
237 }
238#else
239 qCritical() << "Python support not enabled. Cannot run python scripts.";
240#endif
241 }
242}
243
244//-----------------------------------------------------------------------------
245void pqCommandLineOptionsBehavior::processLive()

Callers 1

Calls 4

instanceFunction · 0.85
emptyMethod · 0.45
openMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected