瀏覽代碼

fix pygrass conf.py to import modules correctly (requires GISBASE to be defined)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@59943 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 11 年之前
父節點
當前提交
6ab9469250
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      lib/python/pygrass/docs/conf.py

+ 3 - 1
lib/python/pygrass/docs/conf.py

@@ -16,7 +16,9 @@ import sys, os
 # If extensions (or modules to document with autodoc) are in another directory,
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 # documentation root, use os.path.abspath to make it absolute, like shown here.
-sys.path.insert(0, os.path.abspath('../src/'))
+if not os.getenv('GISBASE'):
+    sys.exit("GISBASE not defined")
+sys.path.insert(0, os.path.abspath(os.path.join(os.environ['GISBASE'], 'etc', 'python', 'grass')))
 
 
 # -- General configuration -----------------------------------------------------
 # -- General configuration -----------------------------------------------------