[GRASS-SVN] r60343 - grass-addons/grass7/raster/r.mwprecip

svn_grass at osgeo.org svn_grass at osgeo.org
Mon May 19 03:40:21 PDT 2014


Author: martinl
Date: 2014-05-19 03:40:21 -0700 (Mon, 19 May 2014)
New Revision: 60343

Modified:
   grass-addons/grass7/raster/r.mwprecip/r.mwprecip.py
Log:
fix pgwrapper import

Modified: grass-addons/grass7/raster/r.mwprecip/r.mwprecip.py
===================================================================
--- grass-addons/grass7/raster/r.mwprecip/r.mwprecip.py	2014-05-19 10:25:16 UTC (rev 60342)
+++ grass-addons/grass7/raster/r.mwprecip/r.mwprecip.py	2014-05-19 10:40:21 UTC (rev 60343)
@@ -15,10 +15,15 @@
 import re
 from collections import defaultdict
 from datetime import datetime ,timedelta
-from pgwrapper import pgwrapper as pg
 from math import sin, cos, atan2,degrees,radians, tan,sqrt,fabs 
 
 try:
+    sys.path.insert(0, os.path.join(os.environ['GISBASE'], 'etc', 'r.mwprecip'))
+    from pgwrapper import pgwrapper as pg
+except ImportError:
+    sys.exit("Cannot find 'pgwrapper' Python module")
+
+try:
     from grass.script import core as grass  
 except ImportError:
     sys.exit("Cannot find 'grass' Python module. Python is supported by GRASS from version >= 6.4")



More information about the grass-commit mailing list