Jelajahi Sumber

wxGUI/gmodeler: fix checking undefined variables

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@67280 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 9 tahun lalu
induk
melakukan
d4bd66dae4
1 mengubah file dengan 7 tambahan dan 2 penghapusan
  1. 7 2
      gui/wxpython/gmodeler/model.py

+ 7 - 2
gui/wxpython/gmodeler/model.py

@@ -450,8 +450,13 @@ class Model(object):
                 key, value = opt.split('=', 1)
                 sval = pattern.search(value)
                 if sval:
-                    var = sval.group(2).strip()[1:] # ignore '%'
-                    if var not in variables:
+                    var = sval.group(2).strip()[1:] # strip '%' from beginning
+                    found = False
+                    for v in variables:
+                        if var.startswith(v):
+                            found = True
+                            break
+                    if not found:
                         report = True
                         for item in filter(lambda x: isinstance(x, ModelLoop), action.GetBlock()):
                             if var in item.GetLabel():