[GRASS-dev] Re: [GRASS GIS] #945: wxGUI: g.setproj fails on wingrass

GRASS GIS trac at osgeo.org
Sat Feb 27 15:22:44 EST 2010


#945: wxGUI: g.setproj fails on wingrass
---------------------------+------------------------------------------------
  Reporter:  hamish        |       Owner:  martinl            
      Type:  defect        |      Status:  assigned           
  Priority:  major         |   Milestone:  6.4.0              
 Component:  wxGUI         |     Version:  svn-releasebranch64
Resolution:                |    Keywords:  g.setproj, wingrass
  Platform:  MSWindows XP  |         Cpu:  x86-32             
---------------------------+------------------------------------------------
Comment (by glynn):

 Replying to [comment:7 hamish]:

 > another is that OnXTerm should unset the GRASS_MESSAGE_FORMAT enviro var
 to avoid printing GRASS_INFO_WARNING(), GRASS_INFO_END() etc. to the
 terminal.
 >
 {{{
 # unset
 del os.environ['GRASS_MESSAGE_FORMAT']
 ...
 # reset
 os.environ['GRASS_MESSAGE_FORMAT'] = 'gui'
 }}}

 Apart from at startup, the wxGUI should just leave os.environ alone. If a
 child process needs a modified environment, pass it one via the env=
 parameter to subprocess.Popen(), e.g.:
 {{{
    tmpenv = os.environ.copy()
    tmpenv['GRASS_MESSAGE_FORMAT'] = 'gui'
    p = grass.Popen(..., env = tmpenv)
 }}}
 If gcmd.Command doesn't support env=, it needs to be fixed.

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/945#comment:8>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list