[GRASS-dev] still problems with overwrite in scripts

Glynn Clements glynn at gclements.plus.com
Wed Jun 27 16:06:50 PDT 2012


Michael Barton wrote:

> I thought from reading past mail posts that -o and --o and --overwrite
> all set the overwrite flag.

The last two do; the first one is just a normal flag.

Historically, modules used -o for overwrite, but that is deprecated in
favour of the --o/--overwrite option which is built into G_parser().

> I test for overwrite with grass.overwrite()
> 
> But how do I include a check box for the overwrite flag in the GUI specs
> (for g.parser)?

If any of the options have a gisprompt setting which starts with
"new", the --help output will display the --o flag and the GUI will
have a checkbox to enable overwrite.

In 7.0, you can force the existence of the overwrite flag by adding
"#% overwrite: yes" to the module options, but this doesn't work in
6.x, partly because it isn't implemented in g.parser and partly
because the underlying logic in G_parser() is broken; see:

	https://trac.osgeo.org/grass/ticket/1658#comment:1

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list