Skip to content
Permalink
Browse files

[needs-docs][processing] Monkey patch stable external Processing API …

…into qgis.processing

Instead of encouraging use of the internal Processing modules
(e.g. from processing.tools.general import run , import processing, ...)
instead expose all Python specific STABLE processing additions
to the qgis.processing module.

Instead, scripts and plugins should now use

from qgis.processing import run, algorithmHelp,...

This makes a clear distinction between internal Processing python
modules (i.e., everything else!) and the parts of Processing
which are stable and designed to be used by plugins and scripts.

TODO: QGIS 4.0 -- move the internal Processing plugin modules
to __processing, to clearer indicate that this is all internal
stuff.
  • Loading branch information
nyalldawson committed Mar 26, 2019
1 parent a83cda8 commit 174dbbce6d318ef3de007bb0d3d7e998eed0edde
Showing with 11 additions and 0 deletions.
  1. +11 −0 python/plugins/processing/__init__.py
@@ -31,6 +31,17 @@
from processing.tools.raster import * # NOQA
from processing.tools.system import * # NOQA

# monkey patch Python specific Processing API into stable qgis.processing module
import qgis.processing
qgis.processing.algorithmHelp = algorithmHelp
qgis.processing.run = run
qgis.processing.runAndLoadResults = runAndLoadResults
qgis.processing.createAlgorithmDialog = createAlgorithmDialog
qgis.processing.execAlgorithmDialog = execAlgorithmDialog
qgis.processing.createContext = createContext
qgis.processing.isWindows = isWindows
qgis.processing.isMac = isMac


def classFactory(iface):
from processing.ProcessingPlugin import ProcessingPlugin

0 comments on commit 174dbbc

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