[GRASS-dev] No "overwrite" option in grass 7 addon scripts?

Markus Neteler neteler at osgeo.org
Thu Feb 26 06:49:27 PST 2015


On Thu, Feb 26, 2015 at 1:53 AM, Anna Petrášová <kratochanna at gmail.com> wrote:
> On Wed, Feb 25, 2015 at 4:49 PM, Isaac Ullah <isaac.ullah at asu.edu> wrote:
>>
>> Hi all, sorry for the spat of messages today, but as you can tell, I'm
>> having trouble getting my addon scripts up to par for GRASS7 standard. I'm
>> trying to figure these issues out on my own, but I can't seem to find any
>> documentation that can help me do so. My current issue is that I'm noticing
>> that my python scripts are lacking the automatically generated flag for
>> --overwrite in the GUI. One can add --overwrite to the command line (and it
>> works fine), but it's not there in the GUI.
...
> You should be using standardized option G_OPT_R_INPUT, the definition can be
> found here:
> http://grass.osgeo.org/programming7/parser__standard__options_8c_source.html
>
> The key here is to specify 'new' in gisprompt, but only for output map.
> 'new' means that a new map will be created and parser then knows that it
> should check whether there is already a map of such name and if yes, require
> overwrite. Based on 'new', the overwrite flag is created.

I have added that here:
http://grasswiki.osgeo.org/wiki/Module_command_line_parser#Troubleshooting

Thanks for reporting (and the solution of course!)

Markus


More information about the grass-dev mailing list