Skip to content

Commit

Permalink
Add Python annotations and remove args kwargs from Python methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry authored and github-actions[bot] committed Dec 12, 2024
1 parent f9f79e1 commit ce8312a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions docs/pyqgis_developer_cookbook/processing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,34 +91,38 @@ If you want to add your existing plugin to Processing, you need to add some code
:skipif: True

from qgis.core import QgsProcessingProvider
from qgis.PyQt.QtGui import QIcon

from .example_processing_algorithm import ExampleProcessingAlgorithm


class Provider(QgsProcessingProvider):

def loadAlgorithms(self, *args, **kwargs):
""" The provider of our plugin. """

def loadAlgorithms(self):
""" Load each algorithm into the current provider. """
self.addAlgorithm(ExampleProcessingAlgorithm())
# add additional algorithms here
# self.addAlgorithm(MyOtherAlgorithm())

def id(self, *args, **kwargs):
def id(self) -> str:
"""The ID of your plugin, used for identifying the provider.

This string should be a unique, short, character only string,
eg "qgis" or "gdal". This string should not be localised.
"""
return 'yourplugin'

def name(self, *args, **kwargs):
def name(self) -> str:
"""The human friendly name of your plugin in Processing.

This string should be as short as possible (e.g. "Lastools", not
"Lastools version 1.0.1 64-bit") and localised.
"""
return self.tr('Your plugin')

def icon(self):
def icon(self) -> QIcon:
"""Should return a QIcon which is used for your provider inside
the Processing toolbox.
"""
Expand Down

0 comments on commit ce8312a

Please sign in to comment.