Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mapset.switch_to_new_mapset: make messenging verbose #44

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading