forked from OSGeo/grass
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
init: Output value for sys.path in config (OSGeo#1835)
With this addition, running grass --config python_path outputs the value needed for sys.path. This is useful in Python where sys.path needs to be set up correctly before the grass package can be imported. Instead of having to hardcode the etc/python part of the path, user can (optionally) obtain the full path from the new parameter resulting in a more general code which requires just passing a result of call stripped from the white spaces. This is especially interesting in combination with OSGeo#1838 after which GISBASE environmental variable does not have to be set up before for importing grass.script package, so setting up sys.path is the only step user needs to do before that. Additionally, with OSGeo#1829 (and OSGeo#1979) the installation path (GISBASE) can be determined automatically from the path to the grass.script.setup module (file), the executable (if it is called grass), or from a user-provided executable which was be called (by the user) to obtain python_path. The new setup method is now used in the notebooks. This simplifoes usage documentaion in setup.py module. No GISBASE is needed. No explicit error checking (errors are printed and/or raised automatically). sys.path now needs to be str/unicode.
- Loading branch information
1 parent
f43cd84
commit ad30eb7
Showing
8 changed files
with
37 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters