diff options
Diffstat (limited to 'external')
-rwxr-xr-x | external/dummy.py | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/external/dummy.py b/external/dummy.py deleted file mode 100755 index 2dc47ba..0000000 --- a/external/dummy.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import json - -sys.stderr.write("(python) dummy starting") -sys.stderr.flush() - -if __name__ == "__main__": - username = "" - while True: - line = sys.stdin.readline() - sys.stderr.write("(python) got: {}\n".format(line)) - sys.stderr.flush() - - cmd = json.loads(line) - - reply = { - "_type": "rep_ok", - "_id": cmd["_id"], - } - - if cmd["_type"] == "configure": - username = cmd["data"]["user"] - if cmd["_type"] == "get_user": - reply["user"] = username - - repline = json.dumps(reply) - sys.stderr.write("(python) sending: {}\n".format(repline)) - sys.stderr.flush() - sys.stdout.write(repline + "\n") - sys.stdout.flush() - - if cmd["_type"] == "close": - break - -sys.stderr.write("(python) dummy stopping") -sys.stderr.flush() |