[GRASS-user] GRASS module (python,
gparser): Set a tick for flag by default
Glynn Clements
glynn at gclements.plus.com
Fri Apr 20 06:26:55 EDT 2012
Johannes Radinger wrote:
> I am working on a python script which involves a g.parser module (to
> get the input mask for a module as for other modules in GRASS).
>
> So far I know how a flag is produced in the beginning of the script.
> E.g.:
>
> #%Flag
> #% key: f
> #% description: My Flag of Interest
> #%end
>
> Is there any possibility to set the flag ticked by default? So like providing
> an answer for "options".
No. Unlike options, where the user can override a default by providing
an explicit value, there's no way to disable a flag which is enabled
by default, and no way to specify GUI behaviour distinct from
command-line behaviour, so flags always default to false.
The only option is to invert the sense of the flag, i.e. enable the
behaviour by default and provide a "don't ..." flag to disable the
behaviour.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-user
mailing list