From 882644bfc142cbda8ed32e27f29d40265c8aa43d Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Wed, 11 Feb 2015 01:18:31 -0800 Subject: [PATCH] make send/receive text work --- bin/receive_file.py | 1 + bin/receive_text.py | 5 +++-- bin/send_file.py | 1 + bin/send_text.py | 7 ++++--- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/bin/receive_file.py b/bin/receive_file.py index 78ebe87..0dc53a1 100644 --- a/bin/receive_file.py +++ b/bin/receive_file.py @@ -1,3 +1,4 @@ +from __future__ import print_function import os, sys, json from binascii import unhexlify from nacl.secret import SecretBox diff --git a/bin/receive_text.py b/bin/receive_text.py index c6e2ac8..c0e75c7 100644 --- a/bin/receive_text.py +++ b/bin/receive_text.py @@ -1,11 +1,12 @@ +from __future__ import print_function import sys, json -from .transcribe import Receiver +from wormhole.transcribe import Receiver APPID = "lothar.com/wormhole/text-xfer" # we're receiving code = sys.argv[1] -blob = b"" +blob = b"{}" r = Receiver(APPID, blob, code) them_bytes = r.get_data() them_d = json.loads(them_bytes.decode("utf-8")) diff --git a/bin/send_file.py b/bin/send_file.py index 7564e0e..1c111ca 100644 --- a/bin/send_file.py +++ b/bin/send_file.py @@ -1,3 +1,4 @@ +from __future__ import print_function import os, sys, json from binascii import hexlify from nacl.secret import SecretBox diff --git a/bin/send_text.py b/bin/send_text.py index a414e1b..ffdacc5 100644 --- a/bin/send_text.py +++ b/bin/send_text.py @@ -1,5 +1,6 @@ +from __future__ import print_function import sys, json -from .transcribe import Initiator +from wormhole.transcribe import Initiator APPID = "lothar.com/wormhole/text-xfer" @@ -11,9 +12,9 @@ i = Initiator(APPID, blob) code = i.get_code() print("Wormhole code is '%s'" % code) print("On the other computer, please run:") -print() +print("") print(" wormhole-receive-text %s" % code) -print() +print("") them_bytes = i.get_data() them_d = json.loads(them_bytes.decode("utf-8")) print("them: %r" % (them_d,))