|
39 | 39 | from qgis.core import (QgsMessageLog,
|
40 | 40 | QgsApplication,
|
41 | 41 | QgsProcessingProvider,
|
42 |
| - QgsProcessingUtils, |
| 42 | + QgsProcessingAlgorithm, |
43 | 43 | QgsProcessingParameterDefinition)
|
44 | 44 |
|
45 | 45 | import processing
|
@@ -123,7 +123,7 @@ def removeScripts(folder):
|
123 | 123 |
|
124 | 124 | @staticmethod
|
125 | 125 | def runAlgorithm(algOrName, onFinish, *args, **kwargs):
|
126 |
| - if isinstance(algOrName, GeoAlgorithm): |
| 126 | + if isinstance(algOrName, QgsProcessingAlgorithm): |
127 | 127 | alg = algOrName
|
128 | 128 | else:
|
129 | 129 | alg = QgsApplication.processingRegistry().algorithmById(algOrName)
|
@@ -164,36 +164,6 @@ def runAlgorithm(algOrName, onFinish, *args, **kwargs):
|
164 | 164 | Processing.tr('Error: Missing parameter value for parameter {0}.').format(param.name()),
|
165 | 165 | Processing.tr("Processing"))
|
166 | 166 | return
|
167 |
| - else: |
168 |
| - if len(args) != alg.countVisibleParameters(): |
169 |
| - # fix_print_with_import |
170 |
| - print('Error: Wrong number of parameters') |
171 |
| - QgsMessageLog.logMessage(Processing.tr('Error: Wrong number of parameters'), |
172 |
| - Processing.tr("Processing")) |
173 |
| - processing.algorithmHelp(algOrName) |
174 |
| - return |
175 |
| - i = 0 |
176 |
| - for param in alg.parameterDefinitions(): |
177 |
| - if not param.flags() & QgsProcessingParameterDefinition.FlagHidden: |
178 |
| - if not True: # TODO param.setValue(args[i]): |
179 |
| - # fix_print_with_import |
180 |
| - print('Error: Wrong parameter value: ' + str(args[i])) |
181 |
| - QgsMessageLog.logMessage(Processing.tr('Error: Wrong parameter value: ') + str(args[i]), |
182 |
| - Processing.tr("Processing")) |
183 |
| - return |
184 |
| - else: |
185 |
| - parameters[param.name()] = args[i] |
186 |
| - i = i + 1 |
187 |
| - |
188 |
| - for output in alg.outputs: |
189 |
| - if not output.flags() & QgsProcessingParameterDefinition.FlagHidden: |
190 |
| - if not output.setValue(args[i]): |
191 |
| - # fix_print_with_import |
192 |
| - print('Error: Wrong output value: ' + str(args[i])) |
193 |
| - QgsMessageLog.logMessage(Processing.tr('Error: Wrong output value: ') + str(args[i]), |
194 |
| - Processing.tr("Processing")) |
195 |
| - return |
196 |
| - i = i + 1 |
197 | 167 |
|
198 | 168 | feedback = None
|
199 | 169 | if kwargs is not None and "feedback" in list(kwargs.keys()):
|
|
0 commit comments