[GRASS-dev] [GRASS GIS] #2409: last call for options keys consolidation

GRASS GIS trac at osgeo.org
Thu Nov 27 18:12:29 PST 2014

#2409: last call for options keys consolidation
 Reporter:  martinl               |       Owner:  grass-dev@…              
     Type:  task                  |      Status:  new                      
 Priority:  blocker               |   Milestone:  7.0.0                    
Component:  Default               |     Version:  unspecified              
 Keywords:  standardized options  |    Platform:  Unspecified              
      Cpu:  Unspecified           |  

Comment(by annakrat):

 Replying to [comment:61 martinl]:
 > Replying to [comment:60 annakrat]:
 > > If you use 3draster in python as module option it won't work.
 > {{{
 > >>> g.read_command('g.list', type='3draster').splitlines()
 > ['x']
 > }}}
 > ?

 I wrote 'as module option'. If you will make change to the type, you
 should make the change to the option name too and this will not work:

 >>> gscript.run_command('g.region', 3draster='xxx')
  File "<stdin>", line 1
    gscript.run_command('g.region', 3draster='xxx')
 SyntaxError: invalid syntax

 But otherwise, I like this better than 'volume', so perhaps we could find
 some workaround for Python scripts and use underscore:
 >>> gscript.run_command('g.region', _3draster='xxx')

 This should work, although the underscore before was marked as obsolete,
 in favor of underscore after (for python keywords like map, input). But we
 can make an exception for keywords starting with numbers.

Ticket URL: <http://trac.osgeo.org/grass/ticket/2409#comment:64>
GRASS GIS <http://grass.osgeo.org>

More information about the grass-dev mailing list