[GRASS-dev] Parser checking output maps but not input maps

Vaclav Petras wenzeslaus at gmail.com
Tue Jun 30 19:36:32 PDT 2015


Hi,

is there some reason for GRASS parser not checking if the input map exists?
It checks if the output map exists and if it it does it ends execution with
an error.

Having this interface definition (full script attached):

#%option G_OPT_R_INPUT
#% key: elevation
#%end
#%option G_OPT_R_OUTPUT
#% key: aspect
#%end

I now get this:

$ r.mapcalc "aaa = 1"
$ g.list rast m=.
aaa
$ test_parser_inputs.py elevation=bbb aspect=aaa
ERROR: option <aspect>: <aaa> exists.
$ test_parser_inputs.py elevation=bbb aspect=ccc
('bbb', 'ccc') [i.e., no error]

But I would expect to get the error also in the second case:

$ test_parser_inputs.py elevation=bbb aspect=ccc
ERROR: option <elevation>: <bbb> doesn't exist.

Is there some advantage in checking the existence of the input maps and
files manually?

Vaclav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20150630/2d3459ff/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_parser_inputs.py
Type: text/x-python
Size: 435 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20150630/2d3459ff/attachment.py>


More information about the grass-dev mailing list