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

GRASS GIS trac at osgeo.org
Wed Jun 19 22:33:58 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 glynn):

 Replying to [comment:4 hamish]:
 > Glynn wrote:
 > > > +def find_program(pgm, *args):
 >
 > would that allow it to be called like:
 >  grass.find_program('r.sun', 'help')

 Yes.

 > another question with it: should it be changed to test if the program
 exists in the PATH and is executable,

 No.

 > instead of testing if the program returns an exit code of 0? (e.g.
 "gdalwarp" with no options returns '1' but 'xml2' with no options returns
 '0')

 The exit code test can be changed if that's a problem. subprocess.call()
 will raise an OSError (with errno=ENOENT) if the executable doesn't exist.

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



More information about the grass-dev mailing list