Explorar o código

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 %!s(int64=11) %!d(string=hai) anos
pai
achega
aee733bf5b
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  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