[GRASS-SVN] r53462 - grass/trunk/gui/wxpython

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Oct 18 04:35:16 PDT 2012


Author: martinl
Date: 2012-10-18 04:35:15 -0700 (Thu, 18 Oct 2012)
New Revision: 53462

Modified:
   grass/trunk/gui/wxpython/gis_set.py
Log:
wxGUI: don't fail on invalid GISRC file (unable to parse line)
       (merge r53461 from devbr6)


Modified: grass/trunk/gui/wxpython/gis_set.py
===================================================================
--- grass/trunk/gui/wxpython/gis_set.py	2012-10-18 11:32:01 UTC (rev 53461)
+++ grass/trunk/gui/wxpython/gis_set.py	2012-10-18 11:35:15 UTC (rev 53462)
@@ -370,7 +370,11 @@
             try:
                 rc = open(gisrc, "r")
                 for line in rc.readlines():
-                    key, val = line.split(":", 1)
+                    try:
+                        key, val = line.split(":", 1)
+                    except ValueError, e:
+                        sys.stderr.write(_('Invalid line in GISRC file (%s):%s\n' % \
+                                               (e, line)))
                     grassrc[key.strip()] = DecodeString(val.strip())
             finally:
                 rc.close()



More information about the grass-commit mailing list