mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
[processing] remove explicit outputs definitions
This commit is contained in:
parent
73a8b80e59
commit
22fea14a17
@ -29,8 +29,8 @@ from qgis.core import (QgsProcessing,
|
||||
QgsProcessingParameterRasterLayer,
|
||||
QgsProcessingParameterBand,
|
||||
QgsProcessingParameterBoolean,
|
||||
QgsProcessingParameterFileDestination,
|
||||
QgsProcessingOutputFile)
|
||||
QgsProcessingParameterFileDestination
|
||||
)
|
||||
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
|
||||
from processing.algs.gdal.GdalUtils import GdalUtils
|
||||
from processing.tools.system import isWindows
|
||||
@ -58,7 +58,6 @@ class gdal2xyz(GdalAlgorithm):
|
||||
self.addParameter(QgsProcessingParameterFileDestination(self.OUTPUT,
|
||||
self.tr('XYZ ASCII file'),
|
||||
self.tr('CSV files (*.csv)')))
|
||||
self.addOutput(QgsProcessingOutputFile(self.OUTPUT, self.tr('XYZ ASCII file')))
|
||||
|
||||
def name(self):
|
||||
return 'gdal2xyz'
|
||||
|
@ -30,8 +30,7 @@ import os
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
from qgis.core import (QgsProcessingParameterRasterLayer,
|
||||
QgsProcessingParameterBoolean,
|
||||
QgsProcessingParameterFileDestination,
|
||||
QgsProcessingOutputHtml)
|
||||
QgsProcessingParameterFileDestination)
|
||||
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
|
||||
from processing.algs.gdal.GdalUtils import GdalUtils
|
||||
|
||||
@ -69,7 +68,6 @@ class gdalinfo(GdalAlgorithm):
|
||||
self.addParameter(QgsProcessingParameterFileDestination(self.OUTPUT,
|
||||
self.tr('Layer information'),
|
||||
self.tr('HTML files (*.html)')))
|
||||
self.addOutput(QgsProcessingOutputHtml(self.OUTPUT, self.tr('Layer information')))
|
||||
|
||||
def name(self):
|
||||
return 'gdalinfo'
|
||||
|
@ -28,8 +28,7 @@ __revision__ = '$Format:%H$'
|
||||
|
||||
from qgis.core import (QgsProcessingParameterVectorLayer,
|
||||
QgsProcessingParameterBoolean,
|
||||
QgsProcessingParameterFileDestination,
|
||||
QgsProcessingOutputHtml)
|
||||
QgsProcessingParameterFileDestination)
|
||||
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
|
||||
from processing.algs.gdal.GdalUtils import GdalUtils
|
||||
|
||||
@ -57,7 +56,6 @@ class ogrinfo(GdalAlgorithm):
|
||||
self.addParameter(QgsProcessingParameterFileDestination(self.OUTPUT,
|
||||
self.tr('Layer information'),
|
||||
self.tr('HTML files (*.html)')))
|
||||
self.addOutput(QgsProcessingOutputHtml(self.OUTPUT, self.tr('Layer information')))
|
||||
|
||||
def name(self):
|
||||
return 'ogrinfo'
|
||||
|
@ -59,10 +59,6 @@ from qgis.core import (Qgis,
|
||||
QgsProcessingParameterFileDestination,
|
||||
QgsProcessingParameterFile,
|
||||
QgsProcessingParameterFolderDestination,
|
||||
QgsProcessingOutputFolder,
|
||||
QgsProcessingOutputVectorLayer,
|
||||
QgsProcessingOutputRasterLayer,
|
||||
QgsProcessingOutputHtml,
|
||||
QgsProcessingUtils)
|
||||
from qgis.utils import iface
|
||||
|
||||
@ -178,10 +174,6 @@ class Grass7Algorithm(QgsProcessingAlgorithm):
|
||||
for p in self.params:
|
||||
# We use createOutput argument for automatic output creation
|
||||
res = self.addParameter(p, True)
|
||||
# File destinations are not automatically added as outputs
|
||||
if (isinstance(p, QgsProcessingParameterFileDestination)
|
||||
and p.defaultFileExtension().lower() == 'html'):
|
||||
self.addOutput(QgsProcessingOutputHtml(p.name(), p.description()))
|
||||
|
||||
def defineCharacteristicsFromFile(self):
|
||||
"""
|
||||
|
@ -31,8 +31,7 @@ import plotly.graph_objs as go
|
||||
|
||||
from qgis.core import (QgsProcessingParameterFeatureSource,
|
||||
QgsProcessingParameterField,
|
||||
QgsProcessingParameterFileDestination,
|
||||
QgsProcessingOutputHtml)
|
||||
QgsProcessingParameterFileDestination)
|
||||
from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm
|
||||
from processing.tools import vector
|
||||
|
||||
@ -65,8 +64,6 @@ class BarPlot(QgisAlgorithm):
|
||||
|
||||
self.addParameter(QgsProcessingParameterFileDestination(self.OUTPUT, self.tr('Bar plot'), self.tr('HTML files (*.html)')))
|
||||
|
||||
self.addOutput(QgsProcessingOutputHtml(self.OUTPUT, self.tr('Bar plot')))
|
||||
|
||||
def name(self):
|
||||
return 'barplot'
|
||||
|
||||
|
@ -38,7 +38,6 @@ from qgis.core import (QgsStatisticalSummary,
|
||||
QgsProcessingParameterFeatureSource,
|
||||
QgsProcessingParameterField,
|
||||
QgsProcessingParameterFileDestination,
|
||||
QgsProcessingOutputHtml,
|
||||
QgsProcessingOutputNumber)
|
||||
|
||||
from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm
|
||||
@ -98,7 +97,6 @@ class BasicStatisticsForField(QgisAlgorithm):
|
||||
None, self.INPUT_LAYER, QgsProcessingParameterField.Any))
|
||||
|
||||
self.addParameter(QgsProcessingParameterFileDestination(self.OUTPUT_HTML_FILE, self.tr('Statistics'), self.tr('HTML files (*.html)'), None, True))
|
||||
self.addOutput(QgsProcessingOutputHtml(self.OUTPUT_HTML_FILE, self.tr('Statistics')))
|
||||
|
||||
self.addOutput(QgsProcessingOutputNumber(self.COUNT, self.tr('Count')))
|
||||
self.addOutput(QgsProcessingOutputNumber(self.UNIQUE, self.tr('Number of unique values')))
|
||||
|
@ -32,7 +32,6 @@ from qgis.core import (QgsProcessingParameterFeatureSource,
|
||||
QgsProcessingParameterField,
|
||||
QgsProcessingParameterEnum,
|
||||
QgsProcessingParameterFileDestination,
|
||||
QgsProcessingOutputHtml,
|
||||
QgsFeatureRequest)
|
||||
from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm
|
||||
from processing.tools import vector
|
||||
@ -76,7 +75,6 @@ class BoxPlot(QgisAlgorithm):
|
||||
options=msd, defaultValue=0))
|
||||
|
||||
self.addParameter(QgsProcessingParameterFileDestination(self.OUTPUT, self.tr('Box plot'), self.tr('HTML files (*.html)')))
|
||||
self.addOutput(QgsProcessingOutputHtml(self.OUTPUT, self.tr('Box plot')))
|
||||
|
||||
def name(self):
|
||||
return 'boxplot'
|
||||
|
@ -31,8 +31,7 @@ import plotly.graph_objs as go
|
||||
from qgis.core import (QgsProcessingParameterFeatureSource,
|
||||
QgsProcessingParameterField,
|
||||
QgsProcessingUtils,
|
||||
QgsProcessingParameterFileDestination,
|
||||
QgsProcessingOutputHtml)
|
||||
QgsProcessingParameterFileDestination)
|
||||
from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm
|
||||
|
||||
from processing.tools import vector
|
||||
@ -64,7 +63,6 @@ class MeanAndStdDevPlot(QgisAlgorithm):
|
||||
self.tr('Value field'), parentLayerParameterName=self.INPUT))
|
||||
|
||||
self.addParameter(QgsProcessingParameterFileDestination(self.OUTPUT, self.tr('Plot'), self.tr('HTML files (*.html)')))
|
||||
self.addOutput(QgsProcessingOutputHtml(self.OUTPUT, self.tr('Plot')))
|
||||
|
||||
def name(self):
|
||||
return 'meanandstandarddeviationplot'
|
||||
|
@ -37,7 +37,6 @@ from qgis.core import (QgsFeatureRequest,
|
||||
QgsProcessing,
|
||||
QgsProcessingParameterFeatureSource,
|
||||
QgsProcessingParameterFileDestination,
|
||||
QgsProcessingOutputHtml,
|
||||
QgsProcessingOutputNumber,
|
||||
QgsSpatialIndex)
|
||||
|
||||
@ -73,7 +72,6 @@ class NearestNeighbourAnalysis(QgisAlgorithm):
|
||||
self.tr('Input layer'), [QgsProcessing.TypeVectorPoint]))
|
||||
|
||||
self.addParameter(QgsProcessingParameterFileDestination(self.OUTPUT_HTML_FILE, self.tr('Nearest neighbour'), self.tr('HTML files (*.html)'), None, True))
|
||||
self.addOutput(QgsProcessingOutputHtml(self.OUTPUT_HTML_FILE, self.tr('Nearest neighbour')))
|
||||
|
||||
self.addOutput(QgsProcessingOutputNumber(self.OBSERVED_MD,
|
||||
self.tr('Observed mean distance')))
|
||||
|
@ -31,8 +31,7 @@ import numpy as np
|
||||
|
||||
from qgis.core import (QgsProcessingParameterFeatureSource,
|
||||
QgsProcessingParameterField,
|
||||
QgsProcessingParameterFileDestination,
|
||||
QgsProcessingOutputHtml)
|
||||
QgsProcessingParameterFileDestination)
|
||||
from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm
|
||||
from processing.tools import vector
|
||||
|
||||
@ -62,7 +61,6 @@ class PolarPlot(QgisAlgorithm):
|
||||
self.tr('Value field'), parentLayerParameterName=self.INPUT))
|
||||
|
||||
self.addParameter(QgsProcessingParameterFileDestination(self.OUTPUT, self.tr('Polar plot'), self.tr('HTML files (*.html)')))
|
||||
self.addOutput(QgsProcessingOutputHtml(self.OUTPUT, self.tr('Polar plot')))
|
||||
|
||||
def name(self):
|
||||
return 'polarplot'
|
||||
|
@ -31,8 +31,7 @@ import plotly.graph_objs as go
|
||||
from qgis.core import (QgsProcessingParameterRasterLayer,
|
||||
QgsProcessingParameterBand,
|
||||
QgsProcessingParameterNumber,
|
||||
QgsProcessingParameterFileDestination,
|
||||
QgsProcessingOutputHtml)
|
||||
QgsProcessingParameterFileDestination)
|
||||
from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm
|
||||
from processing.tools import raster
|
||||
|
||||
@ -64,7 +63,6 @@ class RasterLayerHistogram(QgisAlgorithm):
|
||||
self.tr('number of bins'), minValue=2, defaultValue=10))
|
||||
|
||||
self.addParameter(QgsProcessingParameterFileDestination(self.OUTPUT, self.tr('Histogram'), self.tr('HTML files (*.html)')))
|
||||
self.addOutput(QgsProcessingOutputHtml(self.OUTPUT, self.tr('Histogram')))
|
||||
|
||||
def name(self):
|
||||
return 'rasterlayerhistogram'
|
||||
|
@ -32,7 +32,6 @@ from qgis.core import (QgsRectangle,
|
||||
QgsProcessingParameterRasterLayer,
|
||||
QgsProcessingParameterBand,
|
||||
QgsProcessingParameterFileDestination,
|
||||
QgsProcessingOutputHtml,
|
||||
QgsProcessingOutputNumber)
|
||||
from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm
|
||||
|
||||
@ -68,7 +67,6 @@ class RasterLayerStatistics(QgisAlgorithm):
|
||||
1,
|
||||
self.INPUT))
|
||||
self.addParameter(QgsProcessingParameterFileDestination(self.OUTPUT_HTML_FILE, self.tr('Statistics'), self.tr('HTML files (*.html)'), None, True))
|
||||
self.addOutput(QgsProcessingOutputHtml(self.OUTPUT_HTML_FILE, self.tr('Statistics')))
|
||||
|
||||
self.addOutput(QgsProcessingOutputNumber(self.MIN, self.tr('Minimum value')))
|
||||
self.addOutput(QgsProcessingOutputNumber(self.MAX, self.tr('Maximum value')))
|
||||
|
@ -42,8 +42,7 @@ from qgis.core import (QgsCoordinateReferenceSystem,
|
||||
QgsProcessingParameterFeatureSink,
|
||||
QgsProcessingOutputNumber,
|
||||
QgsProcessingOutputString,
|
||||
QgsProcessingParameterFileDestination,
|
||||
QgsProcessingOutputHtml)
|
||||
QgsProcessingParameterFileDestination)
|
||||
|
||||
from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm
|
||||
|
||||
@ -81,7 +80,6 @@ class UniqueValues(QgisAlgorithm):
|
||||
self.addParameter(QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Unique values'), optional=True, defaultValue=''))
|
||||
|
||||
self.addParameter(QgsProcessingParameterFileDestination(self.OUTPUT_HTML_FILE, self.tr('HTML report'), self.tr('HTML files (*.html)'), None, True))
|
||||
self.addOutput(QgsProcessingOutputHtml(self.OUTPUT_HTML_FILE, self.tr('HTML report')))
|
||||
self.addOutput(QgsProcessingOutputNumber(self.TOTAL_VALUES, self.tr('Total unique values')))
|
||||
self.addOutput(QgsProcessingOutputString(self.UNIQUE_VALUES, self.tr('Unique values')))
|
||||
|
||||
|
@ -31,8 +31,7 @@ import plotly.graph_objs as go
|
||||
from qgis.core import (QgsProcessingParameterFeatureSource,
|
||||
QgsProcessingParameterField,
|
||||
QgsProcessingParameterNumber,
|
||||
QgsProcessingParameterFileDestination,
|
||||
QgsProcessingOutputHtml)
|
||||
QgsProcessingParameterFileDestination)
|
||||
from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm
|
||||
from processing.tools import vector
|
||||
|
||||
@ -63,7 +62,6 @@ class VectorLayerHistogram(QgisAlgorithm):
|
||||
self.tr('number of bins'), minValue=2, defaultValue=10))
|
||||
|
||||
self.addParameter(QgsProcessingParameterFileDestination(self.OUTPUT, self.tr('Histogram'), self.tr('HTML files (*.html)')))
|
||||
self.addOutput(QgsProcessingOutputHtml(self.OUTPUT, self.tr('Histogram')))
|
||||
|
||||
def name(self):
|
||||
return 'vectorlayerhistogram'
|
||||
|
@ -31,8 +31,7 @@ import plotly.graph_objs as go
|
||||
from qgis.core import (QgsProcessingParameterFeatureSource,
|
||||
QgsProcessingParameterField,
|
||||
QgsProcessingUtils,
|
||||
QgsProcessingParameterFileDestination,
|
||||
QgsProcessingOutputHtml)
|
||||
QgsProcessingParameterFileDestination)
|
||||
from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm
|
||||
from processing.tools import vector
|
||||
|
||||
@ -66,7 +65,6 @@ class VectorLayerScatterplot(QgisAlgorithm):
|
||||
type=QgsProcessingParameterField.Numeric))
|
||||
|
||||
self.addParameter(QgsProcessingParameterFileDestination(self.OUTPUT, self.tr('Scatterplot'), self.tr('HTML files (*.html)')))
|
||||
self.addOutput(QgsProcessingOutputHtml(self.OUTPUT, self.tr('Scatterplot')))
|
||||
|
||||
def name(self):
|
||||
return 'vectorlayerscatterplot'
|
||||
|
@ -31,7 +31,6 @@ import plotly.graph_objs as go
|
||||
from qgis.core import (QgsProcessingParameterFeatureSource,
|
||||
QgsProcessingParameterField,
|
||||
QgsProcessingParameterFileDestination,
|
||||
QgsProcessingOutputHtml,
|
||||
QgsProcessingUtils)
|
||||
from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm
|
||||
|
||||
@ -72,7 +71,6 @@ class VectorLayerScatterplot3D(QgisAlgorithm):
|
||||
type=QgsProcessingParameterField.Numeric))
|
||||
|
||||
self.addParameter(QgsProcessingParameterFileDestination(self.OUTPUT, self.tr('Histogram'), self.tr('HTML files (*.html)')))
|
||||
self.addOutput(QgsProcessingOutputHtml(self.OUTPUT, self.tr('Histogram')))
|
||||
|
||||
def name(self):
|
||||
return 'scatter3dplot'
|
||||
|
Loading…
x
Reference in New Issue
Block a user