[GRASS-SVN] r51704 - grass-addons/grass7/general/g.cloud

svn_grass at osgeo.org svn_grass at osgeo.org
Thu May 24 09:30:51 EDT 2012


Author: martinl
Date: 2012-05-24 06:30:50 -0700 (Thu, 24 May 2012)
New Revision: 51704

Modified:
   grass-addons/grass7/general/g.cloud/g.cloud.py
Log:
g.cloud: check for GRASS_ADDON_BASE 


Modified: grass-addons/grass7/general/g.cloud/g.cloud.py
===================================================================
--- grass-addons/grass7/general/g.cloud/g.cloud.py	2012-05-24 11:33:58 UTC (rev 51703)
+++ grass-addons/grass7/general/g.cloud/g.cloud.py	2012-05-24 13:30:50 UTC (rev 51704)
@@ -112,14 +112,18 @@
 import grass.script as grass
 
 # add the folder containing libraries to python path
+cloudpath = None
 if os.path.isdir(os.path.join(os.getenv('GISBASE'), 'etc', 'g.cloud', os.sep)):
     cloudpath = os.path.join(os.getenv('GISBASE'), 'etc', 'g.cloud')
+elif os.path.isdir(os.path.join(os.getenv('GRASS_ADDON_BASE'), 'etc', 'g.cloud', os.sep)):
+    cloudpath = os.path.join(os.getenv('GRASS_ADDON_BASE'), 'etc', 'g.cloud')
 elif os.path.isdir(os.path.join(os.getenv('GRASS_ADDON_PATH'), 'etc', 'g.cloud', os.sep)):
     cloudpath = os.path.join(os.getenv('GRASS_ADDON_PATH'), 'etc', 'g.cloud')
 
 # search python environment
 python = os.getenv('GRASS_PYTHON', 'python')
-sys.path.append(cloudpath)
+if cloudpath:
+    sys.path.append(cloudpath)
 
 try:
     import cloud_ssh as sshs



More information about the grass-commit mailing list