[GRASS-SVN] r70027 - grass/trunk/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Dec 6 20:31:16 PST 2016


Author: wenzeslaus
Date: 2016-12-06 20:31:16 -0800 (Tue, 06 Dec 2016)
New Revision: 70027

Modified:
   grass/trunk/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.


Modified: grass/trunk/lib/init/grass7.html
===================================================================
--- grass/trunk/lib/init/grass7.html	2016-12-06 23:33:30 UTC (rev 70026)
+++ grass/trunk/lib/init/grass7.html	2016-12-07 04:31:16 UTC (rev 70027)
@@ -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