浏览代码

don't fail if GRASS_PROJSHARE is not defined

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@40085 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 15 年之前
父节点
当前提交
551e4f3dad
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      gui/wxpython/gui_modules/preferences.py

+ 7 - 2
gui/wxpython/gui_modules/preferences.py

@@ -1,4 +1,4 @@
-"""
+"""!
 @package preferences
 
 @brief User preferences dialog
@@ -49,6 +49,11 @@ class Settings:
         #
         self.sep = ';'
 
+        try:
+            projFile = utils.PathJoin(os.environ["GRASS_PROJSHARE"], 'epsg')
+        except KeyError:
+            projFile = ''
+        
         #
         # default settings
         #
@@ -119,7 +124,7 @@ class Settings:
                 'statusbar' : {
                     'proj4'    : '',
                     'epsg'     : '',
-                    'projFile' : utils.PathJoin(os.environ["GRASS_PROJSHARE"], 'epsg'),
+                    'projFile' : projFile,
                     },
                 'format' : {
                     'll'  : 'DMS',