[GRASS-dev] GRASS init.sh
David Finlayson
david.p.finlayson at gmail.com
Mon Jun 12 20:51:15 EDT 2006
> GRASS doesn't have any configuration files. Everything which can be
> configured is done so through the environment.
...and set dynamically mostly at run time, that is my point. In the
future (GRASS 7) it would be nice to move the configuration
information currently stored in 34 environment variables (see:
http://grass.itc.it/grass61/manuals/html61_user/variables.html) to a
configuration file. That way new shells could get the info without
needing to recreate the do-it-all initialization process that init.sh
goes through in GRASS 6.X.
I am pretty close to having most of GRASS running entirely in a Python
shell. The only thing Python needs to know are what environment
variables to set up. It does this the same way on Mac, Windows and
Unix, so I don't need all of the platform specific code that is
currently in init.sh and I MUST export it somehow so that Python can
read it. I would like the user to be able to run the Python version or
traditional grass using a common configuration file so that the user
only needs to change it in one place when updating things.
Once I've got grass working from the interpreter (no help from bash),
I can embed the whole interpreter in a GUI framework like wxPython
(such as pyshell for example). And we will be well on our way to a
(optional!) MATLAB-style interface for grass.
On 6/12/06, Glynn Clements <glynn at gclements.plus.com> wrote:
>
> David Finlayson wrote:
>
> > > The only environment variable set in grass61 is GISBASE. That has to
> > > be set there because the rest of GRASS (including Init.sh) is
> > > referenced relative to $GISBASE.
> > >
> > > > 2. Many system-wide environment variables are determined at run-time
> > > > by init.sh. This means that there is a lot of platform specific code
> > > > looking for libraries and executables. Routines are different for each
> > > > shell and each major platform. Surely there is a better way to do
> > > > this? Maybe a configuration wizard that helps the user write or update
> > > > their system-wide config file?
> > >
> > > Different users may have different values for $SHELL and $PATH.
> > > Init.sh needs to work for all users, not one specific configuration.
> >
> > I guess my point is this:
> >
> > It was fine to put configuration information in the init script when
> > there was effectively only 1 type of shell. Now that we are
> > considering alternative environments for GRASS such as Java or Python
> > or R or DOS, etc. it would be nice to get the configuration
> > information into a proper config file. That way the configuration
> > (static info about GRASS) is separated from the initialization process
> > (unique to each environment/shell).
>
> What type of configuration information are you referring to?
>
> GRASS doesn't have any configuration files. Everything which can be
> configured is done so through the environment.
>
> --
> Glynn Clements <glynn at gclements.plus.com>
>
--
David Finlayson
More information about the grass-dev
mailing list