Skip to content

Commit

Permalink
Get vect map MAPSET by gs.find_file() func
Browse files Browse the repository at this point in the history
  • Loading branch information
tmszi committed Jul 18, 2023
1 parent 6d6c741 commit daa7e86
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions gui/wxpython/dbmgr/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3085,20 +3085,23 @@ def __init__(self, parent, id, parentDialog, style=wx.BK_DEFAULT):
#
self.defaultConnect = {}
genv = grass.gisenv()
vectMapset = vectName.split("@")[-1]
vectEnv = grass.create_environment(
vectMap = grass.find_file(
name=vectName,
element="vector",
)
vectGisrc, vectEnv = grass.create_environment(
gisdbase=genv["GISDBASE"],
location=genv["LOCATION_NAME"],
mapset=vectMapset,
mapset=vectMap["mapset"],
)
connect = RunCommand(
"db.connect",
flags="p",
env=vectEnv[1],
env=vectEnv,
read=True,
quiet=True,
)
grass.utils.try_remove(vectEnv[0])
grass.utils.try_remove(vectGisrc)

for line in connect.splitlines():
item, value = line.split(":", 1)
Expand Down

0 comments on commit daa7e86

Please sign in to comment.