Kaynağa Gözat

wxGUI/gmodeler: fix checking undefined variables
(merge https://trac.osgeo.org/grass/changeset/67280 from trunk)


git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@67283 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 9 yıl önce
ebeveyn
işleme
320fda47a7
1 değiştirilmiş dosya ile 7 ekleme ve 2 silme
  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():