send/receive_text: send/show ack message

This commit is contained in:
Brian Warner 2015-02-11 02:09:26 -08:00
parent a67d6365f8
commit 18eec6e60b
2 changed files with 4 additions and 4 deletions

View File

@ -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"])

View File

@ -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:")