Browse Source

wxGUI: check if addons are in the path

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@58332 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 11 years ago
parent
commit
aee733bf5b
1 changed files with 6 additions and 0 deletions
  1. 6 0
      gui/wxpython/core/globalvar.py

+ 6 - 0
gui/wxpython/core/globalvar.py

@@ -162,9 +162,15 @@ def UpdateGRASSAddOnCommands(eList = None):
         Debug.msg(1, "Number of removed AddOn commands: %d", len(eList))
 
     nCmd = 0
+    pathList = os.getenv('PATH', '').split(os.pathsep)
     for path in addonPath.split(os.pathsep):
         if not os.path.exists(path) or not os.path.isdir(path):
             continue
+        
+        # check if addon is in the path
+        if pathList and path not in pathList:
+            os.environ['PATH'] = path + os.pathsep + os.environ['PATH']
+        
         for fname in os.listdir(path):
             if fname in ['docs', 'modules.xml']:
                 continue