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

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jun 9 14:20:40 PDT 2018


Author: wenzeslaus
Date: 2018-06-09 14:20:40 -0700 (Sat, 09 Jun 2018)
New Revision: 72791

Modified:
   grass/trunk/lib/init/grass.py
   grass/trunk/lib/init/grass7.html
Log:
init: remove broken env var interface for d/l/m

The interface described in the manual was not implemented and not part of --help.
It seems that it was broken at least since trans from Bash to Python (r37863)
and definitevely before refactoring in r65235. Perhaps some time after env vars
were definitevely removed from modules (r10655, r10790, r10793).

Closes #2679 (Drop or fix setting...) and see #2681 for more explanation
esp. about the unfortunate naming (LOCATION vs LOCATION_NAME).

This removes the only code which seemed to be really specific for
the grass - call and it removes a significat portion of the manual
which discusses usage and env vars and command line params priorities 
in various combinations.


Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py	2018-06-09 17:08:43 UTC (rev 72790)
+++ grass/trunk/lib/init/grass.py	2018-06-09 21:20:40 UTC (rev 72791)
@@ -900,28 +900,9 @@
 
     tmp_location requires tmpdir (which is used as gisdbase)
     """
-    # TODO: arg param seems to be always mapset or dash, refactor
-    l = None
-
-    if arg == '-':
-        # TODO: repair or remove behavior env vars + `grass75 -` (see doc)
-        # this is broken for some time (before refactoring, e.g. r65235)
-        # is some code is added, it should be a separate function, probably
-        # called here
-        # older comment for global vars:
-        # TODO: it does not seem that these would be ever set before calling this
-        # function, so we may just delete them here (the globals are set from
-        # the gisrc later on). But where is setting from environmental variables?
-        # the following probable means if env var defined, use it
-        # originates from r37863 (Convert grass70 script to Python) but even
-        # there it seems that it will never succeed
-        # it would have to be defined also for other vars
-        # if location:
-        #    l = location
-        pass
-    else:
-        l = arg
-
+    # TODO: arg param seems to be always the mapset parameter (or a dash
+    # in a distant past), refactor
+    l = arg
     if l:
         if l == '.':
             l = os.getcwd()

Modified: grass/trunk/lib/init/grass7.html
===================================================================
--- grass/trunk/lib/init/grass7.html	2018-06-09 17:08:43 UTC (rev 72790)
+++ grass/trunk/lib/init/grass7.html	2018-06-09 21:20:40 UTC (rev 72791)
@@ -414,75 +414,6 @@
 indicating which interpreter to be used for the script. The script file must 
 have its executable bit set. 
 
-<h3>Other examples</h3>
-
-There are a variety of ways in which the <i>location environment
-variables</i> (see above) can be used to specify the mapset to use.
-The following are some possible examples.
-
-<h4>Example 1</h4>
-
-The environment variables are defined as follows:
-    
-<div class="code"><pre>
-LOCATION = /usr/local/share/grassdata/spearfish70/PERMANENT
-GISDBASE = /usr/local/share/grassdata
-LOCATION_NAME = spearfish70
-MAPSET = PERMANENT
-</pre></div>
-
-Start GRASS with the following command:
-
-<div class="code"><pre>
-grass75 -
-</pre></div>
-
-GRASS will start with the mapset defined by LOCATION since the LOCATION
-variable overrides the other variables.
-
-<h4>Example 2</h4>
-
-The environment variables are defined as follows:
-    
-<div class="code"><pre>
-GISDBASE = /usr/local/share/grassdata
-LOCATION_NAME = spearfish70
-MAPSET = PERMANENT
-</pre></div>
-
-Start GRASS with the following command:
-
-<div class="code"><pre>
-grass75 -
-</pre></div>
-    
-GRASS will start with the mapset defined by
-GISDBASE/LOCATION_NAME/MAPSET.
-
-<div class="code"><pre>
-grass75 /usr/home/grass/data/thailand/forests
-</pre></div>
-    
-GRASS will start with the
-mapset <tt>/home/grass/data/thailand/forests</tt> which overrides the
-environment variables.
-
-<div class="code"><pre>
-grass75 swamps
-</pre></div>
-
-GRASS will start with the mapset defined by
-GISDBASE/LOCATION_NAME/swamps since the command line argument for the
-mapset overrides the environment variable MAPSET.
-
-<div class="code"><pre>
-grass75 thailand/forests
-</pre></div>
-
-GRASS will start with the mapset defined by GISDBASE/thailand/forests
-since the command line arguments for the location and mapset overrides
-the environment variables LOCATION_NAME and MAPSET.
-
 <h2>CAVEAT</h2>
 
 If you start GRASS using the <em><a href="wxGUI.html">wxGUI</a></em>



More information about the grass-commit mailing list