[GRASS-SVN] r46054 - grass-addons/gui/wxpython/wx.psmap/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Apr 21 02:16:29 EDT 2011
Author: annakrat
Date: 2011-04-20 23:16:29 -0700 (Wed, 20 Apr 2011)
New Revision: 46054
Modified:
grass-addons/gui/wxpython/wx.psmap/gui_modules/psmap_dialogs.py
Log:
wx.psmap: small changes in header of instruction file
Modified: grass-addons/gui/wxpython/wx.psmap/gui_modules/psmap_dialogs.py
===================================================================
--- grass-addons/gui/wxpython/wx.psmap/gui_modules/psmap_dialogs.py 2011-04-20 09:10:59 UTC (rev 46053)
+++ grass-addons/gui/wxpython/wx.psmap/gui_modules/psmap_dialogs.py 2011-04-21 06:16:29 UTC (rev 46054)
@@ -540,7 +540,7 @@
cmd = CmdToTuple(regionInstruction.strip('# ').split())
# define scaleType
- if len(cmd[1]) == 1:
+ if len(cmd[1]) <= 3:
if 'rast' in cmd[1]:
map['scaleType'] = 0
map['mapType'] = 'raster'
@@ -637,15 +637,17 @@
comment = ''
#region settings
+ region = grass.region()
if self.instruction['scaleType'] == 0: #match map
map = self.instruction['map']
- mapType = 'rast' if self.instruction['mapType'] == 'raster' else 'vect'
- comment = "# g.region %s=%s\n" % (mapType, map)
+ if self.instruction['mapType'] == 'raster':
+ comment = "# g.region rast=%s cols=%s rows=%s\n" % (map, region['cols'], region['rows'])
+ else:
+ comment = "# g.region vect=%s\n" % (map)
elif self.instruction['scaleType'] == 1:# saved region
region = self.instruction['region']
comment = "# g.region region=%s\n" % region
elif self.instruction['scaleType'] in (2, 3): #current region, fixed scale
- region = grass.region()
comment = string.Template("# g.region n=$n s=$s e=$e w=$w rows=$rows cols=$cols \n").substitute(**region)
instr += comment
More information about the grass-commit
mailing list