mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Mark some Processing methods as deprecated
This commit is contained in:
parent
7aca208522
commit
234c1718c4
@ -273,6 +273,16 @@ class BasicWidgetWrapper(WidgetWrapper):
|
||||
|
||||
class BooleanWidgetWrapper(WidgetWrapper):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
"""
|
||||
.. deprecated:: 3.4
|
||||
Do not use, will be removed in QGIS 4.0
|
||||
"""
|
||||
|
||||
from warnings import warn
|
||||
warn("BooleanWidgetWrapper is deprecated and will be removed in QGIS 4.0", DeprecationWarning)
|
||||
|
||||
def createLabel(self):
|
||||
if self.dialogType == DIALOG_STANDARD:
|
||||
return None
|
||||
@ -313,6 +323,16 @@ class BooleanWidgetWrapper(WidgetWrapper):
|
||||
|
||||
class CrsWidgetWrapper(WidgetWrapper):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
"""
|
||||
.. deprecated:: 3.4
|
||||
Do not use, will be removed in QGIS 4.0
|
||||
"""
|
||||
|
||||
from warnings import warn
|
||||
warn("CrsWidgetWrapper is deprecated and will be removed in QGIS 4.0", DeprecationWarning)
|
||||
|
||||
def createWidget(self):
|
||||
if self.dialogType == DIALOG_MODELER:
|
||||
self.combo = QComboBox()
|
||||
@ -458,6 +478,16 @@ class ExtentWidgetWrapper(WidgetWrapper):
|
||||
|
||||
class PointWidgetWrapper(WidgetWrapper):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
"""
|
||||
.. deprecated:: 3.4
|
||||
Do not use, will be removed in QGIS 4.0
|
||||
"""
|
||||
|
||||
from warnings import warn
|
||||
warn("PointWidgetWrapper is deprecated and will be removed in QGIS 4.0", DeprecationWarning)
|
||||
|
||||
def createWidget(self):
|
||||
if self.dialogType in (DIALOG_STANDARD, DIALOG_BATCH):
|
||||
return PointSelectionPanel(self.dialog, self.parameterDefinition().defaultValue())
|
||||
@ -506,6 +536,16 @@ class PointWidgetWrapper(WidgetWrapper):
|
||||
|
||||
class FileWidgetWrapper(WidgetWrapper):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
"""
|
||||
.. deprecated:: 3.4
|
||||
Do not use, will be removed in QGIS 4.0
|
||||
"""
|
||||
|
||||
from warnings import warn
|
||||
warn("FileWidgetWrapper is deprecated and will be removed in QGIS 4.0", DeprecationWarning)
|
||||
|
||||
def createWidget(self):
|
||||
if self.dialogType in (DIALOG_STANDARD, DIALOG_BATCH):
|
||||
return FileSelectionPanel(self.parameterDefinition().behavior() == QgsProcessingParameterFile.Folder,
|
||||
@ -572,6 +612,16 @@ class FileWidgetWrapper(WidgetWrapper):
|
||||
|
||||
class FixedTableWidgetWrapper(WidgetWrapper):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
"""
|
||||
.. deprecated:: 3.4
|
||||
Do not use, will be removed in QGIS 4.0
|
||||
"""
|
||||
|
||||
from warnings import warn
|
||||
warn("FixedTableWidgetWrapper is deprecated and will be removed in QGIS 4.0", DeprecationWarning)
|
||||
|
||||
def createWidget(self):
|
||||
if self.dialogType in (DIALOG_STANDARD, DIALOG_BATCH):
|
||||
return FixedTablePanel(self.parameterDefinition())
|
||||
@ -768,6 +818,16 @@ class MultipleLayerWidgetWrapper(WidgetWrapper):
|
||||
|
||||
class NumberWidgetWrapper(WidgetWrapper):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
"""
|
||||
.. deprecated:: 3.4
|
||||
Do not use, will be removed in QGIS 4.0
|
||||
"""
|
||||
|
||||
from warnings import warn
|
||||
warn("NumberWidgetWrapper is deprecated and will be removed in QGIS 4.0", DeprecationWarning)
|
||||
|
||||
def createWidget(self):
|
||||
if self.dialogType in (DIALOG_STANDARD, DIALOG_BATCH):
|
||||
widget = NumberInputPanel(self.parameterDefinition())
|
||||
@ -799,6 +859,16 @@ class NumberWidgetWrapper(WidgetWrapper):
|
||||
|
||||
class DistanceWidgetWrapper(WidgetWrapper):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
"""
|
||||
.. deprecated:: 3.4
|
||||
Do not use, will be removed in QGIS 4.0
|
||||
"""
|
||||
|
||||
from warnings import warn
|
||||
warn("DistanceWidgetWrapper is deprecated and will be removed in QGIS 4.0", DeprecationWarning)
|
||||
|
||||
def createWidget(self):
|
||||
if self.dialogType in (DIALOG_STANDARD, DIALOG_BATCH):
|
||||
widget = DistanceInputPanel(self.parameterDefinition())
|
||||
@ -835,6 +905,16 @@ class DistanceWidgetWrapper(WidgetWrapper):
|
||||
|
||||
class RangeWidgetWrapper(WidgetWrapper):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
"""
|
||||
.. deprecated:: 3.4
|
||||
Do not use, will be removed in QGIS 4.0
|
||||
"""
|
||||
|
||||
from warnings import warn
|
||||
warn("RangeWidgetWrapper is deprecated and will be removed in QGIS 4.0", DeprecationWarning)
|
||||
|
||||
def createWidget(self):
|
||||
widget = RangePanel(self.parameterDefinition())
|
||||
widget.hasChanged.connect(lambda: self.widgetValueHasChanged.emit(self))
|
||||
@ -1033,6 +1113,16 @@ class MeshWidgetWrapper(MapLayerWidgetWrapper):
|
||||
class EnumWidgetWrapper(WidgetWrapper):
|
||||
NOT_SELECTED = '[Not selected]'
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
"""
|
||||
.. deprecated:: 3.4
|
||||
Do not use, will be removed in QGIS 4.0
|
||||
"""
|
||||
|
||||
from warnings import warn
|
||||
warn("EnumWidgetWrapper is deprecated and will be removed in QGIS 4.0", DeprecationWarning)
|
||||
|
||||
def createWidget(self, useCheckBoxes=False, columns=1):
|
||||
if self.dialogType in (DIALOG_STANDARD, DIALOG_BATCH):
|
||||
self._useCheckBoxes = useCheckBoxes
|
||||
@ -1271,6 +1361,16 @@ class FeatureSourceWidgetWrapper(WidgetWrapper):
|
||||
|
||||
class StringWidgetWrapper(WidgetWrapper):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
"""
|
||||
.. deprecated:: 3.4
|
||||
Do not use, will be removed in QGIS 4.0
|
||||
"""
|
||||
|
||||
from warnings import warn
|
||||
warn("StringWidgetWrapper is deprecated and will be removed in QGIS 4.0", DeprecationWarning)
|
||||
|
||||
def createWidget(self):
|
||||
if self.dialogType == DIALOG_STANDARD:
|
||||
if self.parameterDefinition().multiLine():
|
||||
@ -1367,6 +1467,14 @@ class StringWidgetWrapper(WidgetWrapper):
|
||||
class ExpressionWidgetWrapper(WidgetWrapper):
|
||||
|
||||
def __init__(self, param, dialog, row=0, col=0, **kwargs):
|
||||
"""
|
||||
.. deprecated:: 3.4
|
||||
Do not use, will be removed in QGIS 4.0
|
||||
"""
|
||||
|
||||
from warnings import warn
|
||||
warn("StringWidgetWrapper is deprecated and will be removed in QGIS 4.0", DeprecationWarning)
|
||||
|
||||
super().__init__(param, dialog, row, col, **kwargs)
|
||||
self.context = dataobjects.createContext()
|
||||
|
||||
@ -1881,28 +1989,37 @@ class WidgetWrapperFactory:
|
||||
def create_wrapper_from_class(param, dialog, row=0, col=0):
|
||||
wrapper = None
|
||||
if param.type() == 'boolean':
|
||||
# deprecated, moved to c++
|
||||
wrapper = BooleanWidgetWrapper
|
||||
elif param.type() == 'crs':
|
||||
# deprecated, moved to c++
|
||||
wrapper = CrsWidgetWrapper
|
||||
elif param.type() == 'extent':
|
||||
wrapper = ExtentWidgetWrapper
|
||||
elif param.type() == 'point':
|
||||
# deprecated, moved to c++
|
||||
wrapper = PointWidgetWrapper
|
||||
elif param.type() == 'file':
|
||||
# deprecated, moved to c++
|
||||
wrapper = FileWidgetWrapper
|
||||
elif param.type() == 'multilayer':
|
||||
wrapper = MultipleLayerWidgetWrapper
|
||||
elif param.type() == 'number':
|
||||
# deprecated, moved to c++
|
||||
wrapper = NumberWidgetWrapper
|
||||
elif param.type() == 'distance':
|
||||
# deprecated, moved to c++
|
||||
wrapper = DistanceWidgetWrapper
|
||||
elif param.type() == 'raster':
|
||||
wrapper = RasterWidgetWrapper
|
||||
elif param.type() == 'enum':
|
||||
# deprecated, moved to c++
|
||||
wrapper = EnumWidgetWrapper
|
||||
elif param.type() == 'string':
|
||||
# deprecated, moved to c++
|
||||
wrapper = StringWidgetWrapper
|
||||
elif param.type() == 'expression':
|
||||
# deprecated, moved to c++
|
||||
wrapper = ExpressionWidgetWrapper
|
||||
elif param.type() == 'vector':
|
||||
wrapper = VectorLayerWidgetWrapper
|
||||
@ -1915,8 +2032,10 @@ class WidgetWrapperFactory:
|
||||
elif param.type() == 'layer':
|
||||
wrapper = MapLayerWidgetWrapper
|
||||
elif param.type() == 'range':
|
||||
# deprecated, moved to c++
|
||||
wrapper = RangeWidgetWrapper
|
||||
elif param.type() == 'matrix':
|
||||
# deprecated, moved to c++
|
||||
wrapper = FixedTableWidgetWrapper
|
||||
elif param.type() == 'mesh':
|
||||
wrapper = MeshWidgetWrapper
|
||||
|
@ -105,8 +105,15 @@ def createExpressionContext():
|
||||
|
||||
|
||||
def load(fileName, name=None, crs=None, style=None, isRaster=False):
|
||||
"""Loads a layer/table into the current project, given its file.
|
||||
"""
|
||||
Loads a layer/table into the current project, given its file.
|
||||
|
||||
.. deprecated:: 3.0
|
||||
Do not use, will be removed in QGIS 4.0
|
||||
"""
|
||||
|
||||
from warnings import warn
|
||||
warn("processing.load is deprecated and will be removed in QGIS 4.0", DeprecationWarning)
|
||||
|
||||
if fileName is None:
|
||||
return
|
||||
|
@ -118,6 +118,14 @@ def tempHelpFolder():
|
||||
|
||||
|
||||
def escapeAndJoin(strList):
|
||||
"""
|
||||
.. deprecated:: 3.0
|
||||
Do not use, will be removed in QGIS 4.0
|
||||
"""
|
||||
|
||||
from warnings import warn
|
||||
warn("processing.escapeAndJoin is deprecated and will be removed in QGIS 4.0", DeprecationWarning)
|
||||
|
||||
joined = ''
|
||||
for s in strList:
|
||||
if s[0] != '-' and ' ' in s:
|
||||
|
Loading…
x
Reference in New Issue
Block a user