[GRASS-SVN] r54241 - grass/trunk/gui/wxpython/dbmgr
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Dec 7 14:45:38 PST 2012
Author: martinl
Date: 2012-12-07 14:45:37 -0800 (Fri, 07 Dec 2012)
New Revision: 54241
Modified:
grass/trunk/gui/wxpython/dbmgr/g.gui.dbmgr.py
Log:
g.gui.dbmgr: check if vector map exists
Modified: grass/trunk/gui/wxpython/dbmgr/g.gui.dbmgr.py
===================================================================
--- grass/trunk/gui/wxpython/dbmgr/g.gui.dbmgr.py 2012-12-07 22:28:15 UTC (rev 54240)
+++ grass/trunk/gui/wxpython/dbmgr/g.gui.dbmgr.py 2012-12-07 22:45:37 UTC (rev 54241)
@@ -33,6 +33,7 @@
import wx
import gettext
+gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode = True)
import grass.script as grass
@@ -41,15 +42,17 @@
from dbmgr.manager import AttributeManager
def main():
- gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode = True)
- # some applications might require image handlers
- wx.InitAllImageHandlers()
+ mapName = grass.find_file(options['map'], element = 'vector')['fullname']
+ if not mapName:
+ grass.set_raise_on_error(False)
+ grass.fatal(_("Vector map <%s> not found") % options['map'])
app = wx.PySimpleApp()
+ grass.message(_("Loading attribute data for vector map <%s>...") % mapName)
f = AttributeManager(parent = None, id = wx.ID_ANY,
title = "%s - <%s>" % (_("GRASS GIS Attribute Table Manager"),
- options['map']),
- size = (900, 600), vectorName = options['map'])
+ mapName),
+ size = (900, 600), vectorName = mapName)
f.Show()
app.MainLoop()
More information about the grass-commit
mailing list