|
@@ -3,15 +3,10 @@ import urllib
|
|
|
import urllib2
|
|
|
import json
|
|
|
|
|
|
-def flush_data(address, data, username):
|
|
|
- if data:
|
|
|
- urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "set_input", "data": json.dumps(data), "username": username})), timeout=10).read()
|
|
|
- return []
|
|
|
+sys.path.append("scripts")
|
|
|
+from process import send_to_mv
|
|
|
|
|
|
-def link(address, username, objects):
|
|
|
- # Read out all symbol tables that are to be linked
|
|
|
- definers = {}
|
|
|
- users = {}
|
|
|
+def link_code(address, username, objects):
|
|
|
data = []
|
|
|
|
|
|
data.append(("V", '3'))
|
|
@@ -22,8 +17,12 @@ def link(address, username, objects):
|
|
|
|
|
|
# Call the main function
|
|
|
data.append(("V", '"main"'))
|
|
|
+ return data
|
|
|
+
|
|
|
+def link(address, username, objects):
|
|
|
+ # Read out all symbol tables that are to be linked
|
|
|
+ send_to_mv(address, username, link_code(address, username, objects))
|
|
|
|
|
|
- data = flush_data(address, data, username)
|
|
|
v = urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "username": username}))).read()
|
|
|
if "OK" not in v:
|
|
|
print(v)
|