[GRASS-SVN] r63494 - grass-addons/grass7/raster/r.surf.nnbathy
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Dec 12 03:53:52 PST 2014
Author: martinl
Date: 2014-12-12 03:53:52 -0800 (Fri, 12 Dec 2014)
New Revision: 63494
Modified:
grass-addons/grass7/raster/r.surf.nnbathy/r.surf.nnbathy.py
Log:
r.surf.nnbathy: fix requirement, check if input raster map exists
Modified: grass-addons/grass7/raster/r.surf.nnbathy/r.surf.nnbathy.py
===================================================================
--- grass-addons/grass7/raster/r.surf.nnbathy/r.surf.nnbathy.py 2014-12-12 11:45:33 UTC (rev 63493)
+++ grass-addons/grass7/raster/r.surf.nnbathy/r.surf.nnbathy.py 2014-12-12 11:53:52 UTC (rev 63494)
@@ -58,16 +58,23 @@
import os
import sys
-from grass.script.core import parser
import grass.script as grass
def main():
- sys.path.insert(1, os.path.join(os.path.dirname(sys.path[0]), 'etc', 'nnbathy'))
- from nnbathy import Nnbathy_raster
+ sys.path.insert(1, os.path.join(os.path.dirname(sys.path[0]), 'etc', 'v.surf.nnbathy'))
+ try:
+ from nnbathy import Nnbathy_raster
+ except ImportError:
+ grass.fatal("r.surf.nnbathy requires 'v.surf.nnbathy'. "
+ "Please install this module by running:\ng.extension v.surf.nnbathy")
+
+ if not grass.find_file(options['input'], element='cell')['fullname']:
+ grass.fatal("Raster map <%s> not found")
+
obj = Nnbathy_raster(options)
obj.compute()
obj.create_output()
if __name__ == "__main__":
- options, flags = parser()
+ options, flags = grass.parser()
main()
More information about the grass-commit
mailing list