|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | + |
| 3 | +""" |
| 4 | +*************************************************************************** |
| 5 | + r_drain.py |
| 6 | + ---------- |
| 7 | + Date : February 2016 |
| 8 | + Copyright : (C) 2016 by Médéric Ribreux |
| 9 | + Email : medspx at medspx dot fr |
| 10 | +*************************************************************************** |
| 11 | +* * |
| 12 | +* This program is free software; you can redistribute it and/or modify * |
| 13 | +* it under the terms of the GNU General Public License as published by * |
| 14 | +* the Free Software Foundation; either version 2 of the License, or * |
| 15 | +* (at your option) any later version. * |
| 16 | +* * |
| 17 | +*************************************************************************** |
| 18 | +""" |
| 19 | + |
| 20 | +__author__ = 'Médéric Ribreux' |
| 21 | +__date__ = 'February 2016' |
| 22 | +__copyright__ = '(C) 2016, Médéric Ribreux' |
| 23 | + |
| 24 | +# This will get replaced with a git SHA1 when you do a git archive |
| 25 | + |
| 26 | +__revision__ = '$Format:%H$' |
| 27 | + |
| 28 | +import os |
| 29 | + |
| 30 | + |
| 31 | +def checkParameterValuesBeforeExecuting(alg): |
| 32 | + """ Verify if we have the right parameters """ |
| 33 | + if alg.getParameterValue('start_coordinates') and alg.getParameterValue('start_points'): |
| 34 | + return alg.tr("You need to set either start coordinates OR a start points vector layer !") |
| 35 | + |
| 36 | + parameters = [alg.getParameterValue(f) for f in ['-c', '-a', '-n']] |
| 37 | + paramscore = [f for f in parameters if f] |
| 38 | + if len(paramscore) > 1: |
| 39 | + return alg.tr("-c, -a, -n parameters are mutually exclusive !") |
| 40 | + return None |
0 commit comments