Skip to content

Commit

Permalink
Fix dropping processing script algorithm .py file on QGIS no longer
Browse files Browse the repository at this point in the history
triggers the algorithm to execute
  • Loading branch information
nyalldawson committed Oct 6, 2020
1 parent 384f6a1 commit 64bf347
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions python/utils.py
Expand Up @@ -826,7 +826,7 @@ def run_script_from_file(filepath):
from qgis.processing import alg
try:
from qgis.core import QgsApplication, QgsProcessingAlgorithm, QgsProcessingFeatureBasedAlgorithm
from processing.gui.AlgorithmDialog import AlgorithmDialog
from qgis.processing import execAlgorithmDialog
_locals = {}
exec(open(filepath.replace("\\\\", "/").encode(sys.getfilesystemencoding())).read(), _locals)
alginstance = None
Expand All @@ -840,7 +840,6 @@ def run_script_from_file(filepath):
if alginstance:
alginstance.setProvider(QgsApplication.processingRegistry().providerById("script"))
alginstance.initAlgorithm()
dlg = AlgorithmDialog(alginstance)
dlg.show()
execAlgorithmDialog(alginstance)
except ImportError:
pass

0 comments on commit 64bf347

Please sign in to comment.