[GRASS-SVN] r73789 - in grass-addons/grass7/raster: r.droka r.valley.bottom

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Dec 10 13:44:50 PST 2018


Author: neteler
Date: 2018-12-10 13:44:50 -0800 (Mon, 10 Dec 2018)
New Revision: 73789

Modified:
   grass-addons/grass7/raster/r.droka/r.droka.py
   grass-addons/grass7/raster/r.valley.bottom/r.valley.bottom.py
Log:
r.droka + r.valley.bottom addons:  print statements/os.environ() usage updated (needed for Python3)

Modified: grass-addons/grass7/raster/r.droka/r.droka.py
===================================================================
--- grass-addons/grass7/raster/r.droka/r.droka.py	2018-12-10 21:40:30 UTC (rev 73788)
+++ grass-addons/grass7/raster/r.droka/r.droka.py	2018-12-10 21:44:50 UTC (rev 73789)
@@ -87,7 +87,7 @@
     except:
         sys.exit("grass.script can't be imported.")
 
-if not os.environ.has_key("GISBASE"):
+if "GISBASE" not in os.environ:
     print("You must be in GRASS GIS to run this program.")
     sys.exit(1)
 
@@ -306,6 +306,7 @@
             'somma') ,
         quiet = True )
     grass.message("Done!")
+
 if __name__ == "__main__":
     options, flags = grass.parser()
     sys.exit(main())

Modified: grass-addons/grass7/raster/r.valley.bottom/r.valley.bottom.py
===================================================================
--- grass-addons/grass7/raster/r.valley.bottom/r.valley.bottom.py	2018-12-10 21:40:30 UTC (rev 73788)
+++ grass-addons/grass7/raster/r.valley.bottom/r.valley.bottom.py	2018-12-10 21:44:50 UTC (rev 73789)
@@ -117,8 +117,8 @@
 import random
 import string
 
-if not "GISBASE" in os.environ.keys():
-    grass.message("You must be in GRASS GIS to run this program.")
+if "GISBASE" not in os.environ:
+    print("You must be in GRASS GIS to run this program.")
     sys.exit(1)
 
 



More information about the grass-commit mailing list