split txwormhole step 2: fix imports

This commit is contained in:
Brian Warner 2016-04-15 17:48:44 -07:00
parent 323175ddfe
commit 1688da74d9
13 changed files with 29 additions and 25 deletions

View File

@ -0,0 +1,2 @@
from wormhole import __version__
__version__ # hush pyflakes

View File

@ -6,7 +6,7 @@ from twisted.protocols import basic
from twisted.web.client import Agent, ResponseDone from twisted.web.client import Agent, ResponseDone
from twisted.web.http_headers import Headers from twisted.web.http_headers import Headers
from cgi import parse_header from cgi import parse_header
from ..util.eventual import eventually from .eventual import eventually
#if sys.version_info[0] == 2: #if sys.version_info[0] == 2:
# to_unicode = unicode # to_unicode = unicode

View File

@ -8,7 +8,7 @@ from twisted.internet.error import ConnectError
from twisted.web import iweb from twisted.web import iweb
import txtorcon import txtorcon
import ipaddr import ipaddr
from ..timing import DebugTiming from wormhole.timing import DebugTiming
from .transit import allocate_tcp_port from .transit import allocate_tcp_port
# based on twisted.web.client._StandardEndpointFactory # based on twisted.web.client._StandardEndpointFactory

View File

@ -13,13 +13,13 @@ from nacl.secret import SecretBox
from nacl.exceptions import CryptoError from nacl.exceptions import CryptoError
from nacl import utils from nacl import utils
from spake2 import SPAKE2_Symmetric from spake2 import SPAKE2_Symmetric
from .eventsource_twisted import ReconnectingEventSource from .eventsource import ReconnectingEventSource
from .. import __version__ from wormhole import __version__
from .. import codes from wormhole import codes
from ..errors import ServerError, Timeout, WrongPasswordError, UsageError from wormhole.errors import ServerError, Timeout, WrongPasswordError, UsageError
from ..timing import DebugTiming from wormhole.timing import DebugTiming
from ..util.hkdf import HKDF from wormhole.util.hkdf import HKDF
from ..channel_monitor import monitor from wormhole.channel_monitor import monitor
CONFMSG_NONCE_LENGTH = 128//8 CONFMSG_NONCE_LENGTH = 128//8
CONFMSG_MAC_LENGTH = 256//8 CONFMSG_MAC_LENGTH = 256//8

View File

@ -8,9 +8,9 @@ from twisted.internet import (reactor, interfaces, defer, protocol,
from twisted.internet.defer import inlineCallbacks, returnValue from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.protocols import policies from twisted.protocols import policies
from nacl.secret import SecretBox from nacl.secret import SecretBox
from ..util.hkdf import HKDF from wormhole.util.hkdf import HKDF
from ..errors import UsageError from wormhole.errors import UsageError
from ..timing import DebugTiming from wormhole.timing import DebugTiming
from . import ipaddrs from . import ipaddrs
def debug(msg): def debug(msg):

View File

@ -2,8 +2,8 @@ from __future__ import print_function
import io, os, sys, json, binascii, six, tempfile, zipfile import io, os, sys, json, binascii, six, tempfile, zipfile
from twisted.internet import reactor, defer from twisted.internet import reactor, defer
from twisted.internet.defer import inlineCallbacks, returnValue from twisted.internet.defer import inlineCallbacks, returnValue
from ..twisted.transcribe import Wormhole, WrongPasswordError from txwormhole.transcribe import Wormhole, WrongPasswordError
from ..twisted.transit import TransitReceiver from txwormhole.transit import TransitReceiver
from ..errors import TransferError from ..errors import TransferError
from .progress import ProgressPrinter from .progress import ProgressPrinter
@ -55,7 +55,7 @@ class TwistedReceiver:
tor_manager = None tor_manager = None
if self.args.tor: if self.args.tor:
_start = self.args.timing.add_event("import TorManager") _start = self.args.timing.add_event("import TorManager")
from ..twisted.tor_manager import TorManager from txwormhole.tor_manager import TorManager
self.args.timing.finish_event(_start) self.args.timing.finish_event(_start)
tor_manager = TorManager(reactor, timing=self.args.timing) tor_manager = TorManager(reactor, timing=self.args.timing)
# For now, block everything until Tor has started. Soon: launch # For now, block everything until Tor has started. Soon: launch

View File

@ -5,8 +5,8 @@ from twisted.internet import reactor, defer
from twisted.internet.defer import inlineCallbacks, returnValue from twisted.internet.defer import inlineCallbacks, returnValue
from ..errors import TransferError from ..errors import TransferError
from .progress import ProgressPrinter from .progress import ProgressPrinter
from ..twisted.transcribe import Wormhole, WrongPasswordError from txwormhole.transcribe import Wormhole, WrongPasswordError
from ..twisted.transit import TransitSender from txwormhole.transit import TransitSender
APPID = u"lothar.com/wormhole/text-or-file-xfer" APPID = u"lothar.com/wormhole/text-or-file-xfer"
@ -130,7 +130,7 @@ def send_twisted(args):
tor_manager = None tor_manager = None
if args.tor: if args.tor:
from ..twisted.tor_manager import TorManager from txwormhole.tor_manager import TorManager
tor_manager = TorManager(reactor, timing=args.timing) tor_manager = TorManager(reactor, timing=args.timing)
# For now, block everything until Tor has started. Soon: launch tor # For now, block everything until Tor has started. Soon: launch tor
# in parallel with everything else, make sure the TorManager can # in parallel with everything else, make sure the TorManager can

View File

@ -1,7 +1,7 @@
from twisted.application import service from twisted.application import service
from twisted.internet import reactor, defer from twisted.internet import reactor, defer
from twisted.python import log from twisted.python import log
from ..twisted.transit import allocate_tcp_port from txwormhole.transit import allocate_tcp_port
from wormhole_server.server import RelayServer from wormhole_server.server import RelayServer
from .. import __version__ from .. import __version__

View File

@ -2,7 +2,7 @@ from __future__ import print_function
from twisted.trial import unittest from twisted.trial import unittest
from twisted.internet.defer import gatherResults from twisted.internet.defer import gatherResults
from twisted.internet.threads import deferToThread from twisted.internet.threads import deferToThread
from ..twisted.transcribe import Wormhole as twisted_Wormhole from txwormhole.transcribe import Wormhole as twisted_Wormhole
from ..blocking.transcribe import Wormhole as blocking_Wormhole from ..blocking.transcribe import Wormhole as blocking_Wormhole
from .common import ServerBase from .common import ServerBase

View File

@ -6,3 +6,5 @@ class Import(unittest.TestCase):
self.assertTrue(len(wormhole.__version__)) self.assertTrue(len(wormhole.__version__))
import wormhole_server import wormhole_server
self.assertTrue(len(wormhole_server.__version__)) self.assertTrue(len(wormhole_server.__version__))
import txwormhole
self.assertTrue(len(txwormhole.__version__))

View File

@ -11,7 +11,7 @@ from twisted.web.client import getPage, Agent, readBody
from .. import __version__ from .. import __version__
from .common import ServerBase from .common import ServerBase
from wormhole_server import relay_server, transit_server from wormhole_server import relay_server, transit_server
from ..twisted.eventsource_twisted import EventSource from txwormhole.eventsource import EventSource
class Reachable(ServerBase, unittest.TestCase): class Reachable(ServerBase, unittest.TestCase):

View File

@ -6,7 +6,7 @@ from twisted.internet import defer, task, endpoints, protocol, address, error
from twisted.internet.defer import gatherResults, inlineCallbacks from twisted.internet.defer import gatherResults, inlineCallbacks
from twisted.python import log, failure from twisted.python import log, failure
from twisted.test import proto_helpers from twisted.test import proto_helpers
from ..twisted import transit from txwormhole import transit
from ..errors import UsageError from ..errors import UsageError
from nacl.secret import SecretBox from nacl.secret import SecretBox
from nacl.exceptions import CryptoError from nacl.exceptions import CryptoError

View File

@ -2,9 +2,9 @@ from __future__ import print_function
import json import json
from twisted.trial import unittest from twisted.trial import unittest
from twisted.internet.defer import gatherResults, succeed from twisted.internet.defer import gatherResults, succeed
from ..twisted.transcribe import (Wormhole, UsageError, ChannelManager, from txwormhole.transcribe import (Wormhole, UsageError, ChannelManager,
WrongPasswordError) WrongPasswordError)
from ..twisted.eventsource_twisted import EventSourceParser from txwormhole.eventsource import EventSourceParser
from .common import ServerBase from .common import ServerBase
APPID = u"appid" APPID = u"appid"