[GRASS-SVN] r47761 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Aug 18 16:39:06 EDT 2011
Author: annakrat
Date: 2011-08-18 13:39:06 -0700 (Thu, 18 Aug 2011)
New Revision: 47761
Modified:
grass/trunk/gui/wxpython/gui_modules/colorrules.py
Log:
wxGUI: color rules dialog: warning when loading invalid format
Modified: grass/trunk/gui/wxpython/gui_modules/colorrules.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/colorrules.py 2011-08-18 20:17:07 UTC (rev 47760)
+++ grass/trunk/gui/wxpython/gui_modules/colorrules.py 2011-08-18 20:39:06 UTC (rev 47761)
@@ -587,7 +587,13 @@
minim = maxim = count = 0
for line in ctable.splitlines():
- value, color = map(lambda x: x.strip(), line.split(' '))
+ try:
+ value, color = map(lambda x: x.strip(), line.split(' '))
+ except ValueError:
+ gcmd.GMessage(parent = self, message = _("Invalid color table format"))
+ self.rulesPanel.Clear()
+ return
+
self.rulesPanel.ruleslines[count]['value'] = value
self.rulesPanel.ruleslines[count]['color'] = color
self.rulesPanel.mainPanel.FindWindowById(count + 1000).SetValue(value)
More information about the grass-commit
mailing list