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

Isaac Ullah isaac.ullah at asu.edu
Wed Feb 25 13:49:15 PST 2015


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. I'm trying to use the
grass.overwrite() syntax for all internal grass module calls in the script,
and this issue is making that difficult.

I've updated my g.parser header code in the scripts to reflect what I
believe is the latest syntax (based on other addon scripts in the svn). eg:

#%option G_OPT_R_ELEV

#% key: elev

#% description: Input elevation map (DEM)

#% required : yes

#%END


#%option G_OPT_R_INPUT

#% key: output

#% description: Output CVA raster

#% required : yes

#%END


But with this I get no overwrite flag option in the GUI, even though other
addon scripts that seem to be using this DO get overwrite flags added.


If I do it the old way:

#%option

#% key: elev

#% type: string

#% gisprompt: old,cell,raster

#% description: Input elevation map (DEM)

#% required : yes

#%END


#%option

#% key: output

#% type: string

#% gisprompt: old,cell,raster

#% description: Output CVA raster

#% required : yes

#%END


I also get no overwrite option in the module GUI.


However, if I do this:


#%option

#% key: elev

#% type: string

#% gisprompt: new,cell,raster

#% description: Input elevation map (DEM)

#% required : yes

#%END


#%option

#% key: output

#% type: string

#% gisprompt: new,cell,raster

#% description: Output CVA raster

#% required : yes

#%END


Then I DO get the overwrite option! However, when I do this, I then get the
error that my input maps already exist (even though these are just input
maps, and not output).


So, I suppose I'm confused about how I'm supposed to do this now? I've
looked through the many new pages of python code documentation on the wiki,
etc, and can't find anything at all about this... Again, any help is
greatly appreciated!

-- 
Isaac I Ullah, Ph.D.

Arizona State University
School of Human Evolution and Social Change
PO Box 2402
Tempe, AZ 85287-2402
(480) 727-1054 office
(650) 201-0479 cell
iullah at asu.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20150225/d36e5827/attachment.html>


More information about the grass-dev mailing list