summaryrefslogtreecommitdiff
path: root/swiftstory/status.py
diff options
context:
space:
mode:
authorOlivier Gayot <olivier.gayot@sigexec.com>2021-12-23 15:27:43 +0100
committerOlivier Gayot <olivier.gayot@sigexec.com>2021-12-23 23:15:21 +0100
commit82cd09e010783b81ec58145c7682f4b8da49ac85 (patch)
tree83b3e61aaa4befcd340a01b2fb147a2306bdb29e /swiftstory/status.py
parent1be5c49ae402b768f9206724abdd503c18933ae1 (diff)
Use lowercase module names
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
Diffstat (limited to 'swiftstory/status.py')
-rw-r--r--swiftstory/status.py8
1 files changed, 8 insertions, 0 deletions
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}})