[GRASS-dev] Re: [GRASS GIS] #534: g.gui doesn't work in ms-windows

GRASS GIS trac at osgeo.org
Mon Feb 15 01:11:26 EST 2010


#534: g.gui doesn't work in ms-windows
---------------------------+------------------------------------------------
  Reporter:  cnielsen      |       Owner:  grass-dev at lists.osgeo.org
      Type:  defect        |      Status:  reopened                 
  Priority:  major         |   Milestone:  6.4.0                    
 Component:  wxGUI         |     Version:  svn-releasebranch64      
Resolution:                |    Keywords:  wingrass                 
  Platform:  MSWindows XP  |         Cpu:  Unspecified              
---------------------------+------------------------------------------------
Comment (by hamish):

 I'm a bit murky on the G_store() usage, so review.

 {{{
 svn diff trunk/general/g.gui/main.c
 Index: main.c
 ===================================================================
 --- main.c      (revision 40408)
 +++ main.c      (working copy)
 @@ -27,7 +27,7 @@
      struct Option *type, *rc_file;
      struct Flag *update, *nolaunch;
      struct GModule *module;
 -    const char *gui_type_env;
 +    const char *gui_type_env, *python_cmd;
      char progname[GPATH_MAX];

      G_gisinit(argv[0]);
 @@ -103,14 +103,19 @@

      G_debug(1, "Attempting to start '%s' GUI ...", type->answer);

 +    python_cmd = getenv("GRASS_PYTHON");
 +
 +    if(!python_cmd)
 +       python_cmd = G_store("python");
 +
      if (strcmp(type->answer, "wxpython") == 0) {
         sprintf(progname, "%s/etc/wxpython/wxgui.py", G_gisbase());
         if (rc_file->answer) {
 -           G_spawn_ex(getenv("GRASS_PYTHON"), progname, progname,
 +           G_spawn_ex(python_cmd, progname, progname,
                     "--workspace", rc_file->answer, SF_BACKGROUND, NULL);
         }
         else {
 -           G_spawn_ex(getenv("GRASS_PYTHON"), progname, progname,
 +           G_spawn_ex(python_cmd, progname, progname,
                     SF_BACKGROUND, NULL);
         }
      }
 }}}


 Hamish

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


More information about the grass-dev mailing list