make send/receive text work
This commit is contained in:
parent
6f055c84b9
commit
882644bfc1
|
@ -1,3 +1,4 @@
|
||||||
|
from __future__ import print_function
|
||||||
import os, sys, json
|
import os, sys, json
|
||||||
from binascii import unhexlify
|
from binascii import unhexlify
|
||||||
from nacl.secret import SecretBox
|
from nacl.secret import SecretBox
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
|
from __future__ import print_function
|
||||||
import sys, json
|
import sys, json
|
||||||
from .transcribe import Receiver
|
from wormhole.transcribe import Receiver
|
||||||
|
|
||||||
APPID = "lothar.com/wormhole/text-xfer"
|
APPID = "lothar.com/wormhole/text-xfer"
|
||||||
|
|
||||||
# we're receiving
|
# we're receiving
|
||||||
code = sys.argv[1]
|
code = sys.argv[1]
|
||||||
blob = b""
|
blob = b"{}"
|
||||||
r = Receiver(APPID, blob, code)
|
r = Receiver(APPID, blob, code)
|
||||||
them_bytes = r.get_data()
|
them_bytes = r.get_data()
|
||||||
them_d = json.loads(them_bytes.decode("utf-8"))
|
them_d = json.loads(them_bytes.decode("utf-8"))
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
from __future__ import print_function
|
||||||
import os, sys, json
|
import os, sys, json
|
||||||
from binascii import hexlify
|
from binascii import hexlify
|
||||||
from nacl.secret import SecretBox
|
from nacl.secret import SecretBox
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
from __future__ import print_function
|
||||||
import sys, json
|
import sys, json
|
||||||
from .transcribe import Initiator
|
from wormhole.transcribe import Initiator
|
||||||
|
|
||||||
APPID = "lothar.com/wormhole/text-xfer"
|
APPID = "lothar.com/wormhole/text-xfer"
|
||||||
|
|
||||||
|
@ -11,9 +12,9 @@ i = Initiator(APPID, blob)
|
||||||
code = i.get_code()
|
code = i.get_code()
|
||||||
print("Wormhole code is '%s'" % code)
|
print("Wormhole code is '%s'" % code)
|
||||||
print("On the other computer, please run:")
|
print("On the other computer, please run:")
|
||||||
print()
|
print("")
|
||||||
print(" wormhole-receive-text %s" % code)
|
print(" wormhole-receive-text %s" % code)
|
||||||
print()
|
print("")
|
||||||
them_bytes = i.get_data()
|
them_bytes = i.get_data()
|
||||||
them_d = json.loads(them_bytes.decode("utf-8"))
|
them_d = json.loads(them_bytes.decode("utf-8"))
|
||||||
print("them: %r" % (them_d,))
|
print("them: %r" % (them_d,))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user