Re: [GRASS-dev] still problems with overwrite in scripts

2012-06-28 Thread Michael Barton
Works perfectly. Michael On Jun 28, 2012, at 12:43 PM, Glynn Clements wrote: > > Michael Barton wrote: > >> My question was about testing for the overwrite flag. But I did try >> this, as I mentioned in my post to Glynn and get an error wherever I >> put it. I tried in the string option for ou

Re: [GRASS-dev] still problems with overwrite in scripts

2012-06-28 Thread Michael Barton
Thanks!!! This is what I needed to know. Michael On Jun 28, 2012, at 12:43 PM, Glynn Clements wrote: > > Michael Barton wrote: > >> My question was about testing for the overwrite flag. But I did try >> this, as I mentioned in my post to Glynn and get an error wherever I >> put it. I tried in

Re: [GRASS-dev] still problems with overwrite in scripts

2012-06-28 Thread Glynn Clements
Michael Barton wrote: > My question was about testing for the overwrite flag. But I did try > this, as I mentioned in my post to Glynn and get an error wherever I > put it. I tried in the string option for output prefix first, of > course. But when that didn't work, I tried in the input and > pul

Re: [GRASS-dev] still problems with overwrite in scripts

2012-06-28 Thread Michael Barton
Thanks, but neither are relevant (or work) in my case. See below. > 2012/6/26 Michael Barton : >> What is the test for the parser based overwrite flag? > > as I told you the flag is added by parser automatically when there is > at least one option which is dedicated for output, eg. G_OPT_V_OUTPU

Re: [GRASS-dev] still problems with overwrite in scripts

2012-06-28 Thread Martin Landa
Hi, 2012/6/28 Michael Barton : > #%option G_OPT_R_INPUT > #%  key: ms3 > #%  description: Input raster map for red channel > #%end > > So there is no way to add "new" unless I redo the options section. but this is standard option for input not output! "new" refers to `gisprompt`. Eg. #% gisprom

Re: [GRASS-dev] still problems with overwrite in scripts

2012-06-27 Thread Hamish
going back to your original question, if you use --overwrite with the master script, it should be set for everything called by the master script as the GRASS_OVERWRITE enviro var will be set by the parser. You can test to see if it is set with: import os if "GRASS_OVERWRITE" in os.environ:

Re: [GRASS-dev] still problems with overwrite in scripts

2012-06-27 Thread Michael Barton
Hmmm. This should have worked. But... The options (copied from another script) are written as... #%option G_OPT_R_INPUT #% key: ms3 #% description: Input raster map for red channel #%end So there is no way to add "new" unless I redo the options section. This way of doing the interface is new,

Re: [GRASS-dev] still problems with overwrite in scripts

2012-06-27 Thread Michael Barton
Thanks. I'll try one of these methods. Michael On Jun 27, 2012, at 5:06 PM, Glynn Clements wrote: > > 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. > >

Re: [GRASS-dev] still problems with overwrite in scripts

2012-06-27 Thread Glynn Clements
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

[GRASS-dev] still problems with overwrite in scripts

2012-06-27 Thread Michael Barton
I thought from reading past mail posts that -o and --o and --overwrite all set the overwrite flag. 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)? Putting in an "o" flag does not seem to set the overwrite flag