浏览代码

pygrass: fix set_path() when compiling g.gui.mwprecip addons (GRASS installed from package)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@67537 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 9 年之前
父节点
当前提交
17a8130196
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      lib/python/pygrass/utils.py

+ 6 - 1
lib/python/pygrass/utils.py

@@ -300,10 +300,15 @@ def get_lib_path(modname, libname=None):
     elif getenv('GRASS_ADDON_BASE') and \
     elif getenv('GRASS_ADDON_BASE') and \
             isdir(join(getenv('GRASS_ADDON_BASE'), modname, modname)):
             isdir(join(getenv('GRASS_ADDON_BASE'), modname, modname)):
         path = join(os.getenv('GRASS_ADDON_BASE'), modname, modname)
         path = join(os.getenv('GRASS_ADDON_BASE'), modname, modname)
-    elif libname and isdir(join('..', libname)):
+    elif libname and isdir(join('..', libname)): # used by g.extension compilation process
         path = join('..', libname)
         path = join('..', libname)
+    elif isdir(join('..', 'etc', modname)):      # used by g.extension compilation process
+        path = join('..', 'etc', modname)
+    elif isdir(join('etc', modname)):            # used by g.extension compilation process
+        path = join('etc', modname)
     else:
     else:
         path = None
         path = None
+    
     return path
     return path