Commit 2f77c17e authored by Utkarsh Ayachit's avatar Utkarsh Ayachit
Browse files

Make pvpython/pvbatch not create Win32OuputWindow.

This ensures these executables keep printing error messages on the
terminal rather than a non-useable popup dialog.
parent 413c9ce6
......@@ -12,9 +12,12 @@ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "pvpython.h" // include this 1st.
#include "pvpython.h" // include this 1st.
#include "vtkOutputWindow.h"
#include "vtkPVConfig.h" // Required to get build options for paraview
#include "vtkProcessModule.h"
#ifndef BUILD_SHARED_LIBS
#include "pvStaticPluginsInit.h"
#endif
......@@ -30,5 +33,14 @@ int main(int argc, char* argv[])
#ifndef BUILD_SHARED_LIBS
paraview_static_plugins_init();
#endif
// Setup the output window to be vtkOutputWindow, rather than platform
// specific one. This avoids creating vtkWin32OutputWindow on Windows, for
// example, which puts all Python errors in a window rather than the terminal
// as one would expect.
auto opwindow = vtkOutputWindow::New();
vtkOutputWindow::SetInstance(opwindow);
opwindow->Delete();
return ParaViewPython::Run(vtkProcessModule::PROCESS_BATCH, argc, argv);
}
......@@ -12,9 +12,12 @@ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "pvpython.h" // Include this first.
#include "pvpython.h" // Include this first.
#include "vtkOutputWindow.h"
#include "vtkPVConfig.h" // Required to get build options for paraview
#include "vtkProcessModule.h"
#ifndef BUILD_SHARED_LIBS
#include "pvStaticPluginsInit.h"
#endif
......@@ -30,5 +33,14 @@ int main(int argc, char* argv[])
#ifndef BUILD_SHARED_LIBS
paraview_static_plugins_init();
#endif
// Setup the output window to be vtkOutputWindow, rather than platform
// specific one. This avoids creating vtkWin32OutputWindow on Windows, for
// example, which puts all Python errors in a window rather than the terminal
// as one would expect.
auto opwindow = vtkOutputWindow::New();
vtkOutputWindow::SetInstance(opwindow);
opwindow->Delete();
return ParaViewPython::Run(vtkProcessModule::PROCESS_CLIENT, argc, argv);
}
Subproject commit 37d3d20d79bd67be9fe4af8ac58df916ce18688f
Subproject commit b1da0529e90969873bf185ab452273e0dfed789a
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment