summaryrefslogtreecommitdiff
path: root/swiftstory/status.py
diff options
context:
space:
mode:
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}})