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 5e68614 commit 21c02f4
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 @@ -3069,6 +3069,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 @@ -3083,7 +3084,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 21c02f4

Please sign in to comment.