[GRASS-SVN] r53243 - grass/trunk/gui/wxpython/core
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Sep 20 01:27:21 PDT 2012
Author: annakrat
Date: 2012-09-20 01:27:20 -0700 (Thu, 20 Sep 2012)
New Revision: 53243
Modified:
grass/trunk/gui/wxpython/core/utils.py
Log:
wxGUI: add right mapset to map names in command line (merge from releasebranch, r53241)
Modified: grass/trunk/gui/wxpython/core/utils.py
===================================================================
--- grass/trunk/gui/wxpython/core/utils.py 2012-09-20 08:26:56 UTC (rev 53242)
+++ grass/trunk/gui/wxpython/core/utils.py 2012-09-20 08:27:20 UTC (rev 53243)
@@ -132,30 +132,34 @@
if len(params) < 1:
return mapname, False
- mapname = params[0][2]
- mapset = ''
- if fullyQualified and '@' not in mapname:
- if layerType in ('raster', 'vector', '3d-raster', 'rgb', 'his'):
- try:
- if layerType in ('raster', 'rgb', 'his'):
- findType = 'cell'
- else:
- findType = layerType
- mapset = grass.find_file(mapname, element = findType)['mapset']
- except AttributeError, e: # not found
- return '', False
- if not mapset:
- found = False
- else:
- mapset = grass.gisenv()['MAPSET']
+ # need to add mapset for all maps
+ mapsets = {}
+ for i, p, v in params:
+ mapname = v
+ mapset = ''
+ if fullyQualified and '@' not in mapname:
+ if layerType in ('raster', 'vector', '3d-raster', 'rgb', 'his'):
+ try:
+ if layerType in ('raster', 'rgb', 'his'):
+ findType = 'cell'
+ else:
+ findType = layerType
+ mapset = grass.find_file(mapname, element = findType)['mapset']
+ except AttributeError, e: # not found
+ return '', False
+ if not mapset:
+ found = False
+ else:
+ mapset = grass.gisenv()['MAPSET']
+ mapsets[i] = mapset
# update dcmd
for i, p, v in params:
if p == 'layer':
continue
dcmd[i] = p + '=' + v
- if mapset:
- dcmd[i] += '@' + mapset
+ if i in mapsets and mapsets[i]:
+ dcmd[i] += '@' + mapsets[i]
maps = list()
ogr = False
More information about the grass-commit
mailing list