| 2759 | } |
| 2760 | |
| 2761 | void SamApp::InstallPythonPackage(const std::string& pip_name) { |
| 2762 | if (CheckPythonPackageInstalled(pip_name, pythonConfig)) |
| 2763 | return; |
| 2764 | auto packageConfig = ReadPythonPackageConfig(pip_name, GetPythonConfigPath() + "/" + pip_name + ".json"); |
| 2765 | |
| 2766 | #ifdef __WXMSW__ |
| 2767 | bool retval = InstallFromPipWindows(GetPythonConfigPath() + "\\" + pythonConfig.pipPath, packageConfig); |
| 2768 | #else |
| 2769 | std::string pip_exec = GetPythonConfigPath() + "/" + pythonConfig.pipPath; |
| 2770 | bool retval = InstallFromPip(pip_exec, packageConfig); |
| 2771 | #endif |
| 2772 | if (retval == 0){ |
| 2773 | pythonConfig.packages.push_back(pip_name); |
| 2774 | WritePythonConfig(GetPythonConfigPath() + "/python_config.json", pythonConfig); |
| 2775 | } |
| 2776 | else { |
| 2777 | throw std::runtime_error("Error installing " + pip_name); |
| 2778 | } |
| 2779 | } |
| 2780 | |
| 2781 | enum { ID_TechTree = wxID_HIGHEST+98, ID_FinTree }; |
| 2782 |
nothing calls this directly
no test coverage detected