Skip to content

Commit

Permalink
Merge pull request #8 from mundialis/grass-helpers_exception
Browse files Browse the repository at this point in the history
Improvements by error message for import error
  • Loading branch information
anikaweinmann committed Aug 23, 2023
2 parents 23ec03b + 543391a commit e28e92b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
11 changes: 9 additions & 2 deletions r.in.wcs.worker/r.in.wcs.worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,15 @@
from grass.script import core as grass
from grass.pygrass.utils import get_lib_path

from grass_gis_helpers.mapset import switch_to_new_mapset

try:
from grass_gis_helpers.mapset import switch_to_new_mapset
except ImportError:
grass.fatal(
_(
"Please check if the python library grass_gis_helpers is "
"installed or install it with: <pip install grass-gis-helpers>"
)
)

# initialize global vars
RM_FILES = []
Expand Down
23 changes: 15 additions & 8 deletions r.in.wcs/r.in.wcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,21 @@
from grass.pygrass.utils import get_lib_path
from grass.script.utils import try_rmdir

from grass_gis_helpers.general import set_nprocs
from grass_gis_helpers.cleanup import rm_vects
from grass_gis_helpers.tiling import create_grid
from grass_gis_helpers.parallel import (
patching_raster_results,
run_module_parallel,
)

try:
from grass_gis_helpers.general import set_nprocs
from grass_gis_helpers.cleanup import rm_vects
from grass_gis_helpers.tiling import create_grid
from grass_gis_helpers.parallel import (
patching_raster_results,
run_module_parallel,
)
except ImportError:
grass.fatal(
_(
"Please check if the python library grass_gis_helpers is "
"installed or install it with: <pip install grass-gis-helpers>"
)
)

# initialize global vars
LOCATION_PATH = None
Expand Down

0 comments on commit e28e92b

Please sign in to comment.