[GRASS-SVN] r67008 - grass-addons/grass7/vector/v.in.natura2000
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Dec 2 12:42:57 PST 2015
Author: hellik
Date: 2015-12-02 12:42:57 -0800 (Wed, 02 Dec 2015)
New Revision: 67008
Modified:
grass-addons/grass7/vector/v.in.natura2000/v.in.natura2000.py
Log:
v.in.natura2000: error trapping of querying habitats and species
Modified: grass-addons/grass7/vector/v.in.natura2000/v.in.natura2000.py
===================================================================
--- grass-addons/grass7/vector/v.in.natura2000/v.in.natura2000.py 2015-12-02 15:47:13 UTC (rev 67007)
+++ grass-addons/grass7/vector/v.in.natura2000/v.in.natura2000.py 2015-12-02 20:42:57 UTC (rev 67008)
@@ -179,16 +179,26 @@
grass.message( "habitat codes of EU community interest:" )
conn = db.connect("%s" % n2k_input)
c = conn.cursor()
- for row in c.execute('SELECT HABITATCODE, DESCRIPTION FROM HABITATS GROUP BY HABITATCODE'):
- grass.message( row )
+ try:
+ for row in c.execute('SELECT HABITATCODE, DESCRIPTION FROM HABITATS GROUP BY HABITATCODE'):
+ grass.message( row )
+ except:
+ pass
+ grass.warning("Some problems querying habitat code or names occurred."
+ " Please check columns HABITATCODE and DESCRIPTION of table HABITATS in the sqlite database.")
conn.close()
if list_species :
grass.message( "species codes of EU community interest:" )
conn = db.connect("%s" % n2k_input)
c = conn.cursor()
- for row in c.execute('SELECT SPECIESCODE, SPECIESNAME FROM SPECIES GROUP BY SPECIESCODE'):
- grass.message( row )
+ try:
+ for row in c.execute('SELECT SPECIESCODE, SPECIESNAME FROM SPECIES GROUP BY SPECIESCODE'):
+ grass.message( row )
+ except:
+ pass
+ grass.warning("Some problems querying species code or names occurred."
+ " Please check columns SPECIESCODE and SPECIESNAME of table SPECIES in the sqlite database.")
conn.close()
if list_site_type :
More information about the grass-commit
mailing list