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

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Apr 28 06:29:50 PDT 2017


Author: martinl
Date: 2017-04-28 06:29:50 -0700 (Fri, 28 Apr 2017)
New Revision: 70980

Modified:
   grass/trunk/lib/init/grass.py
Log:
grass startup: do not fail on gui mode when GUI is not available

Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py	2017-04-28 13:21:09 UTC (rev 70979)
+++ grass/trunk/lib/init/grass.py	2017-04-28 13:29:50 UTC (rev 70980)
@@ -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