-----------------------------------------------------------------------------
| 219 | |
| 220 | //----------------------------------------------------------------------------- |
| 221 | void 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 | //----------------------------------------------------------------------------- |
| 245 | void pqCommandLineOptionsBehavior::processLive() |
no test coverage detected