|
@@ -57,14 +57,27 @@ available_attrs = []
|
|
|
simulation = []
|
|
|
|
|
|
def poll(address):
|
|
|
+ working_attribute = []
|
|
|
+ working_available_attrs = []
|
|
|
+ working_simulation = []
|
|
|
+
|
|
|
while 1:
|
|
|
returnvalue = urllib2.urlopen(urllib2.Request(address, urllib.urlencode({"op": "get_output", "username": "CBD_env"}))).read()
|
|
|
- if returnvalue.startswith("AVL"):
|
|
|
- available_attrs.append(returnvalue)
|
|
|
- elif returnvalue.startswith("ATR"):
|
|
|
- attribute.append(returnvalue)
|
|
|
- elif returnvalue.startswith("SIM"):
|
|
|
- simulation.append(returnvalue)
|
|
|
+ if returnvalue.startswith("AVAILABLE:"):
|
|
|
+ working_available_attrs.append(returnvalue)
|
|
|
+ elif returnvalue.startswith("ATTRIBUTE:"):
|
|
|
+ working_attribute.append(returnvalue)
|
|
|
+ elif returnvalue.startswith("SIMULATION:"):
|
|
|
+ working_simulation.append(returnvalue)
|
|
|
+ elif returnvalue.startswith("FINISH_AVAILABLE"):
|
|
|
+ available_attrs.append(working_available_attrs)
|
|
|
+ working_available_attrs = []
|
|
|
+ elif returnvalue.startswith("FINISH_ATTRIBUTE"):
|
|
|
+ attributes.append(working_attributes)
|
|
|
+ working_attributes = []
|
|
|
+ elif returnvalue.startswith("FINISH_SIMULATION"):
|
|
|
+ simulation.append(working_simulation)
|
|
|
+ working_simulation = []
|
|
|
|
|
|
class MvLayer():
|
|
|
def __init__(self, address):
|