From 493b116f73ec3912ca7af3d6ece3434279cbcfb5 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Fri, 9 Mar 2018 13:38:22 +0100 Subject: renamed the project SwiftStory Signed-off-by: Olivier Gayot --- swiftstory/Status.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 swiftstory/Status.py (limited to 'swiftstory/Status.py') 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}}) -- cgit v1.2.3