Browse Source

update g.copy calls to use new element names (https://trac.osgeo.org/grass/ticket/2409)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@63656 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 10 years ago
parent
commit
0fd4fcfbbf

+ 1 - 1
gui/wxpython/iscatt/iscatt_core.py

@@ -197,7 +197,7 @@ class Core:
             return 1
         
         return RunCommand("g.copy", 
-                          rast=cat_rast + ',' + rast_name,
+                          raster=cat_rast + ',' + rast_name,
                           getErrorMsg=True,
                           overwrite=True)
 

+ 3 - 3
gui/wxpython/lmgr/datacatalog.py

@@ -388,13 +388,13 @@ class DataCatalogTree(LocationMapTree):
             label = _("Copying") + " " + string + " ..."
             self.showNotification.emit(message=label)
             if (self.GetItemText(self.copy_type)=='vector'):
-                pasted = RunCommand('g.copy', vect=string)
+                pasted = RunCommand('g.copy', vector=string)
                 node = 'vector'     
             elif (self.GetItemText(self.copy_type)=='raster'):
-                pasted = RunCommand('g.copy', rast=string)
+                pasted = RunCommand('g.copy', raster=string)
                 node = 'raster'
             else:
-                pasted = RunCommand('g.copy', rast3d=string)
+                pasted = RunCommand('g.copy', raster_3d=string)
                 node = 'raster_3d'
             if pasted == 0:
                 if self.selected_type == None:

+ 1 - 1
gui/wxpython/rdigit/controller.py

@@ -406,7 +406,7 @@ class RDigitController(wx.EvtHandler):
         name = name.split('@')[0]
         backup = name + '_backupcopy_' + str(os.getpid())
         try:
-            gcore.run_command('g.copy', rast=[name, backup], quiet=True)
+            gcore.run_command('g.copy', raster=[name, backup], quiet=True)
         except CalledModuleError:
             raise ScriptError
 

+ 5 - 5
gui/wxpython/vnet/vnet_core.py

@@ -348,7 +348,7 @@ class VNETManager:
 
         RunCommand("g.copy",
                     overwrite = True,
-                    vect = [self.results["vect_map"].GetVectMapName(), mapName])
+                    vector = [self.results["vect_map"].GetVectMapName(), mapName])
 
         if len(self.giface.GetLayerList().GetLayersByName(mapName)) == 0:
             # TODO: get rid of insert
@@ -429,14 +429,14 @@ class VNETAnalyses:
             mapName, mapSet = ParseMapStr(self.tmpTurnAn.GetVectMapName())
             cmdCopy = [ 
                         "g.copy",
-                        "vect=%s,%s" % (params["input"], mapName), 
+                        "vector=%s,%s" % (params["input"], mapName), 
                         "--overwrite",                             
                        ]
             cmdParams.append("input=" + self.tmpTurnAn.GetVectMapName())
 
             ret, msg, err = RunCommand('g.copy',
                                         getErrorMsg = True,
-                                        vect = "%s,%s" % (params['input'], mapName),
+                                        vector = "%s,%s" % (params['input'], mapName),
                                         read = True,
                                         overwrite = True)
 
@@ -514,14 +514,14 @@ class VNETAnalyses:
         mapName, mapSet = ParseMapStr(self.tmpTurnAn.GetVectMapName())
         cmdCopy = [ 
                     "g.copy",
-                    "vect=%s,%s" % (params['input'], mapName), 
+                    "vector=%s,%s" % (params['input'], mapName), 
                     "--overwrite",                             
                    ]
         cmdParams.append("input=" + self.tmpTurnAn.GetVectMapName())
 
         ret, msg, err = RunCommand('g.copy',
                                     getErrorMsg = True,
-                                    vect = "%s,%s" % (params['input'], mapName),
+                                    vector = "%s,%s" % (params['input'], mapName),
                                     read = True,
                                     overwrite = True)
 

+ 1 - 1
lib/python/pygrass/raster/testsuite/test_raster.py

@@ -15,7 +15,7 @@ class RasterRowTestCate(TestCase):
 
         cls.name = 'elevation'
         cls.tmp = 'tmp' + cls.name
-        g.copy(rast=[cls.name, cls.tmp], overwrite=True)
+        g.copy(raster=[cls.name, cls.tmp], overwrite=True)
 
     @classmethod
     def tearDownClass(cls):

+ 3 - 3
lib/python/pygrass/tests/set_mapset.py

@@ -60,7 +60,7 @@ def main():
     grasscore.run_command('db.login', user=opts.user)
     print("\n\nCopy the map from PERMANENT to user1...\n")
     grasscore.run_command('g.copy',
-                          vect="boundary_municp@PERMANENT,boundary_municp_pg",
+                          vector="boundary_municp@PERMANENT,boundary_municp_pg",
                           overwrite=True)
     print("\n\nBuild topology...\n")
     grasscore.run_command('v.build', map='boundary_municp_pg', overwrite=True)
@@ -75,10 +75,10 @@ def main():
                           database=os.path.join(db))
     print("\n\nCopy the map from PERMANENT to user1...\n")
     grasscore.run_command('g.copy',
-                          vect="boundary_municp@PERMANENT,boundary_municp_sqlite",
+                          vector="boundary_municp@PERMANENT,boundary_municp_sqlite",
                           overwrite=True)
     print("\n\nBuild topology...\n")
     grasscore.run_command('v.build', map='boundary_municp_sqlite', overwrite=True)
 
 if __name__ == "__main__":
-    main()
+    main()

+ 4 - 4
lib/python/script/db.py

@@ -28,7 +28,7 @@ def db_describe(table, **args):
     """Return the list of columns for a database table
     (interface to `db.describe -c`). Example:
 
-    >>> run_command('g.copy', vect='firestations,myfirestations')
+    >>> run_command('g.copy', vector='firestations,myfirestations')
     0
     >>> db_describe('myfirestations') # doctest: +ELLIPSIS
     {'nrows': 71, 'cols': [['cat', 'INTEGER', '20'], ... 'ncols': 22}
@@ -68,7 +68,7 @@ def db_table_exist(table, **args):
     If no driver or database are given, then default settings is used
     (check db_connection()).
 
-    >>> run_command('g.copy', vect='firestations,myfirestations')
+    >>> run_command('g.copy', vector='firestations,myfirestations')
     0
     >>> db_table_exist('myfirestations')
     True
@@ -121,7 +121,7 @@ def db_select(sql=None, filename=None, table=None, **args):
 
     Examples:
 
-    >>> run_command('g.copy', vect='firestations,myfirestations')
+    >>> run_command('g.copy', vector='firestations,myfirestations')
     0
     >>> db_select(sql = 'SELECT cat,CITY FROM myfirestations WHERE cat < 4')
     (('1', 'Morrisville'), ('2', 'Morrisville'), ('3', 'Apex'))
@@ -171,7 +171,7 @@ def db_table_in_vector(table):
     """Return the name of vector connected to the table.
     It returns None if no vectors are connected to the table.
 
-    >>> run_command('g.copy', vect='firestations,myfirestations')
+    >>> run_command('g.copy', vector='firestations,myfirestations')
     0
     >>> db_table_in_vector('myfirestations')
     ['myfirestations@user1']

+ 1 - 1
scripts/d.rast.edit/d.rast.edit.py

@@ -490,7 +490,7 @@ class Application(wx.App):
 
 	atexit.register(self.cleanup)
 
-	run('g.copy', rast = (self.inmap, self.outmap), overwrite = True)
+	run('g.copy', raster = (self.inmap, self.outmap), overwrite = True)
 	run('r.colors', map = self.outmap, rast = self.inmap)
 
     def cleanup(self):

+ 3 - 3
scripts/r.in.wms/wms_base.py

@@ -452,7 +452,7 @@ class GRASSImporter:
                 try:
                     mask_copy = self.opt_output + self.original_mask_suffix
                     grass.run_command('g.copy', quiet=True,
-                                      rast=mask_copy + ',MASK')
+                                      raster=mask_copy + ',MASK')
                 except CalledModuleError:
                     grass.fatal(_('%s failed') % 'g.copy')
 
@@ -468,7 +468,7 @@ class GRASSImporter:
                 grass.run_command('g.remove',
                                   quiet = True,
                                   flags = 'fb',
-                                  type = 'rast',
+                                  type = 'raster',
                                   name = ','.join(maps))
         
         # delete environmental variable which overrides region 
@@ -506,7 +506,7 @@ class GRASSImporter:
                 try:
                     mask_copy = self.opt_output + self.original_mask_suffix
                     grass.run_command('g.copy', quiet=True,
-                                      rast='MASK,' + mask_copy)
+                                      raster='MASK,' + mask_copy)
                 except CalledModuleError:
                     grass.fatal(_('%s failed') % 'g.copy')
 

+ 1 - 1
scripts/v.out.gps/v.out.gps.py

@@ -174,7 +174,7 @@ def main():
 
 	inmap = tmp_extr
     else:
-	#   g.copy "$GIS_OPT_INPUT,tmp_vogb_extr_$$"   # to get a copy of DB into local mapset
+	#   g.copy vector="$GIS_OPT_INPUT,tmp_vogb_extr_$$"   # to get a copy of DB into local mapset
 	#   INMAP="tmp_vogb_extr_$$"
 	inmap = input
 

+ 1 - 1
temporal/t.rast.out.vtk/t.rast.out.vtk.py

@@ -119,7 +119,7 @@ def main():
             if id is None:
                 id = null_map
 
-            grass.run_command("g.copy", rast="%s,%s" % (id, map_name),
+            grass.run_command("g.copy", raster="%s,%s" % (id, map_name),
                               overwrite=True)
             out_name = "%6.6i_%s.vtk" % (count, sp.base.get_name())