浏览代码

wxGUI/colortable: allow percent value
(merge from devbr6, https://trac.osgeo.org/grass/changeset/33977)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@33978 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 16 年之前
父节点
当前提交
c5e5a87dba
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      gui/wxpython/gui_modules/colorrules.py

+ 3 - 2
gui/wxpython/gui_modules/colorrules.py

@@ -451,9 +451,10 @@ class ColorTable(wx.Frame):
         if self.elem == 'cell':
 
             try:
-                if vals != '-':
+                if vals != '-' and \
+                        vals[-1] != '%':
                     float(vals)
-            except ValueError:
+            except (IndexError, ValueError):
                 tc.SetValue('')
                 self.ruleslines[num-1000]['value'] = ''
                 return