瀏覽代碼

Fixed fetching out output nodes

Yentl Van Tendeloo 9 年之前
父節點
當前提交
cadb768569
共有 1 個文件被更改,包括 17 次插入23 次删除
  1. 17 23
      integration/utils.py

+ 17 - 23
integration/utils.py

@@ -153,29 +153,23 @@ def run_file(files, parameters, expected, mode):
                         # Modelverse has already terminated, which isn't a good sign!
                         return False
 
-                    val = urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "username": username})), timeout=10).read()
-                    #TODO if there is a value here, we have to store it for later use!
-                    l, r = val.split("&", 1)
-                    if l.startswith("id"):
-                        id_str = l
-                        val_str = r
-                    else:
-                        id_str = r
-                        val_str = l
-                    id_val = id_str.split("=", 1)[1]
-                    val_val = val_str.split("=", 1)[1]
-                    #TODO this doesn't work!!! we expect it to be filled in, which it isn't!
-
-                    if val_val == "None":
-                        print("Value is for us: keeping")
-                        print(id_val)
-                        print(val_val)
-                        var_list[p] = id_val
-                    else:
-                        print("Value not for us: skip")
-                        print(id_val)
-                        print(val_val)
-                        got_output.append(val)
+                    while 1:
+                        val = urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "username": username})), timeout=10).read()
+                        l, r = val.split("&", 1)
+                        if l.startswith("id"):
+                            id_str = l
+                            val_str = r
+                        else:
+                            id_str = r
+                            val_str = l
+                        id_val = id_str.split("=", 1)[1]
+                        val_val = val_str.split("=", 1)[1]
+
+                        if val_val == "None":
+                            var_list[p] = id_val
+                            break
+                        else:
+                            got_output.append(val)
                     continue
                 else:
                     val = var_list[p]