[GRASS-dev] Shell scripts

Glynn Clements glynn at gclements.plus.com
Sat Dec 5 05:20:08 EST 2009


Markus Neteler wrote:

> > The remaining question is whether d.path.sh and the p.* scripts should
> > be converted to Python or removed. I don't think that d.path.sh works
> > with the GUI. The p.* scripts appear to be an attempt to implement
> > d.mon-like behaviour for the GUI, but I don't know whether this is
> > functional.
> 
> The p.* scripts are semi-functional and should be rewritten to Python.
> Not having d.mon/d.rast/d.vect/d.zoom commands is for me, Helena, others
> the obstacle to not use GRASS 7 as primary version.
> Since the needed (wx)GUI pieces are there, I still hope that someone skilled
> is rewriting it in Python. For us it is essential to continue with command line
> in GRASS 7.

So now we have both shell and python versions, and still no actual
explanation.

AFAICT, the GUI has a mode where writing commands to the file
specified by the GRASS_PYCMDFILE GRASS variable will cause them to be
picked up by the GUI, right?

In which case, wouldn't a more useful approach be to extend
R_open_driver() with e.g.:

	const char *cmdfile = G__getenv("GRASS_PYCMDFILE");
	if (cmdfile) {
	    FILE *fp = fopen(cmdfile, "a");
	    if (fp) {
	        fprintf(fp, "%s\n", G_recreate_command());
	        exit(0);
	    }
	}

so that you can automatically redirect all d.* commands to the GUI?

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


More information about the grass-dev mailing list