[GRASS-dev] Re: [GRASS GIS] #1447: wxGUI wingrass scripts need
whitespace in path
GRASS GIS
trac at osgeo.org
Sat Sep 24 15:58:45 EDT 2011
#1447: wxGUI wingrass scripts need whitespace in path
------------------------------+---------------------------------------------
Reporter: mmetz | Owner: grass-dev@…
Type: defect | Status: new
Priority: major | Milestone: 6.4.2
Component: wxGUI | Version: svn-releasebranch64
Keywords: wingrass, spaces | Platform: MSWindows XP
Cpu: All |
------------------------------+---------------------------------------------
Comment(by glynn):
Replying to [comment:13 mmetz]:
> The result has double, not quad backslashes, i.e. seems to be ok:
{{{
((['v.in.geonames', 'input=D:\\GRASS_test_data\\IT\\IT.txt
out=italy_geonames', 'output=IT'])), {'shell': True, 'stdin': -1,
'stderr': -1, 'stdout': -1}]
}}}
That looks fine.
> > I'm pretty sure that the core problem is with windows_launch.bat, as
described above.
>
> You're right, thanks a lot for your help! I have committed the change to
windows_launch.bat in 6.4 and 6.5, r48448 and r48449, respectively.
One minor caveat: v.krige will need to create its own batch file on
Windows, as it's a Python script, not a shell script.
"sh -c 'prog arg arg'" will run arbitrary commands: executables, shell
built-ins, shell scripts, or other scripts (for which it will use the
shebang). The cost is that the argument to -c will be parsed, so it must
be properly constructed (i.e. quoted) according to bash syntax. "sh prog
arg arg" will only run shell scripts, but will pass the arguments
verbatim, without having to worry about parsing.
As it's a "mixed mode" script (GUI or non-GUI, depending upon whether
there are any arguments), we can't rely upon the .py extension; it needs
to be run via GRASS_PYTHON, e.g.:
{{{
@"%GRASS_PYTHON%" "%GISBASE%\scripts\v.krige.py" %*
}}}
(This means that v.krige is broken for a different reason in 7.0; it needs
to be split into separate Python and Python+wxPython scripts, as is done
for wxpyimgview).
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1447#comment:14>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list