[GRASS-SVN] r63900 - grass/trunk/scripts/v.db.univar
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jan 1 06:13:20 PST 2015
Author: martinl
Date: 2015-01-01 06:13:20 -0800 (Thu, 01 Jan 2015)
New Revision: 63900
Modified:
grass/trunk/scripts/v.db.univar/v.db.univar.py
Log:
v.db.univar: check if table linked to layer
Modified: grass/trunk/scripts/v.db.univar/v.db.univar.py
===================================================================
--- grass/trunk/scripts/v.db.univar/v.db.univar.py 2015-01-01 14:11:02 UTC (rev 63899)
+++ grass/trunk/scripts/v.db.univar/v.db.univar.py 2015-01-01 14:13:20 UTC (rev 63900)
@@ -70,8 +70,12 @@
if not grass.find_file(vector, element='vector')['file']:
grass.fatal(_("Vector map <%s> not found") % vector)
-
- fi = grass.vector_db(vector, stderr = nuldev)[int(layer)]
+
+ try:
+ fi = grass.vector_db(vector, stderr = nuldev)[int(layer)]
+ except KeyError:
+ grass.fatal(_("No attribute table linked to layer <%s>") % layer)
+
table = fi['table']
database = fi['database']
driver = fi['driver']
More information about the grass-commit
mailing list