[GRASS-SVN] r63631 - in grass/branches/releasebranch_7_0: . gui/wxpython/psmap scripts/d.rast.edit scripts/i.in.spotvgt scripts/r.fillnulls scripts/r.mask scripts/v.rast.stats testsuite/raster
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Dec 19 14:19:21 PST 2014
Author: neteler
Date: 2014-12-19 14:19:21 -0800 (Fri, 19 Dec 2014)
New Revision: 63631
Modified:
grass/branches/releasebranch_7_0/
grass/branches/releasebranch_7_0/gui/wxpython/psmap/dialogs.py
grass/branches/releasebranch_7_0/gui/wxpython/psmap/utils.py
grass/branches/releasebranch_7_0/scripts/d.rast.edit/d.rast.edit.py
grass/branches/releasebranch_7_0/scripts/i.in.spotvgt/i.in.spotvgt.py
grass/branches/releasebranch_7_0/scripts/r.fillnulls/r.fillnulls.py
grass/branches/releasebranch_7_0/scripts/r.mask/r.mask.py
grass/branches/releasebranch_7_0/scripts/v.rast.stats/v.rast.stats.py
grass/branches/releasebranch_7_0/testsuite/raster/raster_md5test.sh
Log:
update g.region/g.rename calls to use new element names (#2409) (trunk, r63630)
Property changes on: grass/branches/releasebranch_7_0
___________________________________________________________________
Modified: svn:mergeinfo
- /grass/trunk:60817,61096,61141,61994,62105,62179-62180,62182,62403,62422,62424,62437,62466,62469,62487,62491,62494,62501,62506,62508-62509,62515,62518-62519,62521,62526,62533,62539,62541,62555,62562,62566,62570,62573,62575,62585,62588,62597,62603,62606,62608-62609,62614,62618,62628,62632,62638,62642,62648-62649,62652,62654-62657,62666,62691,62705,62709,62723,62730,62739,62741,62743,62746,62750,62752,62757,62762,62785,62798,62800-62801,62803,62805,62812,62822,62824,62831,62838,62847,62850,62856,62879,62881,62886,62904,62907-62908,62910,62912,62914,62916,62918,62920,62925,62932-62933,62935,62940,62942,62944-62946,62949,62955-62956,62958,62960,62962,62964,62966-62968,62970,62973,62975,62977,62981,62983,62985,62987,62989,62991,62993,62995,62997,62999-63000,63003,63005,63007,63009,63011,63013,63015,63017,63020,63022,63024,63026,63028-63031,63033,63035,63037,63040,63043-63044,63047,63049,63051,63053,63055,63057,63060,63062-63064,63066,63068,63070-63071,63074,63076,63079,63081,
63083,63085,63087,63089,63091,63093,63095,63098,63100,63102,63105,63107,63109,63111,63113-63114,63116,63119,63121,63123,63125,63130,63132-63133,63135,63137,63140,63143,63145,63147,63149,63151,63153-63154,63157,63160,63165,63170,63173,63175,63187,63192-63193,63196,63199-63200,63202,63209,63216,63220-63221,63224,63227,63240,63246,63250,63255,63259,63261,63276,63279,63281,63283,63287,63290,63292,63297,63302,63307,63315,63319,63327,63330,63332,63339,63342,63345,63362,63367,63391,63393,63408-63409,63416-63417,63425,63427,63429,63431,63433,63448,63451,63453,63457,63459,63464-63470,63473,63482,63497,63505,63508,63510,63515,63521-63524,63526,63536-63537,63551-63552,63554,63556,63558-63559,63562,63570,63576,63582,63589-63593,63602,63616,63624,63626,63628
+ /grass/trunk:60817,61096,61141,61994,62105,62179-62180,62182,62403,62422,62424,62437,62466,62469,62487,62491,62494,62501,62506,62508-62509,62515,62518-62519,62521,62526,62533,62539,62541,62555,62562,62566,62570,62573,62575,62585,62588,62597,62603,62606,62608-62609,62614,62618,62628,62632,62638,62642,62648-62649,62652,62654-62657,62666,62691,62705,62709,62723,62730,62739,62741,62743,62746,62750,62752,62757,62762,62785,62798,62800-62801,62803,62805,62812,62822,62824,62831,62838,62847,62850,62856,62879,62881,62886,62904,62907-62908,62910,62912,62914,62916,62918,62920,62925,62932-62933,62935,62940,62942,62944-62946,62949,62955-62956,62958,62960,62962,62964,62966-62968,62970,62973,62975,62977,62981,62983,62985,62987,62989,62991,62993,62995,62997,62999-63000,63003,63005,63007,63009,63011,63013,63015,63017,63020,63022,63024,63026,63028-63031,63033,63035,63037,63040,63043-63044,63047,63049,63051,63053,63055,63057,63060,63062-63064,63066,63068,63070-63071,63074,63076,63079,63081,
63083,63085,63087,63089,63091,63093,63095,63098,63100,63102,63105,63107,63109,63111,63113-63114,63116,63119,63121,63123,63125,63130,63132-63133,63135,63137,63140,63143,63145,63147,63149,63151,63153-63154,63157,63160,63165,63170,63173,63175,63187,63192-63193,63196,63199-63200,63202,63209,63216,63220-63221,63224,63227,63240,63246,63250,63255,63259,63261,63276,63279,63281,63283,63287,63290,63292,63297,63302,63307,63315,63319,63327,63330,63332,63339,63342,63345,63362,63367,63391,63393,63408-63409,63416-63417,63425,63427,63429,63431,63433,63448,63451,63453,63457,63459,63464-63470,63473,63482,63497,63505,63508,63510,63515,63521-63524,63526,63536-63537,63551-63552,63554,63556,63558-63559,63562,63570,63576,63582,63589-63593,63602,63616,63624,63626,63628,63630
Modified: grass/branches/releasebranch_7_0/gui/wxpython/psmap/dialogs.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/psmap/dialogs.py 2014-12-19 22:17:15 UTC (rev 63630)
+++ grass/branches/releasebranch_7_0/gui/wxpython/psmap/dialogs.py 2014-12-19 22:19:21 UTC (rev 63631)
@@ -1014,7 +1014,7 @@
mapFrameDict['center'] = self.center[0]
# set region
if self.mapType == 'raster':
- RunCommand('g.region', rast = mapFrameDict['map'])
+ RunCommand('g.region', raster = mapFrameDict['map'])
if self.mapType == 'vector':
raster = self.instruction.FindInstructionByType('raster')
if raster:
@@ -1024,9 +1024,9 @@
if rasterId:
- RunCommand('g.region', vect = mapFrameDict['map'], rast = self.instruction[rasterId]['raster'])
+ RunCommand('g.region', vector = mapFrameDict['map'], raster = self.instruction[rasterId]['raster'])
else:
- RunCommand('g.region', vect = mapFrameDict['map'])
+ RunCommand('g.region', vector = mapFrameDict['map'])
Modified: grass/branches/releasebranch_7_0/gui/wxpython/psmap/utils.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/psmap/utils.py 2014-12-19 22:17:15 UTC (rev 63630)
+++ grass/branches/releasebranch_7_0/gui/wxpython/psmap/utils.py 2014-12-19 22:19:21 UTC (rev 63631)
@@ -203,11 +203,11 @@
res = ''
if mapType == 'raster':
try:
- res = grass.read_command("g.region", flags = 'gu', rast = map)
+ res = grass.read_command("g.region", flags = 'gu', raster = map)
except grass.ScriptError:
pass
elif mapType == 'vector':
- res = grass.read_command("g.region", flags = 'gu', vect = map)
+ res = grass.read_command("g.region", flags = 'gu', vector = map)
currRegionDict = grass.parse_key_val(res, val_type = float)
elif scaleType == 1 and region: # saved region
res = grass.read_command("g.region", flags = 'gu', region = region)
Modified: grass/branches/releasebranch_7_0/scripts/d.rast.edit/d.rast.edit.py
===================================================================
--- grass/branches/releasebranch_7_0/scripts/d.rast.edit/d.rast.edit.py 2014-12-19 22:17:15 UTC (rev 63630)
+++ grass/branches/releasebranch_7_0/scripts/d.rast.edit/d.rast.edit.py 2014-12-19 22:19:21 UTC (rev 63631)
@@ -471,7 +471,7 @@
def initialize(self):
grass.use_temp_region()
- run('g.region', rast = self.inmap)
+ run('g.region', raster = self.inmap)
reg = grass.region()
for k, f in wind_keys.values():
@@ -526,7 +526,7 @@
outf.close()
p.wait()
- run('g.region', rast = self.inmap)
+ run('g.region', raster = self.inmap)
run('r.patch', input = (self.tempmap, self.outmap), output = self.outmap, overwrite = True)
run('r.colors', map = self.outmap, rast = self.inmap)
run('g.remove', flags = 'f', type = 'rast', name = self.tempmap)
Modified: grass/branches/releasebranch_7_0/scripts/i.in.spotvgt/i.in.spotvgt.py
===================================================================
--- grass/branches/releasebranch_7_0/scripts/i.in.spotvgt/i.in.spotvgt.py 2014-12-19 22:17:15 UTC (rev 63630)
+++ grass/branches/releasebranch_7_0/scripts/i.in.spotvgt/i.in.spotvgt.py 2014-12-19 22:19:21 UTC (rev 63631)
@@ -175,13 +175,13 @@
# switch to a temporary region
grass.use_temp_region()
- grass.run_command('g.region', rast = name, quiet = True)
+ grass.run_command('g.region', raster = name, quiet = True)
grass.message(_("Remapping digital numbers to NDVI..."))
tmpname = "%s_%s" % (name, pid)
grass.mapcalc("$tmpname = 0.004 * $name - 0.1", tmpname = tmpname, name = name)
- grass.run_command('g.remove', type='rast', name=name, quiet=True, flags='f')
- grass.run_command('g.rename', rast = (tmpname, name), quiet = True)
+ grass.run_command('g.remove', type = 'rast', name = name, quiet = True, flags = 'f')
+ grass.run_command('g.rename', raster = (tmpname, name), quiet = True)
# write cmd history:
grass.raster_history(name)
Modified: grass/branches/releasebranch_7_0/scripts/r.fillnulls/r.fillnulls.py
===================================================================
--- grass/branches/releasebranch_7_0/scripts/r.fillnulls/r.fillnulls.py 2014-12-19 22:17:15 UTC (rev 63630)
+++ grass/branches/releasebranch_7_0/scripts/r.fillnulls/r.fillnulls.py 2014-12-19 22:19:21 UTC (rev 63631)
@@ -106,7 +106,7 @@
grass.run_command('g.remove', quiet=True, flags='bf', type='rast', name=tmp_rmaps)
if usermask and mapset:
if grass.find_file(usermask, mapset = mapset)['file']:
- grass.run_command('g.rename', quiet = True, rast = (usermask, 'MASK'), overwrite = True)
+ grass.run_command('g.rename', quiet = True, raster = (usermask, 'MASK'), overwrite = True)
def main():
global usermask, mapset, tmp_rmaps, tmp_vmaps
@@ -139,7 +139,7 @@
if grass.find_file('MASK', mapset = mapset)['file']:
usermask = "usermask_mask." + unique
grass.message(_("A user raster mask (MASK) is present. Saving it..."))
- grass.run_command('g.rename', quiet = quiet, rast = ('MASK',usermask))
+ grass.run_command('g.rename', quiet = quiet, raster = ('MASK',usermask))
#check if method is rst to use v.surf.rst
if method == 'rst':
@@ -171,7 +171,7 @@
if usermask:
grass.message(_("Restoring user mask (MASK)..."))
try:
- grass.run_command('g.rename', quiet=quiet, rast=(usermask, 'MASK'))
+ grass.run_command('g.rename', quiet=quiet, raster = (usermask, 'MASK'))
except CalledModuleError:
grass.warning(_("Failed to restore user MASK!"))
usermask = None
@@ -242,7 +242,7 @@
# zoom to specific hole with a buffer of two cells around the hole to remove rest of data
try:
grass.run_command('g.region',
- vect=holename + '_pol', align=input,
+ vector=holename + '_pol', align=input,
w = 'w-%d' % (edge * 2 * ew_res),
e = 'e+%d' % (edge * 2 * ew_res),
n = 'n+%d' % (edge * 2 * ns_res),
@@ -333,18 +333,18 @@
# append hole result to interpolated version later used to patch into original DEM
if first:
tmp_rmaps.append(filling)
- grass.run_command('g.region', align = input, rast = holename + '_dem', quiet = quiet)
+ grass.run_command('g.region', align = input, raster = holename + '_dem', quiet = quiet)
grass.mapcalc("$out = if(isnull($inp), null(), $dem)",
out = filling, inp = holename, dem = holename + '_dem')
first = False
else:
tmp_rmaps.append(filling + '_tmp')
- grass.run_command('g.region', align = input, rast = (filling, holename + '_dem'), quiet = quiet)
+ grass.run_command('g.region', align = input, raster = (filling, holename + '_dem'), quiet = quiet)
grass.mapcalc("$out = if(isnull($inp), if(isnull($fill), null(), $fill), $dem)",
out = filling + '_tmp', inp = holename, dem = holename + '_dem', fill = filling)
try:
grass.run_command('g.rename',
- rast=(filling + '_tmp', filling),
+ raster=(filling + '_tmp', filling),
overwrite=True, quiet=quiet)
except CalledModuleError:
grass.fatal(_("abandoned. Removing temporary maps, restoring user mask if needed:"))
@@ -403,7 +403,7 @@
if usermask:
grass.message(_("Restoring user mask (MASK)..."))
try:
- grass.run_command('g.rename', quiet=quiet, rast=(usermask, 'MASK'))
+ grass.run_command('g.rename', quiet=quiet, raster=(usermask, 'MASK'))
except CalledModuleError:
grass.warning(_("Failed to restore user MASK!"))
usermask = None
Modified: grass/branches/releasebranch_7_0/scripts/r.mask/r.mask.py
===================================================================
--- grass/branches/releasebranch_7_0/scripts/r.mask/r.mask.py 2014-12-19 22:17:15 UTC (rev 63630)
+++ grass/branches/releasebranch_7_0/scripts/r.mask/r.mask.py 2014-12-19 22:19:21 UTC (rev 63631)
@@ -162,7 +162,7 @@
if invert:
global tmp
tmp = "r_mask_%d" % os.getpid()
- grass.run_command('g.rename', rast = ('MASK', tmp), quiet = True)
+ grass.run_command('g.rename', raster = ('MASK', tmp), quiet = True)
grass.message(_("Creating inverted raster MASK..."))
grass.mapcalc("MASK = if(isnull($tmp), 1, null())", tmp = tmp)
grass.verbose(_("Inverted raster MASK created"))
Modified: grass/branches/releasebranch_7_0/scripts/v.rast.stats/v.rast.stats.py
===================================================================
--- grass/branches/releasebranch_7_0/scripts/v.rast.stats/v.rast.stats.py 2014-12-19 22:17:15 UTC (rev 63630)
+++ grass/branches/releasebranch_7_0/scripts/v.rast.stats/v.rast.stats.py 2014-12-19 22:19:21 UTC (rev 63631)
@@ -74,7 +74,7 @@
grass.run_command('g.remove', type='rast', name='MASK', quiet=True, flags='f', stderr=nuldev)
if mask_found:
grass.message(_("Restoring previous MASK..."))
- grass.run_command('g.rename', rast=(tmpname + "_origmask", 'MASK'),
+ grass.run_command('g.rename', raster=(tmpname + "_origmask", 'MASK'),
quiet=True)
# for f in [tmp, tmpname, sqltmp]:
# grass.try_remove(f)
@@ -125,7 +125,7 @@
mask_found = bool(grass.find_file('MASK', 'cell')['file'])
if mask_found:
grass.message(_("Raster MASK found, temporarily disabled"))
- grass.run_command('g.rename', rast=('MASK', tmpname + "_origmask"),
+ grass.run_command('g.rename', raster=('MASK', tmpname + "_origmask"),
quiet=True)
# save current settings:
Modified: grass/branches/releasebranch_7_0/testsuite/raster/raster_md5test.sh
===================================================================
--- grass/branches/releasebranch_7_0/testsuite/raster/raster_md5test.sh 2014-12-19 22:17:15 UTC (rev 63630)
+++ grass/branches/releasebranch_7_0/testsuite/raster/raster_md5test.sh 2014-12-19 22:19:21 UTC (rev 63631)
@@ -57,7 +57,7 @@
if test -f $LOCATION/cell/MASK
then
echo "A user raster mask (MASK) is present. Saving it..."
- g.rename MASK,$USERMASK > /dev/null
+ g.rename raster=MASK,$USERMASK > /dev/null
fi
finalcleanup()
@@ -69,7 +69,7 @@
if test -f $LOCATION/cell/$USERMASK ; then
echo "Restoring user MASK"
g.remove -f type=rast name=MASK > /dev/null
- g.rename $USERMASK,MASK > /dev/null
+ g.rename raster=$USERMASK,MASK > /dev/null
fi
}
More information about the grass-commit
mailing list