[GRASS-GUI] Question regarding GUI Scrits frame

Glynn Clements glynn at gclements.plus.com
Tue Mar 9 19:35:05 EST 2010


Jenny Turner wrote:

> I'm new at GRASS and I have been developing a few scripts toGRASS but I have
> afewquestions regarding  Scripts wxpython frame (the one defined by
> %MODULE):
> - I want usersto input a value in an OPTION regarding a parameter (e.g. a
> string or a number). ==> This is EASY. But, I also want to compute the
> input, automatically, before I run my scritpt, in order to provide a list of
> possible values in other OPTION
> e.g. in option "Parameter" the users put a value (e.g. Vegetation).
> Automatically a small processa is run in order to provide a list of possible
> values for Option "value". And then, users will be able to choose "Values"
> options that is e.g. 100,10, 0etc". Only after this values were inserted is
> possible to run the script.
> This seems complex but my question is: is it possible to run a function,
> while I'm inserting values in scripts, and all this before I run the script?

There isn't any straightforward way to do this. Possible solutions
include dynamically creating a script with the appropriate options,
by-passing g.parser and creating the UI yourself, or (in 6.5 and 7.0)
generating a dummy script containing only the parameter details,
invoking "g.parser -s ..." on that, and parsing the output (this is
easier to do in Python than in a shell script).

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


More information about the grass-gui mailing list