mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-16 08:25:55 +08:00
#333 better python path completion for all os.
This commit is contained in:
parent
eaca18d628
commit
90ef7989e6
@ -733,9 +733,22 @@ bool FreeCADDialog::init_start_python() {
|
|||||||
|
|
||||||
// Get the freecad path (python path)
|
// Get the freecad path (python path)
|
||||||
boost::filesystem::path pythonpath(gui_app->app_config->get("freecad_path"));
|
boost::filesystem::path pythonpath(gui_app->app_config->get("freecad_path"));
|
||||||
|
if (pythonpath.filename().string().find("python") == std::string::npos) {
|
||||||
|
if (pythonpath.filename().string() != "bin") {
|
||||||
|
pythonpath = pythonpath / "bin";
|
||||||
|
}
|
||||||
|
#ifdef __WINDOWS__
|
||||||
pythonpath = pythonpath / "python.exe";
|
pythonpath = pythonpath / "python.exe";
|
||||||
|
#endif
|
||||||
|
#ifdef __APPLE__
|
||||||
|
pythonpath = pythonpath / "python";
|
||||||
|
#endif
|
||||||
|
#ifdef __linux__
|
||||||
|
pythonpath = pythonpath / "python";
|
||||||
|
#endif
|
||||||
|
}
|
||||||
if (!exists(pythonpath)) {
|
if (!exists(pythonpath)) {
|
||||||
m_errors->AppendText("Error, cannot find the freecad (version 0.19 or higher) python at '" + pythonpath.string() + "', please update your freecad bin directory in the preferences.");
|
m_errors->AppendText("Error, cannot find the freecad (version 0.19 or higher) python at '" + pythonpath.string() + "', please update your freecad python path in the preferences.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user