summaryrefslogtreecommitdiff
path: root/CAO_Status.py
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2015-06-04 01:26:00 +0100
committerOlivier Gayot <duskcoder@gmail.com>2015-06-04 01:34:45 +0100
commit22f12bdd64bc9417bc9af29844213e7735080144 (patch)
treed004d93f80311e83fe85acc9c5054eba5ff6915d /CAO_Status.py
parent0d87016f206b9dab6c7a0d694db160dd07156499 (diff)
generate proper json to send to the clients
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'CAO_Status.py')
-rw-r--r--CAO_Status.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/CAO_Status.py b/CAO_Status.py
new file mode 100644
index 0000000..813fcf0
--- /dev/null
+++ b/CAO_Status.py
@@ -0,0 +1,7 @@
+import json
+
+def cao_error(msg, code=255):
+ return json.dumps({'status': code, 'info': msg})
+
+def cao_success(obj):
+ return json.dumps({'status': 0, 'result': obj})