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

GRASS GIS trac at osgeo.org
Thu Jun 20 06:04:31 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 zarch):

 Replying to [comment:15 annakrat]:
 > The 'which' implementation of function find_program more suits to the
 name.
 > But in this case we probably want to only test if we can run it (and we
 > don't want to find it).

 If you want to test if you can run the command or not, why not simply:


 {{{
 try:
     ret = self._runCommand(RunCommand, prog='g.proj',
                            read=True, flags='p')
 except OSError:
     sys.exit(_("GRASS module '%s' not found. Unable to start map "
                "display window.") % 'g.proj')
 }}}

 instead of:
 http://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/core/render.py?rev=56445#L454

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



More information about the grass-dev mailing list