Skip to content
Permalink
Browse files

Mark some Processing methods as deprecated

  • Loading branch information
nyalldawson committed Mar 28, 2019
1 parent e798bfb commit 6ea4353bcc514f8bc09bdcd0820b6a9774c6ba61
@@ -273,6 +273,16 @@ def value(self):

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 @@ def value(self):

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 @@ def value(self):

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 @@ def value(self):

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 @@ def value(self):

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 @@ def value(self):

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 @@ def parentLayerChanged(self, wrapper):

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 @@ def parentParameterChanged(self, wrapper):

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 @@ def selectFile(self):
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 @@ def validator(v):

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 @@ def validator(v):
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 @@ def create_wrapper_from_metadata(param, dialog, row=0, col=0):
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 @@ def create_wrapper_from_class(param, dialog, row=0, col=0):
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:

0 comments on commit 6ea4353

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