[GRASS-SVN] r42229 - grass/trunk/scripts/v.in.mapgen

svn_grass at osgeo.org svn_grass at osgeo.org
Wed May 12 01:53:37 EDT 2010


Author: martinl
Date: 2010-05-12 01:53:37 -0400 (Wed, 12 May 2010)
New Revision: 42229

Modified:
   grass/trunk/scripts/v.in.mapgen/v.in.mapgen.py
Log:
v.in.mapgen: print error message if fails, see #1065


Modified: grass/trunk/scripts/v.in.mapgen/v.in.mapgen.py
===================================================================
--- grass/trunk/scripts/v.in.mapgen/v.in.mapgen.py	2010-05-12 05:47:36 UTC (rev 42228)
+++ grass/trunk/scripts/v.in.mapgen/v.in.mapgen.py	2010-05-12 05:53:37 UTC (rev 42229)
@@ -122,10 +122,14 @@
 		if len(f) == 2:
 		    f.append('0')
 		points.append(f)
+        
 	if points != []:
 	    outf.write("L %d\n" % len(points))
 	    for point in points:
-		outf.write(" %.8f %.8f %.8f\n" % tuple(map(float,point)))
+                try:
+                    outf.write(" %.8f %.8f %.8f\n" % tuple(map(float, point)))
+                except ValueError:
+                    grass.fatal(_("An error occured on line '%s', exiting.") % line.strip())
     else:
         ## mapgen format.
 	points = []



More information about the grass-commit mailing list