[GRASS-SVN] r50943 - grass-addons/grass6/raster/r.basin

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Feb 25 17:47:40 EST 2012


Author: hamish
Date: 2012-02-25 14:47:40 -0800 (Sat, 25 Feb 2012)
New Revision: 50943

Modified:
   grass-addons/grass6/raster/r.basin/r.basin.py
Log:
don't work around g.extension.py install problems. a better work around might be to test for the needed module at the start of the script, and if it doesn't exist try wit the .py added, and set the good program name to a string variable for later use. see various wget vs. curl examples in other scripts. ideally g.ext.py gets fixed though. (g.ext.sh already strips the .py at install time)

Modified: grass-addons/grass6/raster/r.basin/r.basin.py
===================================================================
--- grass-addons/grass6/raster/r.basin/r.basin.py	2012-02-25 20:10:31 UTC (rev 50942)
+++ grass-addons/grass6/raster/r.basin/r.basin.py	2012-02-25 22:47:40 UTC (rev 50943)
@@ -71,7 +71,6 @@
 from numpy import array
 from numpy import zeros
 import csv
-import platform
 
 if not os.environ.has_key("GISBASE"):
     grass.message( "You must be in GRASS GIS to run this program." )
@@ -119,9 +118,7 @@
     v_ord_1 = prefix+'_ord_1'
     global tmp
     
-    # get info about the platform
-    plat = platform.system()
-    
+   
     # Save current region
     grass.read_command('g.region', flags = 'p', save = 'original', overwrite = True)
 
@@ -291,32 +288,18 @@
                                            flags = 'o', 
                                            distance = r_distance,
                                            overwrite = True)
-                                           
-        if plat == "Windows":
-            # Ipsographic curve
-            grass.message( "##################################" )
-            grass.run_command('r.ipso', map = 'r_elevation_crop', image = prefix, flags = 'ab') 
-            grass.message( "##################################" )  
-            # Width Function 
-            grass.message( "##################################" )
-            grass.run_command('r.wf', map = r_distance, 
-                                      image = prefix) 
-            grass.message( "##################################" )                     
-        
-        else:
-            # Ipsographic curve
-            grass.message( "##################################" )
-            grass.run_command('r.ipso.py', map = 'r_elevation_crop', 
-                                           image = prefix, 
-                                           flags = 'ab')
-            grass.message( "##################################" )
-    
-            # Width Function
-            grass.message( "##################################" )
-            grass.run_command('r.wf.py', map = r_distance, 
-                                               image = prefix) 
-            grass.message( "##################################" )                         
-    
+
+        # Ipsographic curve
+        grass.message( "##################################" )
+        grass.run_command('r.ipso', map = 'r_elevation_crop',
+                                  image = prefix, flags = 'ab')
+        grass.message( "##################################" )
+        # Width Function
+        grass.message( "##################################" )
+        grass.run_command('r.wf', map = r_distance,
+                                  image = prefix)
+        grass.message( "##################################" )
+
         # Creation of map of hillslope distance to river network
         grass.run_command('r.stream.distance', stream = r_stream_e, 
                                            dir = r_drainage, 



More information about the grass-commit mailing list