[GRASS-SVN] r39935 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Dec 6 19:42:40 EST 2009


Author: cmbarton
Date: 2009-12-06 19:42:39 -0500 (Sun, 06 Dec 2009)
New Revision: 39935

Modified:
   grass/trunk/gui/wxpython/gui_modules/preferences.py
Log:
If ~/.grass7 directory does not exist, create it.

Modified: grass/trunk/gui/wxpython/gui_modules/preferences.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/preferences.py	2009-12-06 22:58:43 UTC (rev 39934)
+++ grass/trunk/gui/wxpython/gui_modules/preferences.py	2009-12-07 00:42:39 UTC (rev 39935)
@@ -646,6 +646,14 @@
         location_name = gisenv['LOCATION_NAME']
         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')
         
         try:



More information about the grass-commit mailing list