[GRASS-dev] porting r.in.wms to python

Glynn Clements glynn at gclements.plus.com
Sun Oct 5 17:57:42 EDT 2008


Glynn Clements wrote:

> Here's the current status on conversion of scripts to Python:

Apart from the scripts in the "scripts" directory, various parts of
GRASS install shell scripts. After filtering out the "shell" scripts
which are actually Tcl/Tk scripts using the "exec $GRASS_WISH" trick,
I see:

bin/nviz
etc/Init.sh
etc/gui/scripts/d.colors.sh
etc/gui/scripts/d.path.sh
etc/gui/scripts/r.colors.rules
etc/gui/scripts/r.reclass.file
etc/gui/scripts/r.reclass.rules
etc/gui/scripts/r.recode.file
etc/gui/scripts/r.recode.rules
etc/gui/scripts/r.support.sh
etc/prompt.sh
etc/r.li.setup/masked_area_selection
etc/r.li.setup/sample_area_vector.sh
etc/r.li.setup/square_mouse_selection.sh
etc/wxpython/scripts/p.cmd
etc/wxpython/scripts/p.db
etc/wxpython/scripts/p.mon
etc/wxpython/scripts/p.rast
etc/wxpython/scripts/p.vect
etc/wxpython/scripts/wxgui
scripts/gis.m
scripts/r.li.setup

Of these, Init.sh and prompt.sh should probably stay as shell scripts. 
The former has an equivalent batch file for Windows users, and isn't
essential. The latter is only probably only useful if you already have
a Bourne shell.

r.li.setup and the scripts relating to nviz and gis.m all invoke
Tcl/Tk scripts. These should probably be re-written to use either
tclsh or wish.

Also, the three etc/gui/scripts/r.*.rules scripts all use
grass-xterm-wrapper, which no longer exists. 
etc/gui/scripts/r.support.sh also uses grass-xterm-wrapper, but
r.support's curses-based interactive mode no longer exists.

The scripts relating to the wxPython GUI should be re-written in
Python (what do those scripts do, anyhow?).

That just leaves the three scripts in etc/r.li.setup. These are all
shell scripts which rely upon d.mon, so they won't work at present.

Once these issues are dealt with, there should no longer be any need
to distribute MSys as part of the WinGRASS packages.

Also, should we change windows_launch.bat to invoke Python on the
scripts, or just install the scripts with a .py extension and add .PY
to PATHEXT?

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


More information about the grass-dev mailing list