[GRASS-SVN] r41765 - grass/trunk/scripts/g.manual

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Apr 8 16:23:13 EDT 2010


Author: martinl
Date: 2010-04-08 16:23:12 -0400 (Thu, 08 Apr 2010)
New Revision: 41765

Modified:
   grass/trunk/scripts/g.manual/g.manual.py
Log:
g.manual: don't fail when browser is not available


Modified: grass/trunk/scripts/g.manual/g.manual.py
===================================================================
--- grass/trunk/scripts/g.manual/g.manual.py	2010-04-08 20:09:09 UTC (rev 41764)
+++ grass/trunk/scripts/g.manual/g.manual.py	2010-04-08 20:23:12 UTC (rev 41765)
@@ -6,7 +6,7 @@
 # AUTHOR(S):	Markus Neteler
 #               Converted to Python by Glynn Clements
 # PURPOSE:	Display the HTML/MAN pages
-# COPYRIGHT:	(C) 2003,2008 by the GRASS Development Team
+# COPYRIGHT:	(C) 2003,2008,2010 by the GRASS Development Team
 #
 #		This program is free software under the GNU General Public
 #		License (>=v2). Read the file COPYING that comes with GRASS
@@ -15,7 +15,7 @@
 #############################################################################
 
 #%Module
-#%  description: Display the HTML man pages of GRASS
+#%  description: Display the HTML man pages of GRASS GIS
 #%  keywords: general
 #%  keywords: manual
 #%  keywords: help
@@ -40,12 +40,16 @@
 from grass.script import core as grass
 
 def start_browser(entry):
+    if not grass.find_program(browser):
+        grass.fatal(_("Browser <%s> not found") % browser)
+    
     path = os.path.join(gisbase, 'docs', 'html', entry + '.html')
     if not os.path.exists(path):
 	grass.fatal(_("No HTML manual page entry for <%s>.") % entry)
     verbose = os.getenv("GRASS_VERBOSE")
     if not verbose or int(verbose) > 1:
 	grass.message(_("Starting browser <%s> for module %s...") % (browser_name, entry))
+    
     os.execlp(browser, browser_name, "file://%s/docs/html/%s.html" % (gisbase, entry))
     grass.fatal(_("Error starting browser <%s> for HTML file <%s>") % (browser, entry))
 
@@ -65,7 +69,7 @@
     entry = options['entry']
 
     gisbase = os.environ['GISBASE']
-
+    
     browser = os.getenv('GRASS_HTML_BROWSER')
 
     if "html_browser_mac.sh" in browser:



More information about the grass-commit mailing list