[GRASS-dev] Python module gui inputs

Eric Goddard egoddard1010 at gmail.com
Thu Feb 28 05:19:35 PST 2013


Thanks for the suggestions. I figured out the problem -- somehow an older
version of my code was getting built and I wasn't following all the steps
correctly on the grass and python wiki. The GUI works now, but my code
logic still needs some work.

Eric
On Feb 28, 2013 3:03 AM, "Vaclav Petras" <wenzeslaus at gmail.com> wrote:

> Hi Eric, for me it works (with code from paste bin). GUI shows and
> neighbor_size is in the Optional tab.
>
> Another suggestions about options: If the "description" is long, you
> can use "label" which will be shown in the gui and description will
> become a tooltip. There is usually no need to write default value into
> the description since default value is already in the gui or in
> y.our.module --help.
>
> I'm afraid that the programming manual does not list these practices.
> http://grass.osgeo.org/programming7/gislib.html#Command_Line_Parsing
>
> Vaclav
>
> On 28 February 2013 01:03, Eric Goddard <egoddard1010 at gmail.com> wrote:
> > Thanks for the response, Luca. I've made the change to the output
> > option, but the neighbor_size option still isn't appearing in the gui.
> > The descriptions will become more verbose once the code and everything
> > is working; what is in the script now is just the bare minimum for it
> > to run. and generate a gui. I've pasted the full code at
> > http://pastebin.com/4PCJ0xeG.
> >
> > On Wed, Feb 27, 2013 at 4:46 PM, Luca Delucchi <lucadeluge at gmail.com>
> wrote:
> >> 2013/2/27 Eric Goddard <egoddard1010 at gmail.com>:
> >>> Hi all,
> >>>
> >>
> >> Hi Eric,
> >>
> >>> Thanks,
> >>> Eric
> >>>
> >>> #%module
> >>> #%  description: Creates a Local Relief Model from input raster.
> >>> #%  keywords: lrm
> >>> #%  keywords: lidar
> >>> #%  overwrite: yes
> >>> #%end
> >>> #%option G_OPT_R_INPUT
> >>> #%  key:input_map
> >>> #%  description: Select input raster
> >>> #%  required: yes
> >>> #%end
> >>> #%option
> >>> #%  key: output_map
> >>> #%  type: string
> >>> #%  description: Name for output LRM raster
> >>> #%  required: yes
> >>> #%end
> >>> #%option
> >>> #%  key: neighbor_size
> >>> #%  type: double
> >>> #%  description: The neighborhood size to be used in the low pass
> >>> filter. Default is 25.
> >>> #%  required: no
> >>> #%  answer: 25
> >>> #%end
> >>>
> >>
> >> I would like to change the description of module as following, for a
> >> more compliant GRASS description.
> >> I think this should work. Otherwise could you paste you entire code
> >> (better in a external site as pastebin)
> >>
> >> #%module
> >> #% description: Creates a Local Relief Model from input raster.
> >> #% keywords: lrm
> >> #% keywords: lidar
> >> #% overwrite: yes
> >> #%end
> >> #%option G_OPT_R_INPUT
> >> #%end
> >> #%option G_OPT_R_OUTPUT
> >> #%end
> >> #%option
> >> #% key: neighbor_size
> >> #% type: double
> >> #% description: The neighborhood size to be used in the low pass
> >> filter. Default is 25.
> >> #% required: no
> >> #% answer: 25
> >> #%end
> >>
> >>
> >> --
> >> ciao
> >> Luca
> >>
> >> http://gis.cri.fmach.it/delucchi/
> >> www.lucadelu.org
> > _______________________________________________
> > grass-dev mailing list
> > grass-dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/grass-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20130228/c472489a/attachment-0001.html>


More information about the grass-dev mailing list