Bladeren bron

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.


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@65247 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 10 jaren geleden
bovenliggende
commit
f162a9b1c3
1 gewijzigde bestanden met toevoegingen van 15 en 15 verwijderingen
  1. 15 15
      lib/init/grass.py

+ 15 - 15
lib/init/grass.py

@@ -672,22 +672,21 @@ def non_interactive(arg, geofile=None):
                 "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 @@ else:
         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)