Yentl Van Tendeloo 8 anni fa
parent
commit
7f2e091f93

+ 0 - 1
interface/HUTN/hutn_compiler/constructors_visitor.py

@@ -8,7 +8,6 @@ class ConstructorsVisitor(Visitor):
         self.free_id = 0
 
     def dump(self):
-        print '\n'.join([repr(x) for x in self.constructors])
         return self.constructors
         # return pickle.dumps(self.constructors, pickle.HIGHEST_PROTOCOL)
 

+ 0 - 3
kernel/modelverse_kernel/primitives.py

@@ -486,7 +486,6 @@ def is_edge(a, **remainder):
 
 #TODO deprecate
 def deserialize(a, root, **remainder):
-    print("DESERIALIZE")
     value, = yield [("RV", [a])]
     id_mappings = {}
     complex_primitives = frozenset(["if", "while", "assign", "call", "break", "continue", "return","resolve","access", "constant", "input", "output", "declare", "global"])
@@ -503,8 +502,6 @@ def deserialize(a, root, **remainder):
             name, temp = constructor.split("(", 1)
             string_value = temp[:-1]
             if string_value in complex_primitives:
-                if string_value == "break":
-                    print("Deserialize break")
                 value = {"value": string_value}
             else:
                 #TODO this is very dangerous!

+ 8 - 9
scripts/compile.py

@@ -14,15 +14,14 @@ def do_compile(address, filename, username, modulename, mode, optionals=['--debu
         else:
             # Load AL grammar
             grammar = "grammars/actionlanguage.g"
-    while 1:
-        try:
-            # Create new user
-            urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % username, "username": "user_manager"}))).read()
-            subprocess.check_call([sys.executable, "hutn_compiler/compiler.py", filename, grammar, mode, username, modulename, filename, address] + optionals, cwd="interface/HUTN")
-            break
-        except:
-            time.sleep(0.01)
-    return 0
+
+    # Create new user
+    try:
+        urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "value": '"%s"' % username, "username": "user_manager"}))).read()
+        subprocess.check_call([sys.executable, "hutn_compiler/compiler.py", filename, grammar, mode, username, modulename, filename, address] + optionals, cwd="interface/HUTN")
+        return 0
+    except:
+        return 1
 
 if __name__ == "__main__":
     if len(sys.argv) != 6: