|
@@ -63,17 +63,18 @@ def INPUT(action, context, parameters):
|
|
|
controller.addInput(Event("action", "action_in", [action, _next_ID(), context, parameters]))
|
|
|
|
|
|
def OUTPUT():
|
|
|
- response = responses.fetch(-1)
|
|
|
- print("Got response with name: " + str(response.name))
|
|
|
- if response.name == "result":
|
|
|
- print("Value: " + str(response.parameters[1]))
|
|
|
- return response.parameters[1]
|
|
|
- elif response.name == "exception":
|
|
|
- print("Exception: " + str(response.parameters))
|
|
|
- if response.parameters[1] == "UnknownIdentifier":
|
|
|
- raise UnknownIdentifier()
|
|
|
- elif response.parameters[1] == "UnknownMetamodellingHierarchy":
|
|
|
- raise UnknownMetamodellingHierarchy()
|
|
|
+ while 1:
|
|
|
+ response = responses.fetch(-1)
|
|
|
+ print("Got response with name: " + str(response.name))
|
|
|
+ if response.name == "result":
|
|
|
+ print("Value: " + str(response.parameters[1]))
|
|
|
+ return response.parameters[1]
|
|
|
+ elif response.name == "exception":
|
|
|
+ print("Exception: " + str(response.parameters))
|
|
|
+ if response.parameters[1] == "UnknownIdentifier":
|
|
|
+ raise UnknownIdentifier()
|
|
|
+ elif response.parameters[1] == "UnknownMetamodellingHierarchy":
|
|
|
+ raise UnknownMetamodellingHierarchy()
|
|
|
|
|
|
def init(address_param="127.0.0.1:8001", timeout=20.0):
|
|
|
INPUT("init", None, [address_param, timeout])
|