[GRASS-SVN] r70028 - grass/branches/releasebranch_7_2/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 7 02:24:09 PST 2016


Author: martinl
Date: 2016-12-07 02:24:08 -0800 (Wed, 07 Dec 2016)
New Revision: 70028

Modified:
   grass/branches/releasebranch_7_2/lib/init/grass7.html
Log:
init: PEP8 the example

In case we are trying to set good example for the beginners by the modern print() in r70020,
let's set good example also by using PEP8 (W293, E251 and potential E211).

But the whole change may not be that friendly to beginners because
G does not support Python 3 yet and print() here is still not a function,
so using it as the Python 3 one fails.
(merge r70027 from trunk)


Modified: grass/branches/releasebranch_7_2/lib/init/grass7.html
===================================================================
--- grass/branches/releasebranch_7_2/lib/init/grass7.html	2016-12-07 04:31:16 UTC (rev 70027)
+++ grass/branches/releasebranch_7_2/lib/init/grass7.html	2016-12-07 10:24:08 UTC (rev 70028)
@@ -349,15 +349,15 @@
 import grass.script.setup as gsetup
 
 gscript.message('Current GRASS GIS 7 environment:')
-print (gscript.gisenv())
- 
+print(gscript.gisenv())
+
 gscript.message('Available raster maps:')
-for raster in gscript.list_strings(type = 'raster'):
-    print (raster)
- 
+for raster in gscript.list_strings(type='raster'):
+    print(raster)
+
 gscript.message('Available vector maps:')
-for vector in gscript.list_strings(type = 'vector'):
-    print (vector)
+for vector in gscript.list_strings(type='vector'):
+    print(vector)
 </pre></div>
 
 <h4>Troubleshooting</h4>



More information about the grass-commit mailing list