@@ -303,7 +303,18 @@ The returned value must be correctly escaped - e.g. string values must be wrappe
303
303
virtual QString asScriptCode() const;
304
304
%Docstring
305
305
Returns the parameter definition encoded in a string which can be used within a
306
- Python processing script.
306
+ Processing script.
307
+ %End
308
+
309
+ virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
310
+ %Docstring
311
+ Returns the parameter definition as a Python command which can be used within a
312
+ Python Processing script.
313
+
314
+ The ``outputType`` argument specifies the desired output format for the Python string,
315
+ i.e. the intended end use of the generated Python code.
316
+
317
+ .. versionadded:: 3.6
307
318
%End
308
319
309
320
virtual QVariantMap toVariantMap() const;
@@ -1172,6 +1183,8 @@ Returns the type name for the parameter class.
1172
1183
1173
1184
virtual QString asScriptCode() const;
1174
1185
1186
+ virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
1187
+
1175
1188
1176
1189
Behavior behavior() const;
1177
1190
%Docstring
@@ -1245,6 +1258,8 @@ Returns the type name for the parameter class.
1245
1258
1246
1259
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
1247
1260
1261
+ virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
1262
+
1248
1263
1249
1264
QStringList headers() const;
1250
1265
%Docstring
@@ -1343,6 +1358,8 @@ Returns the type name for the parameter class.
1343
1358
1344
1359
virtual QString asScriptCode() const;
1345
1360
1361
+ virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
1362
+
1346
1363
1347
1364
QgsProcessing::SourceType layerType() const;
1348
1365
%Docstring
@@ -1440,6 +1457,8 @@ Returns the type name for the parameter class.
1440
1457
1441
1458
virtual QString toolTip() const;
1442
1459
1460
+ virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
1461
+
1443
1462
1444
1463
double minimum() const;
1445
1464
%Docstring
@@ -1542,6 +1561,8 @@ Returns the type name for the parameter class.
1542
1561
1543
1562
virtual QStringList dependsOnOtherParameters() const;
1544
1563
1564
+ virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
1565
+
1545
1566
1546
1567
QString parentParameterName() const;
1547
1568
%Docstring
@@ -1614,6 +1635,8 @@ Returns the type name for the parameter class.
1614
1635
1615
1636
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
1616
1637
1638
+ virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
1639
+
1617
1640
1618
1641
QgsProcessingParameterNumber::Type dataType() const;
1619
1642
%Docstring
@@ -1713,6 +1736,8 @@ Returns the type name for the parameter class.
1713
1736
1714
1737
virtual QString asScriptCode() const;
1715
1738
1739
+ virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
1740
+
1716
1741
1717
1742
QStringList options() const;
1718
1743
%Docstring
@@ -1785,6 +1810,8 @@ Returns the type name for the parameter class.
1785
1810
1786
1811
virtual QString asScriptCode() const;
1787
1812
1813
+ virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
1814
+
1788
1815
1789
1816
bool multiLine() const;
1790
1817
%Docstring
@@ -1887,6 +1914,8 @@ Returns the type name for the parameter class.
1887
1914
1888
1915
virtual QStringList dependsOnOtherParameters() const;
1889
1916
1917
+ virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
1918
+
1890
1919
1891
1920
QString parentLayerParameterName() const;
1892
1921
%Docstring
@@ -1985,6 +2014,8 @@ Returns the type name for the parameter class.
1985
2014
1986
2015
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
1987
2016
2017
+ virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
2018
+
1988
2019
1989
2020
virtual QVariantMap toVariantMap() const;
1990
2021
@@ -2080,6 +2111,8 @@ Returns the type name for the parameter class.
2080
2111
2081
2112
virtual QString asScriptCode() const;
2082
2113
2114
+ virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
2115
+
2083
2116
virtual QStringList dependsOnOtherParameters() const;
2084
2117
2085
2118
@@ -2171,6 +2204,8 @@ Returns the type name for the parameter class.
2171
2204
2172
2205
virtual QString asScriptCode() const;
2173
2206
2207
+ virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
2208
+
2174
2209
2175
2210
virtual QVariantMap toVariantMap() const;
2176
2211
@@ -2212,6 +2247,8 @@ output will not be created by default.
2212
2247
2213
2248
virtual bool fromVariantMap( const QVariantMap &map );
2214
2249
2250
+ virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
2251
+
2215
2252
2216
2253
virtual QgsProcessingOutputDefinition *toOutputDefinition() const = 0 /Factory/;
2217
2254
%Docstring
@@ -2321,6 +2358,8 @@ Returns the type name for the parameter class.
2321
2358
2322
2359
virtual QString defaultFileExtension() const;
2323
2360
2361
+ virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
2362
+
2324
2363
2325
2364
virtual QStringList supportedOutputVectorLayerExtensions() const;
2326
2365
%Docstring
@@ -2411,6 +2450,8 @@ Returns the type name for the parameter class.
2411
2450
2412
2451
virtual QString defaultFileExtension() const;
2413
2452
2453
+ virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
2454
+
2414
2455
2415
2456
virtual QStringList supportedOutputVectorLayerExtensions() const;
2416
2457
%Docstring
@@ -2551,6 +2592,8 @@ Returns the type name for the parameter class.
2551
2592
2552
2593
virtual QString defaultFileExtension() const;
2553
2594
2595
+ virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
2596
+
2554
2597
2555
2598
QString fileFilter() const;
2556
2599
%Docstring
@@ -2658,6 +2701,8 @@ Returns the type name for the parameter class.
2658
2701
2659
2702
virtual QStringList dependsOnOtherParameters() const;
2660
2703
2704
+ virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
2705
+
2661
2706
2662
2707
QString parentLayerParameterName() const;
2663
2708
%Docstring
0 commit comments