[GRASS-SVN] r41794 - grass/trunk/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Apr 10 16:23:29 EDT 2010


Author: martinl
Date: 2010-04-10 16:23:28 -0400 (Sat, 10 Apr 2010)
New Revision: 41794

Modified:
   grass/trunk/lib/init/grass.py
Log:
export also GRASS variables


Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py	2010-04-10 19:49:48 UTC (rev 41793)
+++ grass/trunk/lib/init/grass.py	2010-04-10 20:23:28 UTC (rev 41794)
@@ -307,19 +307,20 @@
 
 	if windows or cygwin:
 	    # MinGW startup moved to into init.bat
-	    iexplore = os.path.join(os.getenv('ProgramFiles'),"Internet Explorer","iexplore.exe")
+	    iexplore = os.path.join(os.getenv('ProgramFiles'), "Internet Explorer", "iexplore.exe")
 	    if os.access(iexplore, os.F_OK):
 		browser = iexplore
 	    else:
 		browser = "iexplore"
 	else:
 	    # the usual suspects
-	    browsers = ["htmlview", "konqueror", "mozilla", "mozilla-firefox", "firefox", "opera", "netscape", "dillo"]
+	    browsers = [ "htmlview", "konqueror", "mozilla", "mozilla-firefox",
+                         "firefox", "iceweasel", "opera", "netscape", "dillo" ]
 	    for b in browsers:
 		if find_exe(b):
 		    browser = b
 		    break
-
+    
     if macosx and browser:
 	# OSX doesn't execute browsers from the shell PATH - route thru a script
 	browser = gfile('etc', "html_browser_mac.sh")
@@ -329,7 +330,7 @@
 	message("WARNING: Searched for a web browser, but none found.")
 	# even so we set konqueror to make lib/gis/parser.c happy:
 	browser = "konqueror"
-
+    
     os.environ['GRASS_HTML_BROWSER'] = browser
 
 def grass_intro():
@@ -732,7 +733,12 @@
 
     f.write("export PATH=\"%s\"\n" % os.getenv('PATH'))
     f.write("export HOME=\"%s\"\n" % userhome) # restore user home path
-
+    
+    for env, value in os.environ.iteritems():
+        if env.find('GRASS_') < 0:
+            continue
+        f.write("export %s=\"%s\"\n" % (env, value))
+    
     f.close()
 
     exit_val = call([gfile("etc", "run"), os.getenv('SHELL')])



More information about the grass-commit mailing list