Python: Be more descriptive when modules can't be loaded.

This commit is contained in:
Adriaan de Groot 2017-07-04 11:56:21 -04:00 committed by Philip
parent 854e6d3883
commit 3f2bba4e33

View File

@ -82,13 +82,15 @@ Module::fromDescriptor( const QVariantMap& moduleDescriptor,
{ {
m = new ViewModule(); m = new ViewModule();
} }
#ifdef WITH_PYTHONQT
else if ( intfString == "pythonqt" ) else if ( intfString == "pythonqt" )
{ {
#ifdef WITH_PYTHONQT
m = new PythonQtViewModule(); m = new PythonQtViewModule();
} #else
cLog() << "PythonQt modules are not supported in this version of Calamares.";
#endif #endif
} }
}
else if ( typeString == "job" ) else if ( typeString == "job" )
{ {
if ( intfString == "qtplugin" ) if ( intfString == "qtplugin" )
@ -99,17 +101,20 @@ Module::fromDescriptor( const QVariantMap& moduleDescriptor,
{ {
m = new ProcessJobModule(); m = new ProcessJobModule();
} }
#ifdef WITH_PYTHON
else if ( intfString == "python" ) else if ( intfString == "python" )
{ {
#ifdef WITH_PYTHON
m = new PythonJobModule(); m = new PythonJobModule();
} #else
cLog() << "Python modules are not supported in this version of Calamares.";
#endif #endif
} }
}
if ( !m ) if ( !m )
{ {
cLog() << Q_FUNC_INFO << "bad module type or interface string" cLog() << "Bad module type (" << typeString
<< instanceId << typeString << intfString; << ") or interface string (" << intfString
<< ") for module " << instanceId;
return nullptr; return nullptr;
} }