[GRASS-SVN] r51804 - in grass/trunk/gui/wxpython: core mapdisp

svn_grass at osgeo.org svn_grass at osgeo.org
Sat May 26 12:38:56 EDT 2012


Author: annakrat
Date: 2012-05-26 09:38:55 -0700 (Sat, 26 May 2012)
New Revision: 51804

Modified:
   grass/trunk/gui/wxpython/core/render.py
   grass/trunk/gui/wxpython/mapdisp/main.py
Log:
wxGUI: fix bug introduced in r51758 (author Vaclav Petras)

Modified: grass/trunk/gui/wxpython/core/render.py
===================================================================
--- grass/trunk/gui/wxpython/core/render.py	2012-05-26 15:46:05 UTC (rev 51803)
+++ grass/trunk/gui/wxpython/core/render.py	2012-05-26 16:38:55 UTC (rev 51804)
@@ -361,10 +361,21 @@
         # setting some initial env. variables
         self._initGisEnv() # g.gisenv
         self.GetWindow()
-        
+
+        # GRASS environment variable (for rendering)
+        self.env = {"GRASS_BACKGROUNDCOLOR" : "FFFFFF",
+               "GRASS_COMPRESSION"     : "0",
+               "GRASS_TRUECOLOR"       : "TRUE",
+               "GRASS_TRANSPARENT"     : "TRUE",
+               "GRASS_PNG_READ"        : "FALSE",
+               }
+
+        for k, v in self.env.iteritems():
+            os.environ[k] = v
+
         # projection info
         self.projinfo = self._projInfo()
-        
+
     def _runCommand(self, cmd, **kwargs):
         """!Run command in environment defined by self.gisrc if
         defined"""

Modified: grass/trunk/gui/wxpython/mapdisp/main.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/main.py	2012-05-26 15:46:05 UTC (rev 51803)
+++ grass/trunk/gui/wxpython/mapdisp/main.py	2012-05-26 16:38:55 UTC (rev 51804)
@@ -51,42 +51,31 @@
     def __init__(self, gisrc = None, cmdfile = None, mapfile = None, envfile = None, monitor = None):
         """!Map composition (stack of map layers and overlays)
 
-        
         @param cmdline full path to the cmd file (defined by d.mon)
         @param mapfile full path to the map file (defined by d.mon)
         @param envfile full path to the env file (defined by d.mon)
         @param monitor name of monitor (defined by d.mon)
         """
-        
+
         Map.__init__(self)
-        
+
         # environment settings
         self.env   = dict()
-        
+
         self.cmdfile = cmdfile
         self.envfile = envfile
         self.monitor = monitor
-        
+
         if mapfile:
             self.mapfileCmd = mapfile
             self.maskfileCmd = os.path.splitext(mapfile)[0] + '.pgm'
-        
+
         # generated file for g.pnmcomp output for rendering the map
         self.mapfile = grass.tempfile(create = False) + '.ppm'
-        
-        # GRASS environment variable (for rendering)
-        env = {"GRASS_BACKGROUNDCOLOR" : "FFFFFF",
-               "GRASS_COMPRESSION"     : "0",
-               "GRASS_TRUECOLOR"       : "TRUE",
-               "GRASS_TRANSPARENT"     : "TRUE",
-               "GRASS_PNG_READ"        : "FALSE",
-               }
-        
-        self._writeEnvFile(env)
+
+        self._writeEnvFile(self.env) # self.env is expected to be defined in parent class
         self._writeEnvFile({"GRASS_PNG_READ" : "TRUE"})
-        for k, v in env.iteritems():
-            os.environ[k] = v
-    
+
     def GetLayersFromCmdFile(self):
         """!Get list of map layers from cmdfile
         """



More information about the grass-commit mailing list