Skip to content

Commit

Permalink
wxGUI/dbmgr: fix show attribute table for vector map from another map…
Browse files Browse the repository at this point in the history
…set (#3081)
  • Loading branch information
tmszi committed Jul 19, 2023
1 parent bd8ef29 commit 5e2741e
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion gui/wxpython/dbmgr/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3072,6 +3072,7 @@ def __init__(self, parent, id, parentDialog, style=wx.BK_DEFAULT):
self.parent = parent
self.parentDialog = parentDialog
self.mapDBInfo = self.parentDialog.dbMgrData["mapDBInfo"]
vectName = self.parentDialog.dbMgrData["vectName"]

#
# drivers
Expand All @@ -3086,7 +3087,24 @@ def __init__(self, parent, id, parentDialog, style=wx.BK_DEFAULT):
# get default values
#
self.defaultConnect = {}
connect = RunCommand("db.connect", flags="p", read=True, quiet=True)
genv = grass.gisenv()
vectMap = grass.find_file(
name=vectName,
element="vector",
)
vectGisrc, vectEnv = grass.create_environment(
gisdbase=genv["GISDBASE"],
location=genv["LOCATION_NAME"],
mapset=vectMap["mapset"],
)
connect = RunCommand(
"db.connect",
flags="p",
env=vectEnv,
read=True,
quiet=True,
)
grass.utils.try_remove(vectGisrc)

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

0 comments on commit 5e2741e

Please sign in to comment.