[GRASS-SVN] r68240 - grass/trunk/scripts/v.report

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Apr 10 04:44:28 PDT 2016


Author: hcho
Date: 2016-04-10 04:44:28 -0700 (Sun, 10 Apr 2016)
New Revision: 68240

Modified:
   grass/trunk/scripts/v.report/v.report.py
Log:
v.report: Don't print extra newlines for vectors with no db links

Modified: grass/trunk/scripts/v.report/v.report.py
===================================================================
--- grass/trunk/scripts/v.report/v.report.py	2016-04-10 03:27:03 UTC (rev 68239)
+++ grass/trunk/scripts/v.report/v.report.py	2016-04-10 11:44:28 UTC (rev 68240)
@@ -145,11 +145,12 @@
 
         #make pre-table
         p = grass.pipe_command('v.to.db', flags = 'p',
+                               quiet = True,
                                map = mapname, option = option, columns = columns,
                                layer = layer, units = unitsp)
         records3 = []
         for line in p.stdout:
-            fields = line.split('|')
+            fields = line.rstrip('\r\n').split('|')
             if fields[0] in ['cat', '-1', '0']:
                 continue
             records3.append([int(fields[0])] + fields[1:])



More information about the grass-commit mailing list