From 9b06453f1f38c3b159be5d1b203a978f1aebb703 Mon Sep 17 00:00:00 2001 From: TEDmk Date: Thu, 21 Mar 2024 23:13:07 +0100 Subject: [PATCH] Fix python code in Hello World page Signed-off-by: TEDmk --- .../version-0.82/tour/hello-world.mdx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/versioned_docs/version-0.82/tour/hello-world.mdx b/versioned_docs/version-0.82/tour/hello-world.mdx index 4104c8c7..4746e658 100644 --- a/versioned_docs/version-0.82/tour/hello-world.mdx +++ b/versioned_docs/version-0.82/tour/hello-world.mdx @@ -362,18 +362,18 @@ This actor has a single function, `handle`, that implements the `incoming-handle from hello import exports from hello.types import Ok from hello.imports.types import ( - IncomingRequest, ResponseOutparam, - OutgoingResponse, Fields, OutgoingBody + IncomingRequest, ResponseOutparam, + OutgoingResponse, Fields, OutgoingBody ) class IncomingHandler(exports.IncomingHandler): -def handle(self, \_: IncomingRequest, response_out: ResponseOutparam): # Construct the HTTP response to send back -outgoingResponse = OutgoingResponse(Fields.from_list([])) # Set the status code to OK -outgoingResponse.set_status_code(200) -outgoingBody = outgoingResponse.body() # Write our Hello World message to the response body -outgoingBody.write().blocking_write_and_flush(bytes("Hello from Python!\n", "utf-8")) -OutgoingBody.finish(outgoingBody, None) # Set and send the HTTP response -ResponseOutparam.set(response_out, Ok(outgoingResponse)) + def handle(self, _: IncomingRequest, response_out: ResponseOutparam): # Construct the HTTP response to send back + outgoingResponse = OutgoingResponse(Fields.from_list([])) # Set the status code to OK + outgoingResponse.set_status_code(200) + outgoingBody = outgoingResponse.body() # Write our Hello World message to the response body + outgoingBody.write().blocking_write_and_flush(bytes("Hello from Python!\n", "utf-8")) + OutgoingBody.finish(outgoingBody, None) # Set and send the HTTP response + ResponseOutparam.set(response_out, Ok(outgoingResponse)) ````