Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
172 additions
and 120 deletions.
- +3 −4 python/plugins/processing/ProcessingPlugin.py
- +26 −38 python/plugins/processing/core/Processing.py
- +79 −0 python/plugins/processing/core/alglist.py
- +0 −13 python/plugins/processing/core/defaultproviders.py
- +3 −4 python/plugins/processing/gui/CommanderWindow.py
- +0 −8 python/plugins/processing/gui/ContextAction.py
- +3 −2 python/plugins/processing/gui/CreateNewScriptAction.py
- +3 −3 python/plugins/processing/gui/DeleteScriptAction.py
- +3 −3 python/plugins/processing/gui/EditScriptAction.py
- +7 −7 python/plugins/processing/gui/GetScriptsAndModels.py
- +9 −8 python/plugins/processing/gui/ProcessingToolbox.py
- +3 −3 python/plugins/processing/gui/ScriptEditorDialog.py
- +5 −4 python/plugins/processing/gui/menus.py
- +2 −1 python/plugins/processing/modeler/AddModelFromFileAction.py
- +2 −1 python/plugins/processing/modeler/CreateNewModelAction.py
- +2 −2 python/plugins/processing/modeler/DeleteModelAction.py
- +2 −2 python/plugins/processing/modeler/EditModelAction.py
- +4 −5 python/plugins/processing/modeler/ModelerAlgorithm.py
- +5 −5 python/plugins/processing/modeler/ModelerDialog.py
- +2 −2 python/plugins/processing/preconfigured/DeletePreconfiguredAlgorithmAction.py
- +2 −2 python/plugins/processing/preconfigured/PreconfiguredAlgorithm.py
- +4 −1 python/plugins/processing/preconfigured/PreconfiguredAlgorithmDialog.py
- +2 −1 python/plugins/processing/script/AddScriptFromFileAction.py
- +1 −1 python/plugins/processing/tools/general.py
@@ -0,0 +1,79 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
*************************************************************************** | ||
Processing.py | ||
--------------------- | ||
Date : August 2012 | ||
Copyright : (C) 2012 by Victor Olaya | ||
Email : volayaf at gmail dot com | ||
*************************************************************************** | ||
* * | ||
* 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. * | ||
* * | ||
*************************************************************************** | ||
""" | ||
|
||
__author__ = 'Victor Olaya' | ||
__date__ = 'August 2012' | ||
__copyright__ = '(C) 2012, Victor Olaya' | ||
|
||
# This will get replaced with a git SHA1 when you do a git archive | ||
|
||
__revision__ = '$Format:%H$' | ||
|
||
from qgis.PyQt.QtCore import QObject, pyqtSignal | ||
|
||
class AlgorithmList(QObject): | ||
|
||
providerAdded = pyqtSignal(str) | ||
providerRemoved = pyqtSignal(str) | ||
providerUpdated = pyqtSignal(str) | ||
|
||
# A dictionary of algorithms. Keys are names of providers | ||
# and values are list with all algorithms from that provider | ||
algs = {} | ||
|
||
providers = [] | ||
|
||
def removeProvider(self, providerName): | ||
for p in self.providers: | ||
if p.getName() == providerName: | ||
self.providers.remove(p) | ||
break | ||
self.algs.remove(providerName) | ||
self.providerRemoved.emit(providerName) | ||
|
||
def reloadProvider(self, providerName): | ||
for p in self.providers: | ||
if p.getName() == providerName: | ||
p.loadAlgorithms() | ||
self.algs[p.getName()] = {a.commandLineName(): a for a in p.algs} | ||
self.providerUpdated.emit(p.getName()) | ||
break | ||
|
||
def addProvider(self, provider): | ||
self.providers.append(provider) | ||
self.algs[provider.getName()] = {a.commandLineName(): a for a in provider.algs} | ||
self.providerAdded.emit(provider.getName()) | ||
|
||
def getProviderFromName(self, name): | ||
for provider in self.providers: | ||
if provider.getName() == name: | ||
return provider | ||
|
||
def getAlgorithm(self, name): | ||
for provider in self.algs.values(): | ||
if name in provider: | ||
return provider[name] | ||
|
||
def getAlgorithmFromFullName(self, name): | ||
for provider in self.algs.values(): | ||
for alg in provider.values(): | ||
if alg.name == name: | ||
return alg | ||
|
||
algList = AlgorithmList() |
Oops, something went wrong.