MCPcopy Create free account
hub / github.com/Kitware/VTK / PrependPythonPath

Method PrependPythonPath

Utilities/PythonInterpreter/vtkPythonInterpreter.cxx:645–668  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

643
644//------------------------------------------------------------------------------
645void 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//------------------------------------------------------------------------------
671void vtkPythonInterpreter::PrependPythonPath(

Callers

nothing calls this directly

Calls 9

vtkPrependPythonPathFunction · 0.85
SetLogVerbosityMethod · 0.80
LocateMethod · 0.80
replaceFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
c_strMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected