I'm working from the stock template script. I then add:
def postProcess(self, context, feedback):Obviously this isn't my actual goal for postProcess, but it's a way to verify if it ran since this should cause an error to be reported since feedback.pushInfo() expects a string, not an int. (I have verified this by using the same line in processAlgorithm().
feedback.pushInfo(2)
return {self.OUTPUT: dest_id}
I get no error, so I conclude that the method is not being called, but I don't understand why.
The docs say the postProcess:
Should be called in the main thread following the completion of runPrepared(). This method allows the algorithm to perform any required cleanup tasks. The returned variant map includes the results evaluated by the algorithm.I'm assuming that whatever mechanism is calling prepare() and runPrepared() is responsible for calling postProcess when a script is executed from the Processing Toolbox. Digging through the code this appears to be the run() and finished() methods of QgsProcessingAlgRunnerTask, but that's where I get lost digging into the source - I can't figure out where this task object is created and the methods invoked.
Thanks
David
_______________________________________________ QGIS-Developer mailing list [email protected] List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
