[GRASS-dev] [GRASS GIS] #2008: grass.script's find_program() can't find modules

GRASS GIS trac at osgeo.org
Wed Jun 19 04:31:23 PDT 2013

#2008: grass.script's find_program() can't find modules
  Reporter:  hamish   |       Owner:  grass-dev@…              
      Type:  defect   |      Status:  closed                   
  Priority:  normal   |   Milestone:  6.4.4                    
 Component:  Python   |     Version:  svn-releasebranch64      
Resolution:  invalid  |    Keywords:  find_program()           
  Platform:  Linux    |         Cpu:  x86-64                   

Comment(by glynn):

 Replying to [comment:1 hamish]:
 > actually it works, what I was missing what that the argument needed to
 be in [square] brackets. (why?)
 Because it's a list of arguments to be passed to the program.

 It would be trivial to change the function, i.e.
 -def find_program(pgm, args = []):
 +def find_program(pgm, *args):
 but it would also be necessary to change anything which uses it with
 arguments, currently:
  * raster/r.colors/thumbnails.py
  * vector/v.colors/thumbnails.py
  * gui/wxpython/gui_core/gselect.py
  * gui/wxpython/gui_core/mapdisp.py
  * gui/wxpython/core/render.py
  * scripts/i.in.spotvgt/i.in.spotvgt.py
  * scripts/r.in.aster/r.in.aster.py
  * scripts/i.spectral/i.spectral.py
  * scripts/g.extension/g.extension.py
  * scripts/v.db.univar/v.db.univar.py

 If it's going to be changed, sooner is better than later.

 PS: there's no reason for r.colors and v.colors to have near-identical
 copies of the thumbnails.py script. It should be moved to tools.

Ticket URL: <https://trac.osgeo.org/grass/ticket/2008#comment:2>
GRASS GIS <http://grass.osgeo.org>

More information about the grass-dev mailing list