summaryrefslogtreecommitdiff
path: root/CAO/Status.py
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2015-06-14 22:31:48 +0100
committerOlivier Gayot <duskcoder@gmail.com>2015-06-14 22:37:40 +0100
commit0fb08748e5285e5d4adc6135eec8889887a63299 (patch)
tree3a82c2899f33a8d4234b07799cff00865c8e141c /CAO/Status.py
parentad12c67adcc8e3c0f29814b1b95959ac4b9f4a4d (diff)
use a python package instead of just modules
The package is contained in the CAO/ folder. server.py is still at the root of the repository though. 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..782a0b4
--- /dev/null
+++ b/CAO/Status.py
@@ -0,0 +1,7 @@
+import json
+
+def cao_error(msg, code=255):
+ return json.dumps({'type': 'response', 'content': {'status': code, 'info': msg}})
+
+def cao_success(obj):
+ return json.dumps({'type': 'response', 'content': {'status': 0, 'result': obj}})