@@ -37,11 +37,17 @@ class PythonLogger {
3737
3838 bool check_abort () { return aborted_; }
3939
40+ bool is_cli_mode () { return is_cli_mode_; }
41+
42+ void set_cli_mode (bool cli) { is_cli_mode_ = cli; }
43+
4044 private:
4145 std::function<void (std::string)> callback_;
4246 std::function<void (double , std::string)> progress_callback_;
4347
4448 std::atomic<bool > aborted_{false };
49+
50+ std::atomic<bool > is_cli_mode_{false };
4551};
4652
4753// ---------------------------------------------------------------------------
@@ -50,7 +56,8 @@ PYBIND11_EMBEDDED_MODULE(logger, m) {
5056 .def (py::init<>())
5157 .def (" log" , &PythonLogger::cpp_log)
5258 .def (" check_abort" , &PythonLogger::check_abort)
53- .def (" progress" , &PythonLogger::cpp_progress);
59+ .def (" progress" , &PythonLogger::cpp_progress)
60+ .def (" is_cli_mode" , &PythonLogger::is_cli_mode);
5461};
5562
5663// ---------------------------------------------------------------------------
@@ -79,6 +86,9 @@ void PythonWorker::set_vtk_output_window(vtkSmartPointer<ShapeWorksVtkOutputWind
7986 studio_vtk_output_window_ = output_window;
8087}
8188
89+ // ---------------------------------------------------------------------------
90+ void PythonWorker::set_cli_mode (bool cli_mode) { python_logger_->set_cli_mode (cli_mode); }
91+
8292// ---------------------------------------------------------------------------
8393void PythonWorker::start_job (QSharedPointer<Job> job) {
8494 if (init ()) {
0 commit comments