[GRASS-SVN] r67009 - grass-addons/grass7/vector/v.in.natura2000

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 2 13:09:49 PST 2015


Author: hellik
Date: 2015-12-02 13:09:49 -0800 (Wed, 02 Dec 2015)
New Revision: 67009

Modified:
   grass-addons/grass7/vector/v.in.natura2000/v.in.natura2000.py
Log:
v.in.natura2000: grass.fatal if pyspatialite is not installed

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 20:42:57 UTC (rev 67008)
+++ grass-addons/grass7/vector/v.in.natura2000/v.in.natura2000.py	2015-12-02 21:09:49 UTC (rev 67009)
@@ -117,10 +117,6 @@
 import shutil
 import tempfile
 import grass.script as grass
-try:
-    import pyspatialite.dbapi2 as db
-except ImportError:
-    grass.warning( "pyspatialite has to be installed." )
 
 if not os.environ.has_key("GISBASE"):
     grass.message( "You must be in GRASS GIS to run this program." )
@@ -151,7 +147,14 @@
     list_species = flags['s']
     list_site_type = flags['t']
     global tmp	 
- 
+
+    try:
+		import pyspatialite.dbapi2 as db
+    except:
+		grass.fatal( "pyspatialite is needed to run this script.\n"
+				     "source: https://pypi.python.org/pypi/pyspatialite \n"
+				     "Please activate/install it in your python stack.")	
+
     if list_n2k_layer :
         grass.message( "Available data layer(s):" )
         grass.message( "may take some time ..." )



More information about the grass-commit mailing list