From 18eec6e60b86d32b1a6dddbf65648daf47aecb6f Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Wed, 11 Feb 2015 02:09:26 -0800 Subject: [PATCH] send/receive_text: send/show ack message --- bin/receive_text.py | 4 ++-- bin/send_text.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/receive_text.py b/bin/receive_text.py index 85806c4..a374602 100644 --- a/bin/receive_text.py +++ b/bin/receive_text.py @@ -7,8 +7,8 @@ APPID = "lothar.com/wormhole/text-xfer" # we're receiving start = time.time() code = sys.argv[1] -blob = b"{}" -r = Receiver(APPID, blob, code) +data = json.dumps({"message": "ok"}).encode("utf-8") +r = Receiver(APPID, data, code) them_bytes = r.get_data() them_d = json.loads(them_bytes.decode("utf-8")) print(them_d["message"]) diff --git a/bin/send_text.py b/bin/send_text.py index ffdacc5..034c051 100644 --- a/bin/send_text.py +++ b/bin/send_text.py @@ -6,9 +6,9 @@ APPID = "lothar.com/wormhole/text-xfer" # we're sending message = sys.argv[1] -blob = json.dumps({"message": message, +data = json.dumps({"message": message, }).encode("utf-8") -i = Initiator(APPID, blob) +i = Initiator(APPID, data) code = i.get_code() print("Wormhole code is '%s'" % code) print("On the other computer, please run:")