Skip to content

Commit 184b45c

Browse files
committed
Reflect renaming
1 parent 62cd5d5 commit 184b45c

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

dashipy/dashipy/server.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -128,17 +128,17 @@ class CallbackHandler(DashiHandler):
128128
def post(self):
129129
data = tornado.escape.json_decode(self.request.body)
130130
# TODO: validate data
131-
call_requests: list[dict] = data.get("callRequests") or []
131+
callback_requests: list[dict] = data.get("callbackRequests") or []
132132

133133
context: Context = self.settings[DASHI_CONTEXT_KEY]
134134

135135
# TODO: assert correctness, set status code on error
136-
change_requests: list[dict] = []
137-
for call_request in call_requests:
138-
contrib_point_name: str = call_request["contribPoint"]
139-
contrib_index: int = call_request["contribIndex"]
140-
callback_index: int = call_request["callbackIndex"]
141-
input_values: list = call_request["inputValues"]
136+
state_change_requests: list[dict] = []
137+
for callback_request in callback_requests:
138+
contrib_point_name: str = callback_request["contribPoint"]
139+
contrib_index: int = callback_request["contribIndex"]
140+
callback_index: int = callback_request["callbackIndex"]
141+
input_values: list = callback_request["inputValues"]
142142

143143
contribution_points = self.contribution_points
144144
contributions = contribution_points[contrib_point_name]
@@ -149,10 +149,10 @@ def post(self):
149149
if len(callback.outputs) == 1:
150150
output_values = (output_values,)
151151

152-
changes: list[dict] = []
152+
state_changes: list[dict] = []
153153
for output_index, output in enumerate(callback.outputs):
154154
output_value = output_values[output_index]
155-
changes.append(
155+
state_changes.append(
156156
{
157157
**output.to_dict(),
158158
"value": (
@@ -165,16 +165,16 @@ def post(self):
165165
}
166166
)
167167

168-
change_requests.append(
168+
state_change_requests.append(
169169
{
170170
"contribPoint": contrib_point_name,
171171
"contribIndex": contrib_index,
172-
"changes": changes,
172+
"stateChanges": state_changes,
173173
}
174174
)
175175

176176
self.set_header("Content-Type", "text/json")
177-
self.write(json.dumps({"result": change_requests}, cls=NumpyJSONEncoder))
177+
self.write(json.dumps({"result": state_change_requests}, cls=NumpyJSONEncoder))
178178

179179

180180
def print_usage(app, port):

0 commit comments

Comments
 (0)