瀏覽代碼

Replace g.list/g.remove with g.mlist/g.mremove

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@62011 15284696-431f-4ddb-bdfa-cd5b030d7da7
Huidae Cho 10 年之前
父節點
當前提交
b4de42710e

+ 1 - 1
general/g.list/Makefile

@@ -1,6 +1,6 @@
 MODULE_TOPDIR = ../..
 
-PGM = g.mlist
+PGM = g.list
 
 LIBES = $(MANAGELIB) $(GISLIB) $(RASTERLIB) $(RASTER3DLIB) $(VECTORLIB)
 DEPENDENCIES = $(MANAGEDEP) $(GISDEP) $(RASTERDEP) $(RASTER3DDEP) $(VECTORDEP)

+ 25 - 31
general/g.list/g.mlist.html

@@ -1,16 +1,11 @@
 <h2>DESCRIPTION</h2>
 
-<em>g.mlist</em> searches for data files matching a pattern given by
-wildcards or POSIX Extended Regular Expressions. It is an extended
-version of <em><a href="g.list.html">g.list</a></em>.
-
-<p>
-See also the <em><a href="g.list.html">g.list</a></em> help page for
-discussion of some module options.
+<em>g.list</em> searches for data files matching a pattern given by
+wildcards or POSIX Extended Regular Expressions.
 
 <h2>NOTES</h2>
 
-The output of <em>g.mlist</em> may be useful for other programs' parameter
+The output of <em>g.list</em> may be useful for other programs' parameter
 input (e.g. time series for <em><a href="r.series.html">r.series</a></em>)
 when used with <em>separator=comma</em>.
 
@@ -18,23 +13,23 @@ when used with <em>separator=comma</em>.
 
 List all available GRASS data base files:
 <div class="code"><pre>
-g.mlist type=all
+g.list type=all
 </pre></div>
 
 List all raster and vector maps:
 <div class="code"><pre>
-g.mlist type=rast,vect
+g.list type=rast,vect
 </pre></div>
 
 <h3>Mapset search path</h3>
 
-If <b>mapset</b> is not specified than <em>g.mlist</em> searches for
+If <b>mapset</b> is not specified than <em>g.list</em> searches for
 data files in the mapsets which are included in the search path
 (defined by <em><a href="g.mapsets.html">g.mapsets</a></em>),
 see <tt>g.mapsets -p</tt>.
 
 <div class="code"><pre>
-g.mlist rast
+g.list rast
 
 raster map(s) available in mapset &lt;user1&gt;:
 dmt
@@ -48,7 +43,7 @@ By option <b>mapset</b>=. (one dot) can be listed only data files from
 the current mapset:
 
 <div class="code"><pre>
-g.mlist rast mapset=.
+g.list rast mapset=.
 raster map(s) available in mapset &lt;user1&gt;:
 dmt
 </pre></div>
@@ -58,7 +53,7 @@ available mapsets also including those which are not listed in the
 current search path (see <tt>g.mapsets -l</tt>).
 
 <div class="code"><pre>
-g.mlist rast mapset=*
+g.list rast mapset=*
 
 raster map(s) available in mapset &lt;landsat&gt;:
 lsat5_1987_10
@@ -75,41 +70,41 @@ aspect
 
 List all vector maps starting with letter "r":
 <div class="code"><pre>
-g.mlist type=vect pattern="r*"
+g.list type=vect pattern="r*"
 </pre></div>
 
 List all vector maps starting with letter "r" or "a":
 <div class="code"><pre>
-g.mlist type=vect pattern="[ra]*"
+g.list type=vect pattern="[ra]*"
 </pre></div>
 
 List all raster maps starting with "soil_" or "landuse_":
 <div class="code"><pre>
-g.mlist type=rast pattern="{soil,landuse}_*"
+g.list type=rast pattern="{soil,landuse}_*"
 </pre></div>
 
 List certain raster maps with one variable character/number:
 <div class="code"><pre>
-g.mlist type=rast pattern="N45E00?.meters"
+g.list type=rast pattern="N45E00?.meters"
 </pre></div>
 
 Use of <b>exclude</b> parameter:
 <div class="code"><pre>
 # without exclude:
-  g.mlist rast pat="r*" mapset=PERMANENT
+  g.list rast pat="r*" mapset=PERMANENT
   railroads
   roads
   rstrct.areas
   rushmore
 
 # exclude only complete word(s):
-  g.mlist rast pat="r*" exclude=roads mapset=PERMANENT
+  g.list rast pat="r*" exclude=roads mapset=PERMANENT
   railroads
   rstrct.areas
   rushmore
 
 # exclude with wildcard:
-  g.mlist rast pat="r*" exclude="*roads*" mapset=PERMANENT
+  g.list rast pat="r*" exclude="*roads*" mapset=PERMANENT
   rstrct.areas
   rushmore
 </pre></div>
@@ -118,31 +113,31 @@ Use of <b>exclude</b> parameter:
 
 List all soil maps starting with &quot;soils&quot; in their name:
 <div class="code"><pre>
-g.mlist -r type=rast pattern='^soils'
+g.list -r type=rast pattern='^soils'
 </pre></div>
 
 List &quot;tmp&quot; if &quot;tmp&quot; raster map exists:
 <div class="code"><pre>
-g.mlist -r type=rast pattern='^tmp$'
+g.list -r type=rast pattern='^tmp$'
 </pre></div>
 
 List &quot;tmp0&quot; ...&quot;tmp9&quot; if corresponding vector map exists
 (each map name linewise):
 <div class="code"><pre>
-g.mlist -r type=vect pattern='^tmp[0-9]$'
+g.list -r type=vect pattern='^tmp[0-9]$'
 </pre></div>
 
 List &quot;tmp0&quot;...&quot;tmp9&quot; if corresponding vector map exists
 (each map name comma separated):
 <div class="code"><pre>
-g.mlist -r type=vect separator=comma pattern='^tmp[0-9]$'
+g.list -r type=vect separator=comma pattern='^tmp[0-9]$'
 </pre></div>
 
 <h3>Extended regular expressions</h3>
 
 List all precipitation maps for the years 1997-2012, comma separated:
 <div class="code"><pre>
-g.mlist -e type=rast separator=comma pattern="precip_total.(199[7-9]|200[0-9]|201[0-2]).sum"
+g.list -e type=rast separator=comma pattern="precip_total.(199[7-9]|200[0-9]|201[0-2]).sum"
 </pre></div>
 
 <h3>Maps whose region overlaps with a saved region</h3>
@@ -151,29 +146,28 @@ List all raster maps starting with &quot;tmp_&quot; whose region overlaps with
 the region of &quot;test&quot; raster map:
 <div class="code"><pre>
 g.region rast=test save=test_region
-g.mlist type=rast pattern='tmp_*' region=test_region
+g.list type=rast pattern='tmp_*' region=test_region
 </pre></div>
 
 List &quot;tmp0&quot;...&quot;tmp9&quot; vector maps whose region overlaps with
 the current region:
 <div class="code"><pre>
-g.mlist -r type=vect pattern='^tmp[0-9]$' region=.
+g.list -r type=vect pattern='^tmp[0-9]$' region=.
 </pre></div>
 
 List all raster and vector maps whose region overlaps with the default region
 of the PERMANENT mapset in the current location (DEFAULT_WIND):
 <div class="code"><pre>
-g.mlist type=rast,vect region=*
+g.list type=rast,vect region=*
 </pre></div>
 
-Note that, without <tt>region=*</tt>, <tt>g.mlist type=rast,vect</tt> simply
+Note that, without <tt>region=*</tt>, <tt>g.list type=rast,vect</tt> simply
 lists all available raster and vector maps from the current search path
 regardless of their region.
 
 <h2>SEE ALSO</h2>
 
 <em>
-<a href="g.list.html">g.list</a>,
 <a href="r.series.html">r.series</a>,
 <a href="t.list.html">t.list</a>,
 <a href="t.rast.list.html">t.rast.list</a>,

+ 1 - 1
general/g.list/main.c

@@ -1,7 +1,7 @@
 
 /****************************************************************************
  *
- * MODULE:       g.mlist
+ * MODULE:       g.list
  *
  * AUTHOR(S):    Huidae Cho
  * 		 Based on general/manage/cmd/list.c by Michael Shapiro.

+ 6 - 6
general/g.list/testsuite/test_g_mlist.py

@@ -1,11 +1,11 @@
-"""g.mlist tests"""
+"""g.list tests"""
 
 import grass.gunittest
 from grass.gunittest.gmodules import SimpleModule
 
 
 class GMlistWrongParamertersTest(grass.gunittest.TestCase):
-    """Test wrong input of parameters for g.mlist module"""
+    """Test wrong input of parameters for g.list module"""
 
     @classmethod
     def setUpClass(cls):
@@ -20,7 +20,7 @@ class GMlistWrongParamertersTest(grass.gunittest.TestCase):
 
     def test_pt_flags(self):
         """Test that -p and -t flags are exclusive"""
-        module = SimpleModule('g.mlist', flags='pt', type='rast')
+        module = SimpleModule('g.list', flags='pt', type='rast')
         self.assertModuleFail(module)
         stderr = module.outputs.stderr
         self.assertIn('-p', stderr)
@@ -28,7 +28,7 @@ class GMlistWrongParamertersTest(grass.gunittest.TestCase):
 
     def test_ft_flags(self):
         """Test that -f and -t flags are exclusive"""
-        module = SimpleModule('g.mlist', flags='ft', type='rast')
+        module = SimpleModule('g.list', flags='ft', type='rast')
         self.assertModuleFail(module)
         stderr = module.outputs.stderr
         self.assertIn('-f', stderr)
@@ -36,7 +36,7 @@ class GMlistWrongParamertersTest(grass.gunittest.TestCase):
 
     def test_pf_flags(self):
         """Test that -p and -f flags are exclusive"""
-        module = SimpleModule('g.mlist', flags='pf', type='rast')
+        module = SimpleModule('g.list', flags='pf', type='rast')
         self.assertModuleFail(module)
         stderr = module.outputs.stderr
         self.assertIn('-p', stderr)
@@ -44,7 +44,7 @@ class GMlistWrongParamertersTest(grass.gunittest.TestCase):
 
     def test_re_flags(self):
         """Test that -r and -e flags are exclusive"""
-        module = SimpleModule('g.mlist', flags='re', type='rast')
+        module = SimpleModule('g.list', flags='re', type='rast')
         self.assertModuleFail(module)
         stderr = module.outputs.stderr
         self.assertIn('-r', stderr)

+ 1 - 1
general/g.remove/Makefile

@@ -1,6 +1,6 @@
 MODULE_TOPDIR = ../..
 
-PGM = g.mremove
+PGM = g.remove
 
 LIBES = $(MANAGELIB) $(RASTERLIB) $(GISLIB)
 DEPENDENCIES = $(MANAGEDEP) $(RASTERDEP) $(GISDEP)

+ 4 - 5
general/g.remove/g.mremove.html

@@ -1,6 +1,6 @@
 <h2>DESCRIPTION</h2>
 
-<em>g.mremove</em> removes data files matching a pattern given by wildcards or
+<em>g.remove</em> removes data files matching a pattern given by wildcards or
 POSIX Extended Regular Expressions. If the <b>-f</b> force flag is not given
 then nothing is removed, instead the list of selected file names is printed to
 <tt>stdout</tt> as a preview of the files to be deleted.
@@ -11,22 +11,21 @@ Delete all raster maps starting with "<tt>tmp_</tt>" in the current mapset:
 
 <div class="code"><pre>
 # show matching raster maps but do not delete yet (as verification)
-g.mremove type=rast pattern="tmp_*"
+g.remove type=rast pattern="tmp_*"
 
 # actually delete the matching raster maps
-g.mremove -f type=rast pattern="tmp_*"
+g.remove -f type=rast pattern="tmp_*"
 </pre></div>
 
 Delete all raster maps starting with "<tt>stream_</tt>" in the current mapset,
 but exclude those ending with "<tt>_final</tt>":
 <div class="code"><pre>
-g.mremove -f type=rast pattern="stream_*" exclude="*_final"
+g.remove -f type=rast pattern="stream_*" exclude="*_final"
 </pre></div>
 
 <h2>SEE ALSO</h2>
 
 <em>
-<a href="g.remove.html">g.remove</a>
 </em>
 
 <h2>AUTHOR</h2>

+ 2 - 3
general/g.remove/main.c

@@ -1,7 +1,7 @@
 
 /****************************************************************************
  *
- * MODULE:       g.mremove
+ * MODULE:       g.remove
  *
  * AUTHOR(S):    Huidae Cho <grass4u gmail.com>
  *
@@ -9,13 +9,12 @@
  *               CERL (original contributor),
  *               Radim Blazek <radim.blazek gmail.com>,
  *               Cedric Shock <cedricgrass shockfamily.net>,
- *               Huidae Cho <grass4u gmail.com>,
  *               Glynn Clements <glynn gclements.plus.com>,
  *               Jachym Cepicky <jachym les-ejk.cz>,
  *               Markus Neteler <neteler itc.it>,
  *               Martin Landa <landa.martin gmail.com>
  *
- * PURPOSE:      lets users remove GRASS database files
+ * PURPOSE:      Lets users remove GRASS database files
  *
  * COPYRIGHT:    (C) 1999-2014 by the GRASS Development Team
  *

+ 8 - 8
general/g.remove/testsuite/test_g_mremove.py

@@ -1,4 +1,4 @@
-"""Test of g.mremove module"""
+"""Test of g.remove module"""
 
 # TODO: rmapcalc probably fatals, replace or add raise on error?
 from grass.script.raster import mapcalc as rmapcalc
@@ -36,7 +36,7 @@ Removing raster <test_two>
 
 
 class GMRemoveTest(grass.gunittest.TestCase):
-    """Test removing with g.mremove"""
+    """Test removing with g.remove"""
 
     @classmethod
     def setUpClass(cls):
@@ -55,14 +55,14 @@ class GMRemoveTest(grass.gunittest.TestCase):
             rmapcalc("test_map_%i = 100" % i)
         rmapcalc("test_two = 2")
 
-        module = SimpleModule('g.mremove',
+        module = SimpleModule('g.remove',
                               type='rast', pattern='test_map_*,*two')
         self.assertModule(module)
         self.assertMultiLineEqual(module.outputs.stdout,
                                   REMOVE_RASTERS.replace('user1',
                                                          get_current_mapset()))
 
-        module = SimpleModule('g.mremove', type='rast',
+        module = SimpleModule('g.remove', type='rast',
                               pattern='test_map_*,*two', flags='f')
         self.assertModule(module)
         self.assertMultiLineEqual(module.outputs.stdout, '')
@@ -74,7 +74,7 @@ class GMRemoveTest(grass.gunittest.TestCase):
         rmapcalc("test_oranges = 200")
         rmapcalc("test_apples_big = 300")
         rmapcalc("test_apples_small = 300")
-        module = SimpleModule('g.mremove', type='rast',
+        module = SimpleModule('g.remove', type='rast',
                               pattern='test_{apples,oranges}*',
                               exclude="*_small")
         self.assertModule(module)
@@ -83,7 +83,7 @@ class GMRemoveTest(grass.gunittest.TestCase):
                                   'rast/test_apples_big@user1\n'
                                   'rast/test_oranges@user1\n'.replace(
                                       'user1', get_current_mapset()))
-        module = SimpleModule('g.mremove', type='rast',
+        module = SimpleModule('g.remove', type='rast',
                               pattern='test_{apples,oranges}{_small,_big,*}',
                               flags='f')
         self.assertModule(module)
@@ -93,11 +93,11 @@ class GMRemoveTest(grass.gunittest.TestCase):
 
 
 class GMRemoveWrongInputTest(grass.gunittest.TestCase):
-    """Test wrong input of parameters for g.mlist module"""
+    """Test wrong input of parameters for g.remove module"""
 
     def test_re_flags(self):
         """Test that -r and -e flags are exclusive"""
-        module = SimpleModule('g.mremove', flags='re',
+        module = SimpleModule('g.remove', flags='re',
                               type='rast', pattern='xxxyyyzzz')
         self.assertModuleFail(module)
         stderr = module.outputs.stderr