Skip to content

Commit

Permalink
switch mapset verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
griembauer committed Dec 23, 2024
1 parent 302987f commit 7f89ca2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/grass_gis_helpers/mapset.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ def switch_to_new_mapset(new_mapset, new=True):
old_mapset = env["MAPSET"]

if new:
grass.message(_(f"New mapset {new_mapset}"))
grass.verbose(_(f"New mapset {new_mapset}"))
grass.utils.try_rmdir(os.path.join(gisdbase, location, new_mapset))
else:
grass.message(_(f"Using, not deleting mapset {new_mapset}"))
grass.verbose(_(f"Using, not deleting mapset {new_mapset}"))
grass.try_remove(
os.path.join(gisdbase, location, new_mapset, ".gislock"),
)
Expand All @@ -57,8 +57,8 @@ def switch_to_new_mapset(new_mapset, new=True):
shutil.copyfile(gisrc, newgisrc)
os.environ["GISRC"] = newgisrc

grass.message(f"GISRC: {os.environ['GISRC']}")
grass.run_command("g.mapset", flags="c", mapset=new_mapset)
grass.verbose(f"GISRC: {os.environ['GISRC']}")
grass.run_command("g.mapset", flags="c", mapset=new_mapset, quiet=True)

# verify that switching of the mapset worked
cur_mapset = grass.gisenv()["MAPSET"]
Expand Down

0 comments on commit 7f89ca2

Please sign in to comment.