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

svn_grass at osgeo.org svn_grass at osgeo.org
Fri May 15 07:11:00 PDT 2015


Author: wenzeslaus
Date: 2015-05-15 07:11:00 -0700 (Fri, 15 May 2015)
New Revision: 65247

Modified:
   grass/trunk/lib/init/grass.py
Log:
init: remove usage of invalid parameters in startup screen related code

Start of the main GUI is controlled in different way then with gis_set.py, so the parameter was unused.

Instead, use parameter for GUI type and call function only when it is needed.


Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py	2015-05-15 13:52:24 UTC (rev 65246)
+++ grass/trunk/lib/init/grass.py	2015-05-15 14:11:00 UTC (rev 65247)
@@ -672,22 +672,21 @@
                 "Interactive startup needed."))
 
 
-def set_data():
-    # User selects LOCATION and MAPSET if not set
-    if not location:
-        # Check for text interface
-        if grass_gui == 'text':
-            pass
-        # Check for GUI
-        elif grass_gui in ('gtext', 'wxpython'):
-            gui_startup(grass_gui == 'gtext')
-        else:
-            # Shouldn't need this but you never know
-            fatal(_("Invalid user interface specified - <%s>. " 
-                    "Use the --help option to see valid interface names.") % grass_gui)
+def set_data(grass_gui):
+    # User selects LOCATION and MAPSET
+    # Check for text interface
+    if grass_gui == 'text':
+        pass
+    # Check for GUI
+    elif grass_gui in ('gtext', 'wxpython'):
+        gui_startup(grass_gui)
+    else:
+        # Shouldn't need this but you never know
+        fatal(_("Invalid user interface specified - <%s>. " 
+                "Use the --help option to see valid interface names.") % grass_gui)
 
 
-def gui_startup(wscreen_only = False):
+def gui_startup(grass_gui):
     if grass_gui in ('wxpython', 'gtext'):
         ret = call([os.getenv('GRASS_PYTHON'), gfile(wxpython_base, "gis_set.py")])
 
@@ -1433,7 +1432,8 @@
         non_interactive(args[0])
 
 # User selects LOCATION and MAPSET if not set
-set_data()
+if not location:
+    set_data(grass_gui)
 
 # Set GISDBASE, LOCATION_NAME, MAPSET, LOCATION from $GISRC
 load_gisrc(gisrc)



More information about the grass-commit mailing list