make send/receive text work

This commit is contained in:
Brian Warner 2015-02-11 01:18:31 -08:00
parent 6f055c84b9
commit 882644bfc1
4 changed files with 9 additions and 5 deletions

View File

@ -1,3 +1,4 @@
from __future__ import print_function
import os, sys, json
from binascii import unhexlify
from nacl.secret import SecretBox

View File

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

View File

@ -1,3 +1,4 @@
from __future__ import print_function
import os, sys, json
from binascii import hexlify
from nacl.secret import SecretBox

View File

@ -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,))