Skip to content
Permalink
Browse files

Mark some Processing methods as deprecated

  • Loading branch information
nyalldawson committed Mar 28, 2019
1 parent a39822f commit 76afba754fb2968adf0ac416016a870922fbcbc1
@@ -272,6 +272,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
@@ -312,6 +322,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()
@@ -457,6 +477,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())
@@ -505,6 +535,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,
@@ -571,6 +611,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())
@@ -767,6 +817,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())
@@ -798,6 +858,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())
@@ -834,6 +904,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))
@@ -1032,6 +1112,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
@@ -1270,6 +1360,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():
@@ -1366,6 +1466,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()

@@ -1879,28 +1987,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
@@ -1913,8 +2030,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 76afba7

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