CLI: avoid importing anything until command is actually run
In prep for moving the server launch command into the main CLI path, without imposing dependency on pynacl/etc.
This commit is contained in:
parent
beb9e240d4
commit
cf592d0766
|
@ -1,13 +1,14 @@
|
|||
from __future__ import print_function
|
||||
import sys, os, json, binascii
|
||||
from wormhole.blocking.transcribe import Receiver, WrongPasswordError
|
||||
from wormhole.blocking.transit import TransitReceiver, TransitError
|
||||
from .progress import start_progress, update_progress, finish_progress
|
||||
|
||||
APPID = "lothar.com/wormhole/file-xfer"
|
||||
|
||||
def receive_file(args):
|
||||
# we're receiving
|
||||
import sys, os, json, binascii
|
||||
from wormhole.blocking.transcribe import Receiver, WrongPasswordError
|
||||
from wormhole.blocking.transit import TransitReceiver, TransitError
|
||||
from .progress import start_progress, update_progress, finish_progress
|
||||
|
||||
transit_receiver = TransitReceiver(args.transit_helper)
|
||||
|
||||
r = Receiver(APPID, args.relay_url)
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
from __future__ import print_function
|
||||
import sys, json, binascii
|
||||
from wormhole.blocking.transcribe import Receiver, WrongPasswordError
|
||||
|
||||
APPID = "lothar.com/wormhole/text-xfer"
|
||||
|
||||
def receive_text(args):
|
||||
# we're receiving
|
||||
import sys, json, binascii
|
||||
from wormhole.blocking.transcribe import Receiver, WrongPasswordError
|
||||
|
||||
r = Receiver(APPID, args.relay_url)
|
||||
code = args.code
|
||||
if not code:
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
from __future__ import print_function
|
||||
import os, sys, json, binascii
|
||||
from wormhole.blocking.transcribe import Initiator, WrongPasswordError
|
||||
from wormhole.blocking.transit import TransitSender
|
||||
from .progress import start_progress, update_progress, finish_progress
|
||||
|
||||
APPID = "lothar.com/wormhole/file-xfer"
|
||||
|
||||
def send_file(args):
|
||||
# we're sending
|
||||
import os, sys, json, binascii
|
||||
from wormhole.blocking.transcribe import Initiator, WrongPasswordError
|
||||
from wormhole.blocking.transit import TransitSender
|
||||
from .progress import start_progress, update_progress, finish_progress
|
||||
|
||||
filename = args.filename
|
||||
assert os.path.isfile(filename)
|
||||
transit_sender = TransitSender(args.transit_helper)
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
from __future__ import print_function
|
||||
import sys, json, binascii
|
||||
from wormhole.blocking.transcribe import Initiator, WrongPasswordError
|
||||
|
||||
APPID = "lothar.com/wormhole/text-xfer"
|
||||
|
||||
def send_text(args):
|
||||
# we're sending
|
||||
import sys, json, binascii
|
||||
from wormhole.blocking.transcribe import Initiator, WrongPasswordError
|
||||
|
||||
i = Initiator(APPID, args.relay_url)
|
||||
code = i.get_code(args.code_length)
|
||||
print("On the other computer, please run: wormhole receive-text")
|
||||
|
|
Loading…
Reference in New Issue
Block a user