[GRASS-SVN] r53463 - grass/branches/releasebranch_6_4/gui/wxpython

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Oct 18 04:37:13 PDT 2012


Author: martinl
Date: 2012-10-18 04:37:13 -0700 (Thu, 18 Oct 2012)
New Revision: 53463

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


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py	2012-10-18 11:35:15 UTC (rev 53462)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py	2012-10-18 11:37:13 UTC (rev 53463)
@@ -372,7 +372,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