Browse Source

Added compile script in Python

Yentl Van Tendeloo 5 years ago
parent
commit
5dcb6e648a
2 changed files with 14 additions and 0 deletions
  1. 0 0
      bootstrap/__init__.py
  2. 14 0
      scripts/compile.py

+ 0 - 0
bootstrap/__init__.py


+ 14 - 0
scripts/compile.py

@@ -0,0 +1,14 @@
+import sys
+import os
+import urllib2
+import subprocess
+
+address = sys.argv[1]
+filename = os.path.realpath(sys.argv[2])
+username = sys.argv[3]
+modulename = sys.argv[4]
+mode = sys.argv[5]
+
+urllib2.urlopen(urllib2.Request(address, "op=set_input&username=user_manager&element_type=V&value=\"%s\"" % username)).read()
+
+subprocess.check_call([sys.executable, "hutn_compiler/compiler.py", filename, "grammars/actionlanguage.g", mode, username, modulename, filename, address], cwd="interface/HUTN")