Skip to content
Permalink
Browse files

First steps in resurrecting script algorithms

  • Loading branch information
nyalldawson committed Jun 26, 2017
1 parent 60f80f9 commit f13920bb19ba970b225a5d586bcca4237fd5cddc
@@ -293,7 +293,7 @@ def getAlgs(self):
scripts = ScriptUtils.loadFromFolder(folder)
for script in scripts:
script.allowEdit = False
#algs.extend(scripts)
algs.extend(scripts)

return algs

@@ -35,7 +35,10 @@
QgsProject,
QgsApplication,
QgsMessageLog,
QgsProcessingUtils)
QgsProcessingUtils,
QgsProcessingAlgorithm)

from qgis.PyQt.QtCore import (QCoreApplication)

from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.gui.Help2Html import getHtmlFromHelpFile
@@ -46,7 +49,7 @@
pluginPath = os.path.split(os.path.dirname(__file__))[0]


class ScriptAlgorithm(GeoAlgorithm):
class ScriptAlgorithm(QgsProcessingAlgorithm):

def __init__(self, descriptionFile, script=None):
"""The script parameter can be used to directly pass the code
@@ -56,7 +59,7 @@ def __init__(self, descriptionFile, script=None):
not be used in other cases.
"""

GeoAlgorithm.__init__(self)
super().__init__()
self._icon = QgsApplication.getThemeIcon("/processingScript.svg")
self._name = ''
self._display_name = ''
@@ -236,3 +239,8 @@ def getParameterDescriptions(self):
except:
return descs
return descs

def tr(self, string, context=''):
if context == '':
context = self.__class__.__name__
return QCoreApplication.translate(context, string)

0 comments on commit f13920b

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