Browse Source

grass startup script: fix confusing message about missing WIND file fixed

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@72277 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 7 years ago
parent
commit
2cce9ac903
1 changed files with 4 additions and 2 deletions
  1. 4 2
      lib/init/grass.py

+ 4 - 2
lib/init/grass.py

@@ -946,12 +946,14 @@ def set_mapset(gisrc, arg, geofile=None, create_new=False):
                 else:
                     # 'location_name' is a valid GRASS location,
                     # create new mapset
-                    os.mkdir(location)
+                    if os.path.exists(location):
+                        warning(_("Missing WIND file"))
+                    else:
+                        os.mkdir(location)
                     # copy PERMANENT/DEFAULT_WIND to <mapset>/WIND
                     s = readfile(os.path.join(gisdbase, location_name,
                                               "PERMANENT", "DEFAULT_WIND"))
                     writefile(os.path.join(location, "WIND"), s)
-                    message(_("Missing WIND file fixed"))
 
         if os.access(gisrc, os.R_OK):
             kv = read_gisrc(gisrc)