[GRASS-SVN] r73150 - grass/trunk/gui/wxpython

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Aug 23 18:34:55 PDT 2018


Author: wenzeslaus
Date: 2018-08-23 18:34:55 -0700 (Thu, 23 Aug 2018)
New Revision: 73150

Modified:
   grass/trunk/gui/wxpython/gis_set.py
Log:
wxGUI/startup: get the first possible grassdata match, not last (faster and more expected)

Modified: grass/trunk/gui/wxpython/gis_set.py
===================================================================
--- grass/trunk/gui/wxpython/gis_set.py	2018-08-24 01:26:58 UTC (rev 73149)
+++ grass/trunk/gui/wxpython/gis_set.py	2018-08-24 01:34:55 UTC (rev 73150)
@@ -542,11 +542,11 @@
             return
         home = os.path.expanduser('~')
         # try some common directories for grassdata
-        # always assuming grassdata (lowercase)
-        # home for Linux
+        # grassdata (lowercase) in home for Linux (first choice)
         # Documents and My Documents for Windows
         # potential translations (old Windows and some Linux)
         # but ~ and ~/Documents should cover most of the cases
+        # ordered by preference and then likelihood
         candidates = [
             os.path.join(home, "grassdata"),
             os.path.join(home, "Documents", "grassdata"),
@@ -563,6 +563,7 @@
         for candidate in candidates:
             if os.path.exists(candidate):
                 path = candidate
+                break  # get the first match
         if path:
             try:
                 self.tgisdbase.SetValue(path)



More information about the grass-commit mailing list