浏览代码

If ~/.grass7 directory does not exist, create it.

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@39935 15284696-431f-4ddb-bdfa-cd5b030d7da7
Michael Barton 15 年之前
父节点
当前提交
66c1e59db0
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      gui/wxpython/gui_modules/preferences.py

+ 8 - 0
gui/wxpython/gui_modules/preferences.py

@@ -646,6 +646,14 @@ class Settings:
         location_name = gisenv['LOCATION_NAME']
         location_name = gisenv['LOCATION_NAME']
         mapset_name = gisenv['MAPSET']
         mapset_name = gisenv['MAPSET']
         
         
+        dirPath = os.path.join(home, '.grass7')
+        if os.path.exists(dirPath) == False:
+            try:
+                os.mkdir(dirPath)
+            except:
+                wx.MessageBox('Cannot write settings to configuration file in [home]/.grass7',
+                              'Error saving preferences')
+
         filePath = os.path.join(home, '.grass7', 'wx')
         filePath = os.path.join(home, '.grass7', 'wx')
         
         
         try:
         try: