瀏覽代碼

pythonlib: backport set_gui_path() from trunk, needed for wx.mprecip addon

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@67739 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 9 年之前
父節點
當前提交
71852b7669
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      lib/python/script/setup.py

+ 7 - 0
lib/python/script/setup.py

@@ -109,6 +109,13 @@ def write_gisrc(dbase, location, mapset):
     return gisrc
 
 
+def set_gui_path():
+    """Insert wxPython GRASS path to sys.path."""
+    gui_path = os.path.join(os.environ['GISBASE'], 'gui', 'wxpython')
+    if gui_path and gui_path not in sys.path:
+        sys.path.insert(0, gui_path)
+
+
 # TODO: there should be a function to do the clean up
 # (unset the GISRC and delete the file)
 def init(gisbase, dbase='', location='demolocation', mapset='PERMANENT'):