Opened 15 years ago

Closed 14 years ago

#1748 closed bug (fixed)

(windows) GRASS gui does not show if GRASS was run with wxpyhton interface

Reported by: pcav Owned by: nobody
Priority: minor: annoyance Milestone: Version 1.5.0
Component: GRASS Version: Trunk
Keywords: Cc: rblazek
Must Fix for Release: No Platform: Windows
Platform Version: Awaiting user input: no

Description

The GRASS shell is currently not working in OSGeo 1.2 windows package. When opening it, a cmd.exe window pops up, but GRASS shell variables are not initialized

Change History (11)

comment:1 by jef, 15 years ago

Which variables are unset? Which package are you referring to?

comment:2 by pcav, 15 years ago

If I type a GRASS command, e.g. g.region, I get an error message about GRASS variables not being set. Tested with qgis-dev (1.2) from OSGeo installer. Thanks.

in reply to:  1 comment:3 by lutra, 15 years ago

Replying to jef:

Which variables are unset? Which package are you referring to?

the message is

ERROR: G_getenv(): Variable GRASS_GUI not set

used qgis 1.2 installed with the osgeo4w installer

comment:4 by lutra, 15 years ago

Made a further test with the osgeo4w installer (using qgis 1.2) on windows xp.

A first try to use a grass command in the shell returned the following

C:\>v.in.ogr
Traceback (most recent call last):
  File "C:\OSGeo4W\apps\grass\GRASS-~1.0SV/etc/wxpython/gui_modules/menuform.py"
, line 1933, in <module>
    GrassGUIApp( grassTask( sys.argv[1] ) ).MainLoop()
  File "C:\OSGeo4W\apps\grass\GRASS-~1.0SV/etc/wxpython/gui_modules/menuform.py"
, line 336, in __init__
    xml.sax.parseString( getInterfaceDescription( grassModule ) , processTask( s
elf ) )
  File "C:\OSGeo4W\apps\grass\GRASS-~1.0SV/etc/wxpython/gui_modules/menuform.py"
, line 1753, in getInterfaceDescription
    cmdout = p.sub(globalvar.ETCDIR + r'/grass-interface.dtd', cmdout)
  File "C:\OSGeo4W\apps\Python25\lib\re.py", line 269, in _subx
    template = _compile_repl(template, pattern)
  File "C:\OSGeo4W\apps\Python25\lib\re.py", line 256, in _compile_repl
    raise error, v # invalid expression
sre_constants.error: bad group name

as it seemed to try use the wxpyhton interface, then I uninstalled everything and reinstalled without wx-pyhton. This way the GRASS tcltk interface still works, but this time the grass shell under qgis does nothing

C:\>v.in.ogr
C:\>

but it is still able to recognize wrong commands.

comment:5 by lutra, 15 years ago

My latest comment was obviously regarding trying to open the grass gui by issuing a command with no parameters. When issuing grass commands with parameters the shell seems to work fine.

I noticed also that under windows if the grass shell is open and one close qgis, than the shell remains open. I don't know if this has to be considered a issue or an inevitable thing.

comment:6 by pcav, 14 years ago

It seems to me that is reasonably working now: can we close it?

in reply to:  6 comment:7 by lutra, 14 years ago

Replying to pcav:

It seems to me that is reasonably working now: can we close it?

It doesn't seems to me. I Just checked on the latest qgis-dev version installed with the osgeo4w package, and I found all the problems described in this ticket.

I first get a "ERROR: G_getenv(): Variable GRASS_GUI not set" then I played around with the GRASS installation (osgeo4w installs both the tcltk and wxpython GRASS interfaces) and went back to the qgis GRASS plugin.

I then get the same error reported above (if GRASS is configured to start with the wxpython interface) or nothing at all (if GRASS is configured to start with the tcltk interface).

Again the only situation that the shell seems to work is if you issue a command together with its own parameters. No way to get the GRASS interface pop up by just issuing the command name.

comment:8 by lutra, 14 years ago

Priority: major: does not work as expectedminor: annoyance
Summary: GRASS shell non functional on Windows(windows) GRASS gui does not show if GRASS was run with wxpyhton interface

Hi,

I tested again qgis-dev (r12903) installed with osgeo4w (there was recently an update of the GRASS packages) and the good news it that apparently, now issuing a GRASS command -with no parameters, in the qgis GRASS shell- make the program to correctly open the native tcl-tk GRASS interface.

A problem still remains: if for some reasons GRASS is launched with the new wxpython interface then, when a command (with no paramters) is issued in the qgis GRASS shell, an error is returned

C:\>v.in.ogr
Traceback (most recent call last):
  File "C:\OSGeo4W\apps\grass\GRASS-~1.0SV/etc/wxpython/gui_modules/menuform.py"
, line 1942, in <module>
    GrassGUIApp( grassTask( sys.argv[1] ) ).MainLoop()
  File "C:\OSGeo4W\apps\grass\GRASS-~1.0SV/etc/wxpython/gui_modules/menuform.py"
, line 334, in __init__
    xml.sax.parseString( getInterfaceDescription( grassModule ) , processTask( s
elf ) )
  File "C:\OSGeo4W\apps\grass\GRASS-~1.0SV/etc/wxpython/gui_modules/menuform.py"
, line 1762, in getInterfaceDescription
    cmdout = p.sub(globalvar.ETCDIR + r'/grass-interface.dtd', cmdout)
  File "C:\OSGeo4W\apps\Python25\lib\re.py", line 269, in _subx
    template = _compile_repl(template, pattern)
  File "C:\OSGeo4W\apps\Python25\lib\re.py", line 256, in _compile_repl
    raise error, v # invalid expression
sre_constants.error: bad group name

to overcome this problem is enough to re-run GRASS with the tcl-tk interface.

comment:9 by rblazek, 14 years ago

GRASS wxpython fails if GISBASE contains a backslash, so it is bug in GRASS I think. I have added conversion \ -> / to QgsGrass::shortPath so it should be fixed.

To be verified with next qgis-dev build.

comment:10 by lutra, 14 years ago

Cc: rblazek added

I tested the latest qgis-dev with osgeo4w under Windows Seven and tried to launch the GRASS interface from the qgis GRASS plugin shell:

the message is

ERROR: G_getenv(): Variable GRASS_GUI not set

but no more errors like the one I posted in this ticket, if the user had launched before the GRASS wxpython interface. Just

ERROR: G_getenv(): Variable GRASS_GUI not set

The same now happens also under XP (it used to work), the message is the same.

comment:11 by rblazek, 14 years ago

Resolution: fixed
Status: newclosed

I have set the default GRASS_GUI to wxpython in r13057.

Note: See TracTickets for help on using tickets.