From 82cd09e010783b81ec58145c7682f4b8da49ac85 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Thu, 23 Dec 2021 15:27:43 +0100 Subject: Use lowercase module names Signed-off-by: Olivier Gayot --- swiftstory/status.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 swiftstory/status.py (limited to 'swiftstory/status.py') diff --git a/swiftstory/status.py b/swiftstory/status.py new file mode 100644 index 0000000..fb8347b --- /dev/null +++ b/swiftstory/status.py @@ -0,0 +1,8 @@ +import json + + +def error(msg, code=255): + return json.dumps({'type': 'response', 'content': {'status': code, 'info': msg}}) + +def success(obj): + return json.dumps({'type': 'response', 'content': {'status': 0, 'result': obj}}) -- cgit v1.2.3