mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
GRASS: add ext module for v.reclass
In order to check that either 'rules' or 'column' parameter is set
This commit is contained in:
parent
d802294787
commit
5377930242
31
python/plugins/grassprovider/ext/v_reclass.py
Normal file
31
python/plugins/grassprovider/ext/v_reclass.py
Normal file
@ -0,0 +1,31 @@
|
||||
"""
|
||||
***************************************************************************
|
||||
v_reclass.py
|
||||
----------
|
||||
Date : June 2023
|
||||
Copyright : (C) 2023 by Andrea Giudiceandrea
|
||||
Email : andreaerdna at libero dot it
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* any later version. *
|
||||
* *
|
||||
***************************************************************************
|
||||
"""
|
||||
|
||||
__author__ = 'Andrea Giudiceandrea'
|
||||
__date__ = 'June 2023'
|
||||
__copyright__ = '(C) 2023, Andrea Giudiceandrea'
|
||||
|
||||
|
||||
def checkParameterValuesBeforeExecuting(alg, parameters, context):
|
||||
""" Verify if we have the right parameters """
|
||||
# rules and column parameters are mutually exclusive
|
||||
rules = alg.parameterAsString(parameters, 'rules', context)
|
||||
column = alg.parameterAsString(parameters, 'column', context)
|
||||
if (rules and column) or (not rules and not column):
|
||||
return False, alg.tr("You need to set either a rules file or a column!")
|
||||
|
||||
return True, None
|
Loading…
x
Reference in New Issue
Block a user