summaryrefslogtreecommitdiff
path: root/CAO_Status.py
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2015-06-04 05:54:16 +0100
committerOlivier Gayot <duskcoder@gmail.com>2015-06-04 05:54:16 +0100
commit0cae8115a93589e37943590db45967beec841a07 (patch)
treead5bbecff01e42362d3670b90000fa77e9d38cc9 /CAO_Status.py
parent7d191b337b3114ceaa2ea69b538d3cd4f83bc094 (diff)
added a system of notification
what the client will receive will look like: {'type': TYPE, 'content': CONTENT} TYPE will be either 'notification' or 'response' CONTENT will be the content of the notification or the response Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'CAO_Status.py')
-rw-r--r--CAO_Status.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/CAO_Status.py b/CAO_Status.py
index 813fcf0..782a0b4 100644
--- a/CAO_Status.py
+++ b/CAO_Status.py
@@ -1,7 +1,7 @@
import json
def cao_error(msg, code=255):
- return json.dumps({'status': code, 'info': msg})
+ return json.dumps({'type': 'response', 'content': {'status': code, 'info': msg}})
def cao_success(obj):
- return json.dumps({'status': 0, 'result': obj})
+ return json.dumps({'type': 'response', 'content': {'status': 0, 'result': obj}})