|
@@ -24,17 +24,16 @@ Usage::
|
|
|
# query GRASS itself for its GISBASE
|
|
|
# (with fixes for specific platforms)
|
|
|
# needs to be edited by the user
|
|
|
- grass8bin = 'grass'
|
|
|
- if sys.platform.startswith('win'):
|
|
|
+ grass8bin = "grass"
|
|
|
+ if sys.platform.startswith("win"):
|
|
|
# MS Windows
|
|
|
- grass8bin = r'C:\OSGeo4W\bin\grass.bat'
|
|
|
+ grass8bin = r"C:\OSGeo4W\bin\grass.bat"
|
|
|
# uncomment when using standalone WinGRASS installer
|
|
|
# grass8bin = r'C:\Program Files (x86)\GRASS GIS 8.0.0\grass.bat'
|
|
|
# this can be avoided if GRASS executable is added to PATH
|
|
|
- elif sys.platform == 'darwin':
|
|
|
+ elif sys.platform == "darwin":
|
|
|
# Mac OS X
|
|
|
- # TODO: this have to be checked, maybe unix way is good enough
|
|
|
- grass8bin = '/Applications/GRASS/GRASS-8.0.app/'
|
|
|
+ grass8bin = "/Applications/GRASS-8.0.app/Contents/Resources/bin/grass"
|
|
|
|
|
|
# query GRASS GIS itself for its Python package path
|
|
|
grass_cmd = [grass8bin, "--config", "python_path"]
|
|
@@ -51,15 +50,15 @@ Usage::
|
|
|
rcfile = gsetup.init(gisdb, location, mapset)
|
|
|
|
|
|
# example calls
|
|
|
- gs.message('Current GRASS GIS 8 environment:')
|
|
|
+ gs.message("Current GRASS GIS 8 environment:")
|
|
|
print(gs.gisenv())
|
|
|
|
|
|
- gs.message('Available raster maps:')
|
|
|
- for rast in gs.list_strings(type='raster'):
|
|
|
+ gs.message("Available raster maps:")
|
|
|
+ for rast in gs.list_strings(type="raster"):
|
|
|
print(rast)
|
|
|
|
|
|
- gs.message('Available vector maps:')
|
|
|
- for vect in gs.list_strings(type='vector'):
|
|
|
+ gs.message("Available vector maps:")
|
|
|
+ for vect in gs.list_strings(type="vector"):
|
|
|
print(vect)
|
|
|
|
|
|
# clean up at the end
|