[GRASS-dev] Python script test

Glynn Clements glynn at gclements.plus.com
Sun Jul 20 16:02:35 EDT 2008


Glynn Clements wrote:

> I've attached a version which implements most of the above, and which
> also uses an updated version of the grass.py module.

I have now added the grass.py module to SVN trunk, at
lib/python/grass.py. It gets installed to the $GISBASE/etc/python
directory, which is added to PYTHONPATH by Init.sh, so scripts can use
"import grass" to use the functions which it provides.

Apart from the subprocess wrappers, it provides interfaces to several
common g.* modules: g.parser, g.message, g.tempfile, g.gisenv,
g.region, g.findfile, and g.list.

This should largely eliminate the need for scripts to call those
modules directly, at least for the most common usage.

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


More information about the grass-dev mailing list