|
@@ -16,6 +16,11 @@ class PrimitivesObjectVisitor(PrimitivesVisitor):
|
|
|
|
|
|
self.object_symbols = {}
|
|
|
|
|
|
+ def flush_data(data):
|
|
|
+ if data:
|
|
|
+ urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "set_input", "data": json.dumps(data), "username": self.username}))).read()
|
|
|
+ return []
|
|
|
+
|
|
|
with open(self.real_file, 'r') as f:
|
|
|
import hashlib
|
|
|
md5 = hashlib.md5()
|
|
@@ -28,9 +33,9 @@ class PrimitivesObjectVisitor(PrimitivesVisitor):
|
|
|
flush_data(['3', '"is_defined"', '"%s"' % self.obj_file])
|
|
|
|
|
|
v = urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "get_output", "username": self.username}))).read()
|
|
|
- v = v.split("=", 2)[2]
|
|
|
+ v = json.loads(v)
|
|
|
simple_filename = self.real_file.rsplit("/")[-1]
|
|
|
- if v == "None":
|
|
|
+ if v == None:
|
|
|
# Not defined, so recompile
|
|
|
print("[COMPILE] %s" % simple_filename)
|
|
|
else:
|
|
@@ -73,6 +78,7 @@ class PrimitivesObjectVisitor(PrimitivesVisitor):
|
|
|
|
|
|
urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "set_input", "data": json.dumps(data), "username": self.username}))).read()
|
|
|
v = urllib2.urlopen(urllib2.Request(self.address, urllib.urlencode({"op": "get_output", "username": self.username}))).read()
|
|
|
+ v = json.loads(v)
|
|
|
if v == "DONE":
|
|
|
return True
|
|
|
else:
|