From 4eaf88d7d2c519c2170892072e64cad407b3da92 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sun, 24 Apr 2016 22:49:18 -0700 Subject: [PATCH] cmd: remove _twisted suffix from function names No longer necessary now that all commands are twisted-based. --- src/wormhole/cli/cmd_receive.py | 2 +- src/wormhole/cli/cmd_send.py | 2 +- src/wormhole/cli/runner.py | 4 ++-- src/wormhole/test/test_scripts.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wormhole/cli/cmd_receive.py b/src/wormhole/cli/cmd_receive.py index 9ce9373..b2fb894 100644 --- a/src/wormhole/cli/cmd_receive.py +++ b/src/wormhole/cli/cmd_receive.py @@ -13,7 +13,7 @@ class RespondError(Exception): def __init__(self, response): self.response = response -def receive_twisted(args, reactor=reactor): +def receive(args, reactor=reactor): return TwistedReceiver(args, reactor).go() diff --git a/src/wormhole/cli/cmd_send.py b/src/wormhole/cli/cmd_send.py index ced71f6..652a370 100644 --- a/src/wormhole/cli/cmd_send.py +++ b/src/wormhole/cli/cmd_send.py @@ -11,7 +11,7 @@ from ..twisted.transit import TransitSender APPID = u"lothar.com/wormhole/text-or-file-xfer" @inlineCallbacks -def send_twisted(args, reactor=reactor): +def send(args, reactor=reactor): assert isinstance(args.relay_url, type(u"")) if args.zeromode: assert not args.code diff --git a/src/wormhole/cli/runner.py b/src/wormhole/cli/runner.py index 3142452..f2d1bea 100644 --- a/src/wormhole/cli/runner.py +++ b/src/wormhole/cli/runner.py @@ -9,12 +9,12 @@ from .cli_args import parser def dispatch(args): # returns Deferred if args.func == "send/send": from . import cmd_send - return cmd_send.send_twisted(args) + return cmd_send.send(args) if args.func == "receive/receive": _start = args.timing.add_event("import c_r_t") from . import cmd_receive args.timing.finish_event(_start) - return cmd_receive.receive_twisted(args) + return cmd_receive.receive(args) raise ValueError("unknown args.func %s" % args.func) diff --git a/src/wormhole/test/test_scripts.py b/src/wormhole/test/test_scripts.py index 0de287a..7f65de6 100644 --- a/src/wormhole/test/test_scripts.py +++ b/src/wormhole/test/test_scripts.py @@ -326,8 +326,8 @@ class PregeneratedCode(ServerBase, ScriptsBase, unittest.TestCase): rargs.stdout = io.StringIO() rargs.stderr = io.StringIO() rargs.timing = DebugTiming() - send_d = cmd_send.send_twisted(sargs) - receive_d = cmd_receive.receive_twisted(rargs) + send_d = cmd_send.send(sargs) + receive_d = cmd_receive.receive(rargs) # The sender might fail, leaving the receiver hanging, or vice # versa. If either side fails, cancel the other, so it won't