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

GRASS GIS trac at osgeo.org
Wed Jun 19 05:40:46 PDT 2013


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

Comment(by hamish):

 Replying to [comment:5 zarch]:
 > Why not change the function in:
 >
 > {{{
 > >>> def find_program(cmd):
 > ...     return cmd in grass.get_commands()[0]
 > ...
 > >>> find_program('r.sun')
 > True
 > }}}


 because we want to use the function as a replacement for `which`, so find
 arbitrary helper apps like xml2 and gdalwarp which are not grass modules.
 Also, get_commands() is not very robust.


 thanks,
 Hamish

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



More information about the grass-dev mailing list