start on twisted receive: move old files into new homes

This commit is contained in:
Brian Warner 2016-02-17 19:25:19 -08:00
parent 7f056ca075
commit e6fba34570
3 changed files with 6 additions and 5 deletions

View File

@ -187,7 +187,7 @@ def accept_directory(args, them_d, w):
return 0 return 0
@handle_server_error @handle_server_error
def receive(args): def receive_blocking(args):
# we're receiving text, or a file # we're receiving text, or a file
from ..blocking.transcribe import Wormhole, WrongPasswordError from ..blocking.transcribe import Wormhole, WrongPasswordError
assert isinstance(args.relay_url, type(u"")) assert isinstance(args.relay_url, type(u""))

View File

@ -23,8 +23,8 @@ def dispatch(args):
from . import cmd_send_blocking from . import cmd_send_blocking
return cmd_send_blocking.send_blocking(args) return cmd_send_blocking.send_blocking(args)
if args.func == "receive/receive": if args.func == "receive/receive":
from . import cmd_receive from . import cmd_receive_blocking
return cmd_receive.receive(args) return cmd_receive_blocking.receive_blocking(args)
raise ValueError("unknown args.func %s" % args.func) raise ValueError("unknown args.func %s" % args.func)
def run(args, cwd, stdout, stderr, executable=None): def run(args, cwd, stdout, stderr, executable=None):

View File

@ -7,7 +7,8 @@ from twisted.internet.defer import inlineCallbacks
from twisted.internet.threads import deferToThread from twisted.internet.threads import deferToThread
from .. import __version__ from .. import __version__
from .common import ServerBase from .common import ServerBase
from ..scripts import runner, cmd_send_blocking, cmd_send_twisted, cmd_receive from ..scripts import (runner, cmd_send_blocking, cmd_send_twisted,
cmd_receive_blocking)
from ..scripts.send_common import build_phase1_data from ..scripts.send_common import build_phase1_data
from ..errors import TransferError from ..errors import TransferError
@ -302,7 +303,7 @@ class PregeneratedCode(ServerBase, ScriptsBase, unittest.TestCase):
else: else:
send_d = deferToThread(cmd_send_blocking.send_blocking, sargs) send_d = deferToThread(cmd_send_blocking.send_blocking, sargs)
assert not receiver_twisted # not importable yet assert not receiver_twisted # not importable yet
receive_d = deferToThread(cmd_receive.receive, rargs) receive_d = deferToThread(cmd_receive_blocking.receive_blocking, rargs)
send_rc = yield send_d send_rc = yield send_d
send_stdout = sargs.stdout.getvalue() send_stdout = sargs.stdout.getvalue()