Skip to content
Permalink
Browse files

[processing] Flag a bunch of algorithms to hide them from qgis_process

  • Loading branch information
nyalldawson committed Jul 29, 2020
1 parent 937a41a commit 687398415b1d8892481f43486c20f7f93dc2e84a
@@ -68,7 +68,7 @@ def __init__(self):
super().__init__()

def flags(self):
return super().flags() | QgsProcessingAlgorithm.FlagNoThreading
return super().flags() | QgsProcessingAlgorithm.FlagNoThreading | QgsProcessingAlgorithm.FlagNotAvailableInStandaloneTool

def initAlgorithm(self, config=None):
self.modes = [self.tr('Largest Area'),
@@ -43,7 +43,6 @@
QgsProcessingParameterFeatureSink)

from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm
from processing.tools import vector

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]

@@ -32,7 +32,8 @@
QgsProcessingContext,
QgsProcessingParameterProviderConnection,
QgsProviderRegistry,
QgsProviderConnectionException
QgsProviderConnectionException,
QgsProcessingAlgorithm
)
from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm

@@ -53,6 +54,9 @@ def groupId(self):
def __init__(self):
super().__init__()

def flags(self):
return super().flags() | QgsProcessingAlgorithm.FlagNotAvailableInStandaloneTool

def initAlgorithm(self, config=None):
db_param = QgsProcessingParameterProviderConnection(
self.DATABASE,
@@ -60,7 +60,7 @@ def groupId(self):
return 'vectorselection'

def flags(self):
return super().flags() | QgsProcessingAlgorithm.FlagNoThreading
return super().flags() | QgsProcessingAlgorithm.FlagNoThreading | QgsProcessingAlgorithm.FlagNotAvailableInStandaloneTool

def __init__(self):
super().__init__()
@@ -66,7 +66,7 @@ def __init__(self):
super().__init__()

def flags(self):
return super().flags() | QgsProcessingAlgorithm.FlagNoThreading
return super().flags() | QgsProcessingAlgorithm.FlagNoThreading | QgsProcessingAlgorithm.FlagNotAvailableInStandaloneTool

def initAlgorithm(self, config=None):
self.methods = [self.tr('Number of selected features'),
@@ -72,7 +72,7 @@ def __init__(self):
super().__init__()

def flags(self):
return super().flags() | QgsProcessingAlgorithm.FlagNoThreading
return super().flags() | QgsProcessingAlgorithm.FlagNoThreading | QgsProcessingAlgorithm.FlagNotAvailableInStandaloneTool

def initAlgorithm(self, config=None):
self.operators = ['=',
@@ -48,7 +48,7 @@ def __init__(self):
super().__init__()

def flags(self):
return super().flags() | QgsProcessingAlgorithm.FlagNoThreading
return super().flags() | QgsProcessingAlgorithm.FlagNoThreading | QgsProcessingAlgorithm.FlagNotAvailableInStandaloneTool

def initAlgorithm(self, config=None):
self.methods = [self.tr('creating new selection'),
@@ -47,7 +47,7 @@ def __init__(self):
super().__init__()

def flags(self):
return super().flags() | QgsProcessingAlgorithm.FlagNoThreading | QgsProcessingAlgorithm.FlagDeprecated
return super().flags() | QgsProcessingAlgorithm.FlagNoThreading | QgsProcessingAlgorithm.FlagDeprecated | QgsProcessingAlgorithm.FlagNotAvailableInStandaloneTool

def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterRasterLayer(self.INPUT,
@@ -43,7 +43,7 @@ def __init__(self):
super().__init__()

def flags(self):
return super().flags() | QgsProcessingAlgorithm.FlagNoThreading | QgsProcessingAlgorithm.FlagDeprecated
return super().flags() | QgsProcessingAlgorithm.FlagNoThreading | QgsProcessingAlgorithm.FlagDeprecated | QgsProcessingAlgorithm.FlagNotAvailableInStandaloneTool

def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterVectorLayer(self.INPUT,
@@ -51,6 +51,13 @@ void QgsCategorizeUsingStyleAlgorithm::initAlgorithm( const QVariantMap & )
addParameter( failSymbols.release() );
}

QgsProcessingAlgorithm::Flags QgsCategorizeUsingStyleAlgorithm::flags() const
{
Flags f = QgsProcessingAlgorithm::flags();
f |= FlagNotAvailableInStandaloneTool;
return f;
}

QString QgsCategorizeUsingStyleAlgorithm::name() const
{
return QStringLiteral( "categorizeusingstyle" );
@@ -38,6 +38,7 @@ class QgsCategorizeUsingStyleAlgorithm : public QgsProcessingAlgorithm
QgsCategorizeUsingStyleAlgorithm();
~QgsCategorizeUsingStyleAlgorithm() override;
void initAlgorithm( const QVariantMap &configuration = QVariantMap() ) override;
Flags flags() const override;
QString name() const override;
QString displayName() const override;
QStringList tags() const override;
@@ -369,7 +369,7 @@ QString QgsSelectByLocationAlgorithm::name() const

QgsProcessingAlgorithm::Flags QgsSelectByLocationAlgorithm::flags() const
{
return QgsProcessingAlgorithm::flags() | QgsProcessingAlgorithm::FlagNoThreading;
return QgsProcessingAlgorithm::flags() | QgsProcessingAlgorithm::FlagNoThreading | QgsProcessingAlgorithm::FlagNotAvailableInStandaloneTool;
}

QString QgsSelectByLocationAlgorithm::displayName() const
@@ -26,7 +26,7 @@ QString QgsLoadLayerAlgorithm::name() const

QgsProcessingAlgorithm::Flags QgsLoadLayerAlgorithm::flags() const
{
return FlagHideFromToolbox;
return FlagHideFromToolbox | FlagNotAvailableInStandaloneTool;
}

QString QgsLoadLayerAlgorithm::displayName() const
@@ -27,7 +27,9 @@ QString QgsSetProjectVariableAlgorithm::name() const

QgsProcessingAlgorithm::Flags QgsSetProjectVariableAlgorithm::flags() const
{
return QgsProcessingAlgorithm::FlagHideFromToolbox | QgsProcessingAlgorithm::FlagSkipGenericModelLogging;
return QgsProcessingAlgorithm::FlagHideFromToolbox
| QgsProcessingAlgorithm::FlagSkipGenericModelLogging
| QgsProcessingAlgorithm::FlagNotAvailableInStandaloneTool;
}

QString QgsSetProjectVariableAlgorithm::displayName() const

0 comments on commit 6873984

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