Skip to content
Permalink
Browse files

When exporting a model to python, export comments as python comments

  • Loading branch information
nyalldawson committed Mar 4, 2020
1 parent 0af98f9 commit 889563e5a20d59d841f4f3d0f36df8aa1f18a99f
@@ -465,6 +465,11 @@ QStringList QgsProcessingModelAlgorithm::asPythonCode( const QgsProcessing::Pyth
friendlyOutputNames.insert( defClone->name(), friendlyName );
defClone->setName( friendlyName );
}
else
{
if ( !mParameterComponents.value( defClone->name() ).comment()->description().isEmpty() )
lines << indent + indent + QStringLiteral( "# %1" ).arg( mParameterComponents.value( defClone->name() ).comment()->description() );
}

if ( defClone->flags() & QgsProcessingParameterDefinition::FlagAdvanced )
{
@@ -177,6 +177,9 @@ QStringList QgsProcessingModelChildAlgorithm::asPythonCode( const QgsProcessing:

if ( !description().isEmpty() )
lines << baseIndent + QStringLiteral( "# %1" ).arg( description() );
if ( !mComment.description().isEmpty() )
lines << baseIndent + QStringLiteral( "# %1" ).arg( mComment.description() );

QStringList paramParts;
for ( auto paramIt = mParams.constBegin(); paramIt != mParams.constEnd(); ++paramIt )
{

0 comments on commit 889563e

Please sign in to comment.
You can’t perform that action at this time.