diff --git a/src/libcalamares/PythonJob.cpp b/src/libcalamares/PythonJob.cpp index 6ead23ec7..ed05d5a92 100644 --- a/src/libcalamares/PythonJob.cpp +++ b/src/libcalamares/PythonJob.cpp @@ -258,9 +258,10 @@ PythonJob::exec() QDir workingDir( m_workingPath ); if ( !workingDir.exists() || !workingDir.isReadable() ) { - return JobResult::error( - tr( "Bad working directory path", "@error" ), - tr( "Working directory %1 for python job %2 is not readable.", "@error" ).arg( m_workingPath ).arg( prettyName() ) ); + return JobResult::error( tr( "Bad working directory path", "@error" ), + tr( "Working directory %1 for python job %2 is not readable.", "@error" ) + .arg( m_workingPath ) + .arg( prettyName() ) ); } QFileInfo scriptFI( workingDir.absoluteFilePath( m_scriptFile ) ); @@ -339,8 +340,9 @@ PythonJob::exec() } bp::handle_exception(); PyErr_Clear(); - return JobResult::internalError( - tr( "Boost.Python error in job \"%1\"", "@error" ).arg( prettyName() ), msg, JobResult::PythonUncaughtException ); + return JobResult::internalError( tr( "Boost.Python error in job \"%1\"", "@error" ).arg( prettyName() ), + msg, + JobResult::PythonUncaughtException ); } } diff --git a/src/libcalamares/python/PythonJob.cpp b/src/libcalamares/python/PythonJob.cpp index 6c3a79c4a..10c3e28ab 100644 --- a/src/libcalamares/python/PythonJob.cpp +++ b/src/libcalamares/python/PythonJob.cpp @@ -272,10 +272,10 @@ Job::exec() // Now `import libcalamares` in modules will find the already- // loaded module. auto scope = py::module_::import( "__main__" ).attr( "__dict__" ); - scope["libcalamares"] = calamaresModule; + scope[ "libcalamares" ] = calamaresModule; - auto sys = scope["sys"].attr("modules"); - sys["libcalamares"] = calamaresModule; + auto sys = scope[ "sys" ].attr( "modules" ); + sys[ "libcalamares" ] = calamaresModule; calamaresModule.attr( "job" ) = Calamares::Python::JobProxy( this ); calamaresModule.attr( "globalstorage" ) diff --git a/src/libcalamares/utils/Logger.cpp b/src/libcalamares/utils/Logger.cpp index 145abc990..dcd6c518b 100644 --- a/src/libcalamares/utils/Logger.cpp +++ b/src/libcalamares/utils/Logger.cpp @@ -98,8 +98,10 @@ log_implementation( const char* msg, unsigned int debugLevel, const char* funcin logfile << date.toUtf8().data() << " - " << time.toUtf8().data() << " [" << debugLevel << "]: " << funcinfo << '\n'; } - if (msg) { - logfile << date.toUtf8().data() << " - " << time.toUtf8().data() << " [" << debugLevel << (funcinfo ? "]: " : "]: ") << msg << '\n'; + if ( msg ) + { + logfile << date.toUtf8().data() << " - " << time.toUtf8().data() << " [" << debugLevel + << ( funcinfo ? "]: " : "]: " ) << msg << '\n'; } logfile.flush(); @@ -107,10 +109,11 @@ log_implementation( const char* msg, unsigned int debugLevel, const char* funcin { if ( funcinfo ) { - std::cout << time.toUtf8().data() << " [" << debugLevel << "]: " << funcinfo << (msg ? s_Continuation : ""); + std::cout << time.toUtf8().data() << " [" << debugLevel << "]: " << funcinfo + << ( msg ? s_Continuation : "" ); } // The endl is desired, since it also flushes (like the logfile, above) - std::cout << (msg ? msg : "") << std::endl; + std::cout << ( msg ? msg : "" ) << std::endl; } } @@ -118,7 +121,7 @@ static void CalamaresLogHandler( QtMsgType type, const QMessageLogContext&, const QString& msg ) { unsigned int level = LOGVERBOSE; - const char * funcinfo = nullptr; + const char* funcinfo = nullptr; switch ( type ) { case QtInfoMsg: @@ -145,7 +148,8 @@ CalamaresLogHandler( QtMsgType type, const QMessageLogContext&, const QString& m return; } - log_implementation( nullptr, level, (QString(funcinfo) + QStringLiteral(" (Qt): ") + msg).toUtf8().constData() ); + log_implementation( + nullptr, level, ( QString( funcinfo ) + QStringLiteral( " (Qt): " ) + msg ).toUtf8().constData() ); } QString