[GRASS-dev] Re: [GRASS-SVN] r37087 - in grass/trunk/gui: scripts wxpython/scripts

Hamish hamish_b at yahoo.com
Sun May 10 23:26:43 EDT 2009


> > Martin wrote:
> > > is it really needed in trunk in regards we are
> > planning to use Python for all scripts?
Hamish:
> > AFAIK it is needed whenever non-.exe or .bat named modules will be
> > run using simply their command name.
Glynn:
> It should only be needed for Tcl/Tk (exec and "open |..."), which has
> its own hacks for .exe and .bat (maybe .com and/or .cmd? I'm not
> sure).
> 
> Everything other than Tcl/Tk falls into one of two cases: either you
> always have to provide the extension (even for .exe or .bat), or it
> uses PATHEXT and the registry settings (related to ftype/assoc).

AFAICT for non-C modules in g7 Script.make runs the "$(BIN)/%.bat:"
Makefile rule (in ScriptRules.make) which creates .bat file wrapper.

But the helper scripts in $(TOPDIR)/gui/scripts/->$GISBASE/etc/gui/scripts/ 
do not use Script.make but still need that step.


> BTW, we need to add .py to PATHEXT; we don't appear to be
> doing this at present.

Index: lib/init/init.bat
===================================================================
--- lib/init/init.bat   (revision 37138)
+++ lib/init/init.bat   (working copy)
@@ -102,6 +102,7 @@
 :wxpython
 
 set PYTHONPATH=%PYTHONPATH%;%WINGISBASE%\etc\python;%WINGISBASE%\etc\wxpython
+set PATHEXT=%PATHEXT%;.PY
 
 python "%GISBASE%/etc/wxpython/gis_set.py"
 if %errorlevel% == 2 goto exitinit


for gr7 is it needed for all gui/tui modes I guess, not just wxGUI.
hmph, the above doesn't seem to stick.


On linux at least the .py is removed from the script name and the module
gets installed without extension in $GISBASE/scripts/
I'm note sure what happens with the g7 WinGRASS build.


Hamish



      



More information about the grass-dev mailing list