|
@@ -1,7 +1,7 @@
|
|
|
"""
|
|
|
Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
|
|
|
|
|
|
-Date: Mon May 28 10:12:07 2018
|
|
|
+Date: Mon May 28 17:39:21 2018
|
|
|
|
|
|
Model author: Yentl Van Tendeloo
|
|
|
Model name: MvK Server
|
|
@@ -2433,6 +2433,7 @@ class Modelverse(RuntimeClassBase):
|
|
|
def _initialized_http_mapper_init_0_exec(self, parameters):
|
|
|
value = parameters[0]
|
|
|
self.big_step.outputEventOM(Event("narrow_cast", None, [self, self.http_clients[0], Event("HTTP_input", None, [urlencode({"op": "set_input", "data": json.dumps(value), "taskname": self.taskname}), None])]))
|
|
|
+ #print("Request: " + str(value))
|
|
|
|
|
|
def _initialized_http_mapper_init_0_guard(self, parameters):
|
|
|
value = parameters[0]
|
|
@@ -2441,6 +2442,7 @@ class Modelverse(RuntimeClassBase):
|
|
|
def _initialized_http_mapper_init_1_exec(self, parameters):
|
|
|
value = parameters[0]
|
|
|
self.big_step.outputEventOM(Event("narrow_cast", None, [self, self.http_clients[0], Event("HTTP_input", None, [urlencode({"op": "set_input", "value": json.dumps(value), "taskname": self.taskname}), None])]))
|
|
|
+ #print("Request: " + str(value))
|
|
|
|
|
|
def _initialized_http_mapper_init_1_guard(self, parameters):
|
|
|
value = parameters[0]
|
|
@@ -2881,8 +2883,11 @@ class Modelverse(RuntimeClassBase):
|
|
|
|
|
|
def _initialized_behaviour_operations_read_attrs_0_exec(self, parameters):
|
|
|
response = self.responses.pop(0).split(": ", 1)[1].strip()
|
|
|
- values = {line.split(" : ", 1)[0]: line.split(" : ", 1)[1] for line in response.split("\n")}
|
|
|
- values = {key: json.loads(values[key].split(" = ", 1)[1]) for key in values}
|
|
|
+ if "\n" in response:
|
|
|
+ values = {line.split(" : ", 1)[0]: line.split(" : ", 1)[1] for line in response.split("\n")}
|
|
|
+ values = {key: json.loads(values[key].split(" = ", 1)[1]) for key in values}
|
|
|
+ else:
|
|
|
+ values = {}
|
|
|
self.raiseInternalEvent(Event("result", None, [values]))
|
|
|
|
|
|
def _initialized_behaviour_operations_read_attrs_0_guard(self, parameters):
|