[GRASS-user] python-option for path (browse - option)

Hamish hamish_b at yahoo.com
Wed Apr 27 17:24:25 EDT 2011


Johannes wrote:
> I am using the options in a pyhton script,
> and I found out to set a vector, raster and values
> like with following lines:
> 
> #%option
> #% key: input
> #% type: string
> #% gisprompt: old,vector,vector
> #% description:
> #% required: yes
> #%end
> 
> But now I want to include the v.in.ascii module so
> I want to set a full path in the options.
> 
> How do I get the "Browse" button in the interactive menu
> of my script? Which kind of option do I have to define?

to see what it should look like, take an existing module you wish
to emulate, then add --script on the command line:


GRASS> v.in.ascii --script
...
#%Option
#% key: input
#% type: string
#% required: no
#% multiple: no
#% key_desc: name
#% description: ASCII file to be imported, if not given reads from standard input
#% gisprompt: old_file,file,input
#% guisection: Required
#%End
...

Hamish



More information about the grass-user mailing list