Skip to content

Instantly share code, notes, and snippets.

@ghtmtt
Created January 16, 2023 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghtmtt/b1be418c9630e36b8af04011b82a642e to your computer and use it in GitHub Desktop.
Save ghtmtt/b1be418c9630e36b8af04011b82a642e to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
"""
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************
"""
from qgis.PyQt.QtCore import QCoreApplication
from qgis.core import (QgsProcessing,
QgsProcessingParameterEnum,
QgsProcessingAlgorithm,
)
class ExampleProcessingAlgorithm2(QgsProcessingAlgorithm):
INPUT = 'INPUT'
def tr(self, string):
return QCoreApplication.translate('Processing', string)
def createInstance(self):
return ExampleProcessingAlgorithm2()
def name(self):
return 'myscript2'
def displayName(self):
return self.tr('My Script2')
def group(self):
return self.tr('Example scripts 2')
def groupId(self):
return 'examplescripts'
def initAlgorithm(self, config=None):
self.addParameter(
QgsProcessingParameterEnum(
self.INPUT,
self.tr('Enum'),
allowMultiple=True
)
)
def processAlgorithm(self, parameters, context, feedback):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment