[GRASS-dev] Re: parsing file paths in GRASS Scripts- Windows OS

Just a preliminary note: This error is reported here: http://lists.osgeo.org/pipermail/grass-dev/2011-March/053774.html

I saw that Glynn sugeste this a couple of months ago: http://lists.osgeo.org/pipermail/grass-dev/2010-October/052396.html

Can this be an option to solve this problem? Can anyone give a few tips on this? (just to try and test it)
Thanks

Best Regards
Kat

Hi Glynn
Did you receive this email? It«s about the suggestion that you have done…
Can you give me a few tips?
thanks
Kat

2011/3/22 katrin eggert <katrineggert1980@gmail.com>

Just a preliminary note: This error is reported here: http://lists.osgeo.org/pipermail/grass-dev/2011-March/053774.html

I saw that Glynn sugeste this a couple of months ago: http://lists.osgeo.org/pipermail/grass-dev/2010-October/052396.html

Can this be an option to solve this problem? Can anyone give a few tips on this? (just to try and test it)
Thanks

Best Regards
Kat

katrin eggert wrote:

Just a preliminary note: This error is reported here:
http://lists.osgeo.org/pipermail/grass-dev/2011-March/053774.html

I saw that Glynn sugeste this a couple of months ago:
http://lists.osgeo.org/pipermail/grass-dev/2010-October/052396.html

Can this be an option to solve this problem? Can anyone give a few tips on
this? (just to try and test it)

Right. Currently, 6.5 has utils.split(), which handles Windows
filenames, but much of the wx GUI is still using shlex.split()
directly.

Feel free to replace all occurrences of shlex.split() with
utils.split() in your local copy. Also, open a bug report (if there
isn't already one for this issue).

--
Glynn Clements <glynn@gclements.plus.com>

On Sat, Mar 26, 2011 at 8:09 PM, Glynn Clements
<glynn@gclements.plus.com> wrote:

katrin eggert wrote:

Just a preliminary note: This error is reported here:
http://lists.osgeo.org/pipermail/grass-dev/2011-March/053774.html

I saw that Glynn sugeste this a couple of months ago:
http://lists.osgeo.org/pipermail/grass-dev/2010-October/052396.html

Can this be an option to solve this problem? Can anyone give a few tips on
this? (just to try and test it)

Right. Currently, 6.5 has utils.split(), which handles Windows
filenames, but much of the wx GUI is still using shlex.split()
directly.

Feel free to replace all occurrences of shlex.split() with
utils.split() in your local copy. Also, open a bug report (if there
isn't already one for this issue).

Here a silly two-line for most of the job:

cd gui/wxpython/gui_modules/
for i in menuform.py gmodeler.py menu.py prompt.py goutput.py ; do mv
$i tmp.py ; cat tmp.py | sed 's+shlex.split+utils.split+g' > $i ; rm
-f tmp.py ; done
for i in menuform.py gmodeler.py menu.py prompt.py goutput.py ; do mv
$i tmp.py ; cat tmp.py | sed 's+import shlex+import utils+g' > $i ; rm
-f tmp.py ; done

I hesitate to submit this since a my wx fu is not high enough to verify
but the GUI starts.

Markus

Markus wrote:

Here a silly two-line for most of the job:

cd gui/wxpython/gui_modules/

for i in menuform.py gmodeler.py menu.py prompt.py goutput.py ; do
  mv $i tmp.py
  cat tmp.py | sed 's+shlex.split+utils.split+g' > $i
  rm -f tmp.py
done

for i in menuform.py gmodeler.py menu.py prompt.py goutput.py ; do
  mv $i tmp.py
  cat tmp.py | sed 's+import shlex+import utils+g' > $i
  rm -f tmp.py
done

Hi,

just as an aside/random tip, 'sed -i' works very nicely to do
in-place modifications:

cd gui/wxpython/gui_modules/

for file in menuform.py gmodeler.py menu.py prompt.py goutput.py ; do
   sed -i -e 's+shlex.split+utils.split+g' \
          -e 's+import shlex+import utils+g' $file
done

or if you can guarantee no false positives, it reduces to:

sed -i -e 's+shlex.split+utils.split+g' \
       -e 's+import shlex+import utils+g' *.py

all the power, much less mess!

Hamish

Hi
I have just runned nightly buillts for GRASS6.4 and 6.5 and it seems that it’s not enough to have that fixed.
Any other suggestion?

2011/3/26 Markus Neteler <neteler@osgeo.org>

On Sat, Mar 26, 2011 at 8:09 PM, Glynn Clements
<glynn@gclements.plus.com> wrote:

katrin eggert wrote:

Just a preliminary note: This error is reported here:
http://lists.osgeo.org/pipermail/grass-dev/2011-March/053774.html

I saw that Glynn sugeste this a couple of months ago:
http://lists.osgeo.org/pipermail/grass-dev/2010-October/052396.html

Can this be an option to solve this problem? Can anyone give a few tips on
this? (just to try and test it)

Right. Currently, 6.5 has utils.split(), which handles Windows
filenames, but much of the wx GUI is still using shlex.split()
directly.

Feel free to replace all occurrences of shlex.split() with
utils.split() in your local copy. Also, open a bug report (if there
isn’t already one for this issue).

Here a silly two-line for most of the job:

cd gui/wxpython/gui_modules/
for i in menuform.py gmodeler.py menu.py prompt.py goutput.py ; do mv
$i tmp.py ; cat tmp.py | sed ‘s+shlex.split+utils.split+g’ > $i ; rm
-f tmp.py ; done
for i in menuform.py gmodeler.py menu.py prompt.py goutput.py ; do mv
$i tmp.py ; cat tmp.py | sed ‘s+import shlex+import utils+g’ > $i ; rm
-f tmp.py ; done

I hesitate to submit this since a my wx fu is not high enough to verify
but the GUI starts.

Markus