[GRASS-dev] [GRASS GIS] #3975: g.manual -m gives ERROR: No manual page entry

GRASS GIS trac at osgeo.org
Mon Nov 18 11:17:27 PST 2019


#3975: g.manual -m gives ERROR: No manual page entry
--------------------------+---------------------------------
  Reporter:  jidanni      |      Owner:  grass-dev@…
      Type:  defect       |     Status:  new
  Priority:  normal       |  Milestone:  7.8.2
 Component:  Docs         |    Version:  git-releasebranch78
Resolution:               |   Keywords:  Debian
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+---------------------------------

Comment (by Bas Couwenberg):

 Something like this may be a good solution:
 {{{
 --- a/g.manual   2019-11-18 20:06:17.402073322 +0100
 +++ b/g.manual   2019-11-18 20:16:03.794093319 +0100
 @@ -46,6 +46,7 @@
  #% required : yes
  #%end

 +import subprocess
  import sys
  import os

 @@ -98,6 +99,19 @@


  def start_man(entry):
 +    try:
 +        cmd = ['man', '-w', '1', entry]
 +
 +        process = subprocess.Popen(cmd, stdout=subprocess.PIPE,
 stderr=subprocess.PIPE)
 +        (stdout, stderr) = process.communicate()
 +
 +        paths = stdout.decode().split('\n')
 +
 +        if os.path.exists(paths[0]):
 +            os.execlp('man', 'man', paths[0])
 +    except Exception:
 +        pass
 +
      path = os.path.join(gisbase, 'docs', 'man', 'man1', entry + '.1')
      if not os.path.exists(path) and os.getenv('GRASS_ADDON_BASE'):
          path = os.path.join(os.getenv('GRASS_ADDON_BASE'), 'docs', 'man',
 'man1', entry + '.1')
 }}}

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



More information about the grass-dev mailing list