Skip to content

Commit 174dbbc

Browse files
committed
[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.
1 parent a83cda8 commit 174dbbc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

python/plugins/processing/__init__.py

+11
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@
3131
from processing.tools.raster import * # NOQA
3232
from processing.tools.system import * # NOQA
3333

34+
# monkey patch Python specific Processing API into stable qgis.processing module
35+
import qgis.processing
36+
qgis.processing.algorithmHelp = algorithmHelp
37+
qgis.processing.run = run
38+
qgis.processing.runAndLoadResults = runAndLoadResults
39+
qgis.processing.createAlgorithmDialog = createAlgorithmDialog
40+
qgis.processing.execAlgorithmDialog = execAlgorithmDialog
41+
qgis.processing.createContext = createContext
42+
qgis.processing.isWindows = isWindows
43+
qgis.processing.isMac = isMac
44+
3445

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

0 commit comments

Comments
 (0)