Bläddra i källkod

wxGUI: fix colorrules.py for vectors
(merge https://trac.osgeo.org/grass/changeset/44599 from devbr6)


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

Martin Landa 14 år sedan
förälder
incheckning
c15138e65a
1 ändrade filer med 7 tillägg och 6 borttagningar
  1. 7 6
      gui/wxpython/gui_modules/colorrules.py

+ 7 - 6
gui/wxpython/gui_modules/colorrules.py

@@ -661,14 +661,15 @@ class ColorTable(wx.Frame):
         for rule in self.ruleslines.itervalues():
             if not rule['value']: # skip empty rules
                 continue
-            if rule['value'] not in ('nv', 'default') and \
-                    rule['value'][-1] != '%' and \
-                    not self._IsNumber(rule['value']):
-                gcmd.GError(_("Invalid rule value '%s'. Unable to apply color table.") % rule['value'],
-                            parent = self)
-                return False
             
             if self.raster:
+                if rule['value'] not in ('nv', 'default') and \
+                        rule['value'][-1] != '%' and \
+                        not self._IsNumber(rule['value']):
+                    gcmd.GError(_("Invalid rule value '%s'. Unable to apply color table.") % rule['value'],
+                                parent = self)
+                    return False
+                
                 rulestxt += rule['value'] + ' ' + rule['color'] + '\n'
             else:
                 rulestxt += "UPDATE %s SET %s='%s' WHERE %s ;\n" % (self.properties['table'],