------------------------------------------------------------------------------
| 643 | |
| 644 | //------------------------------------------------------------------------------ |
| 645 | void vtkPythonInterpreter::PrependPythonPath(const char* dir) |
| 646 | { |
| 647 | if (!dir) |
| 648 | { |
| 649 | return; |
| 650 | } |
| 651 | |
| 652 | std::string out_dir = dir; |
| 653 | |
| 654 | #if defined(_WIN32) && !defined(__CYGWIN__) |
| 655 | // Convert slashes for this platform. |
| 656 | std::replace(out_dir.begin(), out_dir.end(), '/', '\\'); |
| 657 | #endif |
| 658 | |
| 659 | if (Py_IsInitialized() == 0) |
| 660 | { |
| 661 | // save path for future use. |
| 662 | PythonPaths.push_back(out_dir); |
| 663 | return; |
| 664 | } |
| 665 | |
| 666 | // Append the path to the python sys.path object. |
| 667 | vtkPrependPythonPath(out_dir.c_str()); |
| 668 | } |
| 669 | |
| 670 | //------------------------------------------------------------------------------ |
| 671 | void vtkPythonInterpreter::PrependPythonPath( |
nothing calls this directly
no test coverage detected