[GRASS-SVN] r71039 - grass/branches/releasebranch_7_2/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Sat May 6 02:18:09 PDT 2017


Author: martinl
Date: 2017-05-06 02:18:09 -0700 (Sat, 06 May 2017)
New Revision: 71039

Modified:
   grass/branches/releasebranch_7_2/lib/init/grass.py
Log:
grass startup: do not fail on gui mode when GUI is not available
      (merge r70980 from trunk)


Modified: grass/branches/releasebranch_7_2/lib/init/grass.py
===================================================================
--- grass/branches/releasebranch_7_2/lib/init/grass.py	2017-05-06 09:15:35 UTC (rev 71038)
+++ grass/branches/releasebranch_7_2/lib/init/grass.py	2017-05-06 09:18:09 UTC (rev 71039)
@@ -737,13 +737,17 @@
             p.stdin.write("variable=True".encode(ENCODING))
             p.stdin.close()
             p.wait()
+            msg = None
             if p.returncode != 0:
                 # Python was not found - switch to text interface mode
-                warning(_("The python command does not work as expected!\n"
-                          "Please check your GRASS_PYTHON environment variable.\n"
-                          "Use the -help option for details.\n"
-                          "Switching to text based interface mode.\n\n"
-                          "Hit RETURN to continue.\n"))
+                msg = _("The python command does not work as expected!\n"
+                        "Please check your GRASS_PYTHON environment variable.\n"
+                        "Use the -help option for details.\n")
+            if not os.path.exists(wxpath("wxgui.py")):
+                msg = _("GRASS GUI not found. Please check your installation.")
+            if msg:
+                warning(_("{}\nSwitching to text based interface mode.\n\n"
+                          "Hit RETURN to continue.\n").format(msg))
                 sys.stdin.readline()
                 grass_gui = 'text'
 



More information about the grass-commit mailing list