| 514 | // ################ |
| 515 | |
| 516 | void SiriusAdapterAlgorithm::logInSiriusAccount(String& executable, const String& email, const String& password) const |
| 517 | { |
| 518 | // sirius login --email=email --password=password |
| 519 | QString executable_qstring = SiriusAdapterAlgorithm::determineSiriusExecutable(executable).toQString(); |
| 520 | QStringList command_line{"login", String("--email="+email).toQString(), String("--password="+password).toQString()}; |
| 521 | |
| 522 | // start QProcess with sirius login command |
| 523 | QProcess qp; |
| 524 | qp.start(executable_qstring, command_line); |
| 525 | |
| 526 | // print executed command as info |
| 527 | std::stringstream ss; |
| 528 | ss << "Executing command: " << executable_qstring.toStdString(); |
| 529 | for (const QString& it : command_line) |
| 530 | { |
| 531 | ss << " " << it.toStdString(); |
| 532 | } |
| 533 | OPENMS_LOG_INFO << ss.str() << std::endl; |
| 534 | |
| 535 | // wait until process finished |
| 536 | qp.waitForFinished(-1); |
| 537 | |
| 538 | // always print process stdout (info) and stderror (warning) |
| 539 | const QString sirius_stdout(qp.readAllStandardOutput()); |
| 540 | const QString sirius_stderr(qp.readAllStandardError()); |
| 541 | OPENMS_LOG_INFO << String(sirius_stdout) << std::endl; |
| 542 | OPENMS_LOG_WARN << String(sirius_stderr) << std::endl; |
| 543 | |
| 544 | qp.close(); |
| 545 | } |
| 546 | |
| 547 | // tmp_msfile (store), all parameters, out_dir (tmpstructure) |
| 548 | const std::vector<String> SiriusAdapterAlgorithm::callSiriusQProcess(const String& tmp_ms_file, |