[GRASS-SVN] r53461 - grass/branches/develbranch_6/gui/wxpython

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Oct 18 04:32:02 PDT 2012


Author: martinl
Date: 2012-10-18 04:32:01 -0700 (Thu, 18 Oct 2012)
New Revision: 53461

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


Modified: grass/branches/develbranch_6/gui/wxpython/gis_set.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gis_set.py	2012-10-18 11:26:30 UTC (rev 53460)
+++ grass/branches/develbranch_6/gui/wxpython/gis_set.py	2012-10-18 11:32:01 UTC (rev 53461)
@@ -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