[GRASS-dev] [GRASS GIS] #3772: Make the grass library importable outside of a GRASS session
GRASS GIS
trac at osgeo.org
Sat Mar 30 07:42:24 PDT 2019
#3772: Make the grass library importable outside of a GRASS session
--------------------------+-------------------------
Reporter: pmav99 | Owner: grass-dev@…
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: Python | Version: svn-trunk
Resolution: | Keywords:
CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------
Comment (by pmav99):
According to the docs, {{{lib/python/script/setup.py}}} contains functions
that
> can be used in Python scripts to setup a GRASS environment and session
without using grassXY
Not having the ability to import the {{{grass}}} library from a normal
session means that you need to already be in a GRASS session in order to
use the functions that can create a session (chicken-egg problem).
After making the grass library importable, the whole problem of
bootstrapping the GRASS session will finally be much easier to be
resolved.
Or course, we will need to review and if necessary improve the
setup/cleanup functions in {{{lib/python/script/setup.py}}} and, most
importantly, write tests for them. But after that is done, it will finally
be possible to refactor/simplify the bootstrapping code in
{{{lib/python/init/grass.py}}}
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3772#comment:9>
GRASS GIS <https://grass.osgeo.org>
More information about the grass-dev
mailing list