From 8997a1d24898ce8d432e419d39bf204369777799 Mon Sep 17 00:00:00 2001 From: Daniel Milchev Date: Fri, 2 Sep 2022 17:45:49 +0300 Subject: [PATCH] [#98] Ensure graceful exit of the quickstart Python script and the How-to guide Python scripts Formatted the script Signed-off-by: Daniel Milchev --- quickstart/hono_commands.py | 2 +- quickstart/hono_commands_fu.py | 4 ++-- quickstart/hono_commands_su.py | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/quickstart/hono_commands.py b/quickstart/hono_commands.py index 6cace573..5011c230 100644 --- a/quickstart/hono_commands.py +++ b/quickstart/hono_commands.py @@ -60,7 +60,7 @@ def on_message(self, event): event.connection.close() def on_connection_closed(self, event): - print('[closing]') + print('[connection closed]') os.kill(os.getpid(), signal.SIGINT) diff --git a/quickstart/hono_commands_fu.py b/quickstart/hono_commands_fu.py index d971ab18..d10ce8e1 100644 --- a/quickstart/hono_commands_fu.py +++ b/quickstart/hono_commands_fu.py @@ -61,7 +61,7 @@ def on_message(self, event): event.connection.close() def on_connection_closed(self, event): - print('[closing]') + print('[connection closed]') os.kill(os.getpid(), signal.SIGINT) @@ -134,7 +134,7 @@ def on_message(self, event): event.connection.close() def on_connection_closed(self, event): - print('[closing]') + print('[connection closed]') os.kill(os.getpid(), signal.SIGINT) diff --git a/quickstart/hono_commands_su.py b/quickstart/hono_commands_su.py index c7fd200f..780fc415 100644 --- a/quickstart/hono_commands_su.py +++ b/quickstart/hono_commands_su.py @@ -80,11 +80,10 @@ def on_message(self, event): event.connection.close() def on_connection_closed(self, event): - print('[closing]') + print('[connection closed]') os.kill(os.getpid(), signal.SIGINT) - class CommandsInvoker(MessagingHandler): def __init__(self, server, address): super(CommandsInvoker, self).__init__()