MCPcopy Create free account
hub / github.com/MITK/MITK / StartPostInstallStep

Method StartPostInstallStep

Modules/PythonInstaller/src/QmitkPipInstaller.cpp:672–702  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

670}
671
672void QmitkPipInstaller::StartPostInstallStep()
673{
674 const auto python = this->RequirePythonExecutable();
675
676 if (python.isEmpty())
677 return;
678
679 if (m_CurrentPostInstallStep >= static_cast<int>(m_Spec.postInstallSteps.size()))
680 {
681 m_State = m_AnyFailed ? State::Failed : State::Done;
682 emit InstallFinished(!m_AnyFailed);
683 return;
684 }
685
686 const auto& step = m_Spec.postInstallSteps[m_CurrentPostInstallStep];
687 const auto displayName = QString::fromStdString(
688 step.displayName.empty() ? std::string("post-install step") : step.displayName);
689
690 // Run the step's Python source verbatim via `python -c`. QProcess::start with
691 // a QStringList handles argument quoting on Windows. Any imports must be
692 // satisfied by packages installed in the preceding groups; stdout/stderr
693 // (including tqdm progress) flows to the UI details view via
694 // OnStandardOutputReady / OnStandardErrorReady -> OutputReceived.
695 const auto script = QString::fromStdString(step.pythonCode);
696
697 emit PostInstallStepStarted(displayName);
698
699 QStringList args = { "-c", script };
700 MITK_INFO << FormatCommand(python, args).toStdString();
701 m_Process->start(python, args);
702}
703
704QString QmitkPipInstaller::PythonExecutable() const
705{

Callers 2

OnProcessFinishedMethod · 0.95
BeginPostInstallPhaseMethod · 0.95

Calls 5

FormatCommandFunction · 0.85
sizeMethod · 0.45
emptyMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected