[GRASS-dev] [GRASS GIS] #2895: Define dependencies for GRASS addons

GRASS GIS trac at osgeo.org
Fri Feb 5 01:16:26 PST 2016


#2895: Define dependencies for GRASS addons
--------------------------+-------------------------
  Reporter:  pmav99       |      Owner:  grass-dev@…
      Type:  enhancement  |     Status:  new
  Priority:  normal       |  Milestone:
 Component:  Addons       |    Version:  unspecified
Resolution:               |   Keywords:  g.extension
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+-------------------------

Comment (by pmav99):

 Transferring Helmut Kudrnovsky's answer here:

 > have a look here:
 > https://trac.osgeo.org/grass/browser/grass-
 addons/grass7/raster/r.basin/r.basin.py#L82
 > {{{#!python
 > # check requirements
 > def check_progs():
 >     found_missing = False
 >     for prog in ('r.hypso', 'r.stream.basins', 'r.stream.distance',
 'r.stream.extract',
 >     'r.stream.order','r.stream.snap','r.stream.stats', 'r.width.funct'):
 >         if not grass.find_program(prog, '--help'):
 >             found_missing = True
 >             grass.warning(_("'%s' required. Please install '%s' first
 using 'g.extension %s'") % (prog, prog, prog))
 >     if found_missing:
 >         grass.fatal(_("An ERROR occurred running r.basin"))
 > }}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2895#comment:1>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list