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

GRASS GIS trac at osgeo.org
Wed Jun 19 05:03:36 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):

 Glynn wrote:
 > > +def find_program(pgm, *args):

 would that allow it to be called like:
  grass.find_program('r.sun', 'help')

 ? (I tried a quick test, it didn't like it)

 the goal here is to avoid needless extra typing when the only possible
 extra options are the $@'s.

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

 i.e. before 6.4.3 is released and we have to stay backwards compatible
 with the awkward version for the life of 6.x. I think it is still early
 enough to change it everything that uses it if we like to, but the window
 is closing fast.


 Hamish wrote:
 > > > grass.find_program('r.sun,', ['help'])
 MarkusN:
 > For me that fails even after make distclean:

 sorry, I had a typo in it, 'r.sun' not 'r.sun,'.


 another question with it: should it be changed to test if the program
 exists in the PATH and is executable, 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')


 Hamish

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



More information about the grass-dev mailing list