Python: get docstring from run() method
This commit is contained in:
parent
b28edfdc8e
commit
7ff814790d
@ -228,6 +228,7 @@ PythonJob::PythonJob( const QString& scriptFile,
|
|||||||
: Job( parent )
|
: Job( parent )
|
||||||
, m_scriptFile( scriptFile )
|
, m_scriptFile( scriptFile )
|
||||||
, m_workingPath( workingPath )
|
, m_workingPath( workingPath )
|
||||||
|
, m_description()
|
||||||
, m_configurationMap( moduleConfiguration )
|
, m_configurationMap( moduleConfiguration )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -293,6 +294,10 @@ PythonJob::exec()
|
|||||||
scriptNamespace );
|
scriptNamespace );
|
||||||
|
|
||||||
bp::object entryPoint = scriptNamespace[ "run" ];
|
bp::object entryPoint = scriptNamespace[ "run" ];
|
||||||
|
bp::extract< std::string > entryPoint_doc_attr(entryPoint.attr( "__doc__" ) );
|
||||||
|
|
||||||
|
if ( entryPoint_doc_attr.check() )
|
||||||
|
m_description = QString::fromStdString( entryPoint_doc_attr() );
|
||||||
|
|
||||||
bp::object runResult = entryPoint();
|
bp::object runResult = entryPoint();
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ private:
|
|||||||
CalamaresPython::Helper* helper();
|
CalamaresPython::Helper* helper();
|
||||||
QString m_scriptFile;
|
QString m_scriptFile;
|
||||||
QString m_workingPath;
|
QString m_workingPath;
|
||||||
|
QString m_description;
|
||||||
QVariantMap m_configurationMap;
|
QVariantMap m_configurationMap;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user