Hi devs,
I would like to backport Glynn's lib/python stuff to devbr6 and use it
in wxGUI (not just only in trunk). E.g.
grass.gisenv()['MAPSET']
instead of
grassenv.GetGRASSVariable('MAPSET')
If no objects here I will backported lib/python to devbr6.
Martin
--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa *
Martin Landa wrote:
I would like to backport Glynn's lib/python stuff to devbr6 and use it
in wxGUI (not just only in trunk). E.g.
grass.gisenv()['MAPSET']
grass.gisenv() will run g.gisenv for each call.
It would be better to save the result, i.e.:
env = grass.gisenv()
...
... = env['MAPSET']
But in wxGUI, you might want a more sophisticated interface, which
allows environment changes. E.g. returning the environment as a
UserDict object which runs "g.gisenv set=..." whenever it's updated
(os.environ is implemented similarly; it calls putenv() whenever an
entry is updated).
Or maybe it would be better to just write out the internal environment
to a temporary $GISRC file for each command.
--
Glynn Clements <glynn@gclements.plus.com>