[GRASS-SVN] r61043 - in grass/branches/releasebranch_7_0: lib/python/temporal scripts/i.pansharpen scripts/r3.in.xyz

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jun 28 16:16:01 PDT 2014


Author: hcho
Date: 2014-06-28 16:16:01 -0700 (Sat, 28 Jun 2014)
New Revision: 61043

Modified:
   grass/branches/releasebranch_7_0/lib/python/temporal/temporal_raster3d_algebra.py
   grass/branches/releasebranch_7_0/lib/python/temporal/temporal_raster_algebra.py
   grass/branches/releasebranch_7_0/lib/python/temporal/temporal_vector_algebra.py
   grass/branches/releasebranch_7_0/scripts/i.pansharpen/i.pansharpen.py
   grass/branches/releasebranch_7_0/scripts/r3.in.xyz/r3.in.xyz.py
Log:
g.mremove: update python code for new g.mremove interface

Modified: grass/branches/releasebranch_7_0/lib/python/temporal/temporal_raster3d_algebra.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/temporal/temporal_raster3d_algebra.py	2014-06-28 23:06:09 UTC (rev 61042)
+++ grass/branches/releasebranch_7_0/lib/python/temporal/temporal_raster3d_algebra.py	2014-06-28 23:16:01 UTC (rev 61043)
@@ -50,7 +50,8 @@
 
                 if self.run:
                     m = copy.deepcopy(self.m_mremove)
-                    m.inputs["rast3d"].value = stringlist
+                    m.inputs["type"].value = "rast3d"
+                    m.inputs["pattern"].value = stringlist
                     m.flags["f"].value = True
                     m.run()
 

Modified: grass/branches/releasebranch_7_0/lib/python/temporal/temporal_raster_algebra.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/temporal/temporal_raster_algebra.py	2014-06-28 23:06:09 UTC (rev 61042)
+++ grass/branches/releasebranch_7_0/lib/python/temporal/temporal_raster_algebra.py	2014-06-28 23:16:01 UTC (rev 61043)
@@ -91,7 +91,8 @@
 
                 if self.run:
                     m = copy.deepcopy(self.m_mremove)
-                    m.inputs["rast"].value = stringlist
+                    m.inputs["type"].value = "rast"
+                    m.inputs["pattern"].value = stringlist
                     m.flags["f"].value = True
                     m.run()
 

Modified: grass/branches/releasebranch_7_0/lib/python/temporal/temporal_vector_algebra.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/temporal/temporal_vector_algebra.py	2014-06-28 23:06:09 UTC (rev 61042)
+++ grass/branches/releasebranch_7_0/lib/python/temporal/temporal_vector_algebra.py	2014-06-28 23:16:01 UTC (rev 61043)
@@ -520,11 +520,12 @@
             for chunk in chunklist:
                 stringlist = ",".join(chunk)
                 if self.debug:
-                    print "g.mremove vect=%s"%(stringlist)
+                    print "g.mremove type=vect pattern=%s"%(stringlist)
 
                 if self.run:
                     m = copy.deepcopy(self.m_mremove)
-                    m.inputs["vect"].value = stringlist
+                    m.inputs["type"].value = "vect"
+                    m.inputs["pattern"].value = stringlist
                     m.flags["f"].value = True
                     m.run()
 

Modified: grass/branches/releasebranch_7_0/scripts/i.pansharpen/i.pansharpen.py
===================================================================
--- grass/branches/releasebranch_7_0/scripts/i.pansharpen/i.pansharpen.py	2014-06-28 23:06:09 UTC (rev 61042)
+++ grass/branches/releasebranch_7_0/scripts/i.pansharpen/i.pansharpen.py	2014-06-28 23:16:01 UTC (rev 61043)
@@ -300,7 +300,7 @@
 
         
         # Cleanup
-        grass.run_command('g.mremove', flags='f', quiet=True, rast='tmp%s*,%s' % (pid,panmatch))
+        grass.run_command('g.mremove', flags='f', quiet=True, type="rast", pattern='tmp%s*,%s' % (pid,panmatch))
         
     #Could add other sharpening algorithms here, e.g. wavelet transformation
 
@@ -341,7 +341,7 @@
         grass.raster_history("%s_%s" % (out, ch))
 
     # Cleanup        
-    grass.run_command('g.mremove', flags="f", rast="tmp%s*" % pid, quiet=True)
+    grass.run_command('g.mremove', flags="f", type="rast", pattern="tmp%s*" % pid, quiet=True)
 
         
 def matchhist(original, target, matched):

Modified: grass/branches/releasebranch_7_0/scripts/r3.in.xyz/r3.in.xyz.py
===================================================================
--- grass/branches/releasebranch_7_0/scripts/r3.in.xyz/r3.in.xyz.py	2014-06-28 23:06:09 UTC (rev 61042)
+++ grass/branches/releasebranch_7_0/scripts/r3.in.xyz/r3.in.xyz.py	2014-06-28 23:16:01 UTC (rev 61043)
@@ -179,7 +179,7 @@
 
 def cleanup():
     grass.run_command('g.mremove', flags = 'f',
-		      rast = 'tmp.r3xyz.%d.*' % os.getpid(),
+		      type = "rast", pattern = 'tmp.r3xyz.%d.*' % os.getpid(),
 		      quiet = True)
 
 



More information about the grass-commit mailing list