[GRASS-dev] GRASS 7 raster coding best practices
Martin Landa
landa.martin at gmail.com
Sun May 4 06:28:52 EDT 2008
Hi,
2008/5/4 Yann Chemin <yann.chemin at gmail.com>:
> OK, if I get it right,
>
> input->required=YES
> is the same as:
> input->guisection=_("Required")
>
> therefore the second line is useless.
no, this construction is used on few places, for example in r.in.gdal
where 'input' is not required since there is 'f' flag to 'List
supported formats' otherwise the user would be forced to type
`r.in.gdal in=dummy -f` instead of `r.in.gdal -f`.
The attributes 'required' and 'guisection' in 'Option' structure serve
for the different things. 'required' is used by G_parser() to check if
required parameters where given by the user. 'guisection' is used for
creating tabs in TCL/TK and wxPython GUI dialogs.
I agree that using `guisection="Required"` is quite ugly. In GRASS7
there should be implemented conditional requirement, e.g. in case of
r.in.gdal is 'input' required with one exception - for 'f' flag. Then
current workaround with 'guisection' will be removed.
> In the same way, is the following identical too?
>
> input->required=NO
> is it the same as below?
> input->guisection=_("Optional")
See above, 'required' and 'guisection' parameters are used for two
different things.
Martin
--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa *
More information about the grass-dev
mailing list