summaryrefslogtreecommitdiff
path: root/swiftstory/Status.py
diff options
context:
space:
mode:
Diffstat (limited to 'swiftstory/Status.py')
-rw-r--r--swiftstory/Status.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/swiftstory/Status.py b/swiftstory/Status.py
new file mode 100644
index 0000000..4e8c84d
--- /dev/null
+++ b/swiftstory/Status.py
@@ -0,0 +1,7 @@
+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}})