diff --git a/src/wormhole/cli/cmd_receive.py b/src/wormhole/cli/cmd_receive.py index 2e0447a..f4c19f9 100644 --- a/src/wormhole/cli/cmd_receive.py +++ b/src/wormhole/cli/cmd_receive.py @@ -4,7 +4,7 @@ from tqdm import tqdm from twisted.internet import reactor from twisted.internet.defer import inlineCallbacks, returnValue from ..wormhole import wormhole -from ..twisted.transit import TransitReceiver +from ..transit import TransitReceiver from ..errors import TransferError APPID = u"lothar.com/wormhole/text-or-file-xfer" diff --git a/src/wormhole/cli/cmd_send.py b/src/wormhole/cli/cmd_send.py index dba5ee0..ff32ed0 100644 --- a/src/wormhole/cli/cmd_send.py +++ b/src/wormhole/cli/cmd_send.py @@ -6,7 +6,7 @@ from twisted.internet import reactor from twisted.internet.defer import inlineCallbacks, returnValue from ..errors import TransferError from ..wormhole import wormhole -from ..twisted.transit import TransitSender +from ..transit import TransitSender APPID = u"lothar.com/wormhole/text-or-file-xfer" diff --git a/src/wormhole/test/common.py b/src/wormhole/test/common.py index 48c0685..b50f776 100644 --- a/src/wormhole/test/common.py +++ b/src/wormhole/test/common.py @@ -1,7 +1,7 @@ from twisted.application import service from twisted.internet import reactor, defer from twisted.python import log -from ..twisted.transit import allocate_tcp_port +from ..transit import allocate_tcp_port from ..server.server import RelayServer from .. import __version__ diff --git a/src/wormhole/test/test_transit_twisted.py b/src/wormhole/test/test_transit_twisted.py index 4d87816..bbc33a8 100644 --- a/src/wormhole/test/test_transit_twisted.py +++ b/src/wormhole/test/test_transit_twisted.py @@ -6,7 +6,7 @@ from twisted.internet import defer, task, endpoints, protocol, address, error from twisted.internet.defer import gatherResults, inlineCallbacks from twisted.python import log, failure from twisted.test import proto_helpers -from ..twisted import transit +from .. import transit from ..errors import UsageError from nacl.secret import SecretBox from nacl.exceptions import CryptoError diff --git a/src/wormhole/twisted/transit.py b/src/wormhole/transit.py similarity index 99% rename from src/wormhole/twisted/transit.py rename to src/wormhole/transit.py index cbc8724..b48ae5d 100644 --- a/src/wormhole/twisted/transit.py +++ b/src/wormhole/transit.py @@ -1,4 +1,4 @@ -from __future__ import print_function +from __future__ import print_function, absolute_import import re, sys, time, socket, collections from binascii import hexlify, unhexlify from zope.interface import implementer @@ -9,9 +9,9 @@ from twisted.internet.defer import inlineCallbacks, returnValue from twisted.protocols import policies from nacl.secret import SecretBox from hkdf import Hkdf -from ..errors import UsageError -from ..timing import DebugTiming -from . import ipaddrs +from .errors import UsageError +from .timing import DebugTiming +from .twisted import ipaddrs def HKDF(skm, outlen, salt=None, CTXinfo=b""): return Hkdf(salt, skm).expand(CTXinfo, outlen) diff --git a/src/wormhole/twisted/tor_manager.py b/src/wormhole/twisted/tor_manager.py index 80a72c1..e6cc3de 100644 --- a/src/wormhole/twisted/tor_manager.py +++ b/src/wormhole/twisted/tor_manager.py @@ -5,7 +5,7 @@ from twisted.internet.error import ConnectError import txtorcon import ipaddr from ..timing import DebugTiming -from .transit import allocate_tcp_port +from ..transit import allocate_tcp_port class TorManager: def __init__(self, reactor, tor_socks_port=None, tor_control_port=9051,