From 22f12bdd64bc9417bc9af29844213e7735080144 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Thu, 4 Jun 2015 01:26:00 +0100 Subject: generate proper json to send to the clients Signed-off-by: Olivier Gayot --- CAO_Status.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 CAO_Status.py (limited to 'CAO_Status.py') 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}) -- cgit v1.2.3