[GRASS-dev] inconsistency between G_OPT_V_INPUT and G_OPT_R_INPUT

Pietro peter.zamb at gmail.com
Tue May 12 23:03:04 PDT 2015


Dear all,

I found an inconsistency of behaviors between G_OPT_R_INPUT and
G_OPT_V_INPUT, here the test code:

{{{
#!/usr/bin/env python
# -- coding: utf-8 --
#%module
#% description: Test
#% keywords: test
#%end
#%option G_OPT_R_INPUT
#% key: discharge
#% description: Name of river discharge [m3/s]
#% required: yes
#%end
#%option G_OPT_V_INPUT
#% key: river
#% key_desc: name
#% description: Name of vector map with interested segments of rivers
#% required: yes
#%end
from __future__ import print_function
import sys

# import grass libraries
from grass.script import core as gcore


def main(opts, flgs):
    print(opts, flgs)

if __name__ == "__main__":
    options, flags = gcore.parser()
    sys.exit(main(options, flags))
}}}

here is the output of the manual page:

{{{
python r.example.py --help

Description:
 Test

Keywords:
 test

Usage:
 r.example.py discharge=name river=name [--help] [--verbose] [--quiet]
   [--ui]

Flags:
 --h   Print usage summary
 --v   Verbose module output
 --q   Quiet module output
 --ui  Force launching GUI dialog

Parameters:
  discharge   Name of river discharge [m3/s]
      river   Name of input vector map
               Name of vector map with interested segments of rivers
}}}

As you can see the description of the parameter add the default
description set in G_OPT_V_INPUT and in a new line the description
added manually in the definition of the module parameters. Instead the
G_OPT_R_INPUT shows only the description set manually.

The behavior concerning the GUI is worst, because it shows only the
default description string, see attached figure.

What do you think?

Pietro
-------------- next part --------------
A non-text attachment was scrubbed...
Name: r_example_gui.png
Type: image/png
Size: 20998 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20150513/64df8018/attachment-0001.png>


More information about the grass-dev mailing list