- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
grass-addons/grass7/vector/v.in.natura2000/v.in.natura2000.py
r66995 r67009 118 118 import tempfile 119 119 import grass.script as grass 120 try:121 import pyspatialite.dbapi2 as db122 except ImportError:123 grass.warning( "pyspatialite has to be installed." )124 120 125 121 if not os.environ.has_key("GISBASE"): … … 152 148 list_site_type = flags['t'] 153 149 global tmp 154 150 151 try: 152 import pyspatialite.dbapi2 as db 153 except: 154 grass.fatal( "pyspatialite is needed to run this script.\n" 155 "source: https://pypi.python.org/pypi/pyspatialite \n" 156 "Please activate/install it in your python stack.") 157 155 158 if list_n2k_layer : 156 159 grass.message( "Available data layer(s):" ) … … 180 183 conn = db.connect("%s" % n2k_input) 181 184 c = conn.cursor() 182 for row in c.execute('SELECT HABITATCODE, DESCRIPTION FROM HABITATS GROUP BY HABITATCODE'): 183 grass.message( row ) 185 try: 186 for row in c.execute('SELECT HABITATCODE, DESCRIPTION FROM HABITATS GROUP BY HABITATCODE'): 187 grass.message( row ) 188 except: 189 pass 190 grass.warning("Some problems querying habitat code or names occurred." 191 " Please check columns HABITATCODE and DESCRIPTION of table HABITATS in the sqlite database.") 184 192 conn.close() 185 193 … … 188 196 conn = db.connect("%s" % n2k_input) 189 197 c = conn.cursor() 190 for row in c.execute('SELECT SPECIESCODE, SPECIESNAME FROM SPECIES GROUP BY SPECIESCODE'): 191 grass.message( row ) 198 try: 199 for row in c.execute('SELECT SPECIESCODE, SPECIESNAME FROM SPECIES GROUP BY SPECIESCODE'): 200 grass.message( row ) 201 except: 202 pass 203 grass.warning("Some problems querying species code or names occurred." 204 " Please check columns SPECIESCODE and SPECIESNAME of table SPECIES in the sqlite database.") 192 205 conn.close() 193 206
Note:
See TracChangeset
for help on using the changeset viewer.
