Pārlūkot izejas kodu

Grass.fatal errors when dependenciees are not found.

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@44516 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anne Ghisla 14 gadi atpakaļ
vecāks
revīzija
752382e762
1 mainītis faili ar 3 papildinājumiem un 7 dzēšanām
  1. 3 7
      scripts/v.krige/v.krige.py

+ 3 - 7
scripts/v.krige/v.krige.py

@@ -397,16 +397,12 @@ def importR():
     # rpy2
     global robjects
     global rinterface
-    grass.message(_('Loading packages, please wait...'))
+    grass.message(_('Loading dependencies, please wait...'))
     try:
         import rpy2.robjects as robjects
         import rpy2.rinterface as rinterface #to speed up kriging? for plots.
-        haveRpy2 = True
     except ImportError:
-        print >> sys.stderr, _("Python module 'Rpy2' not found. Please install it and re-run v.krige.") # ok for other OSes?
-        haveRpy2 = False
-        if not haveRpy2:
-            sys.exit(1)
+        grass.fatal(_("Python module 'Rpy2' not found. Please install it and re-run v.krige.")) # ok for other OSes?
         
     # R packages check. Will create one error message after check of all packages.
     missingPackagesList = []
@@ -415,7 +411,7 @@ def importR():
             missingPackagesList.append(each)
     if missingPackagesList:
         errorString = "R package(s) " + " ".join(["%s" % e for e in missingPackagesList] +  "missing. Install it/them and re-run v.krige.")
-        sys.exit(_(errorString))
+        grass.fatal(_(errorString))
     
 if __name__ == '__main__':
     if len(sys.argv) > 1: