From 2e7bb1a8f1e94f0f44d14194a10e665f0fcdf02f Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Fri, 15 Apr 2016 17:44:47 -0700 Subject: [PATCH 1/2] split wormhole_cli step 1: move files --- src/{wormhole/scripts => wormhole_cli}/__init__.py | 0 src/{wormhole/scripts => wormhole_cli}/cli_args.py | 0 src/{wormhole/scripts => wormhole_cli}/cmd_receive.py | 0 src/{wormhole/scripts => wormhole_cli}/cmd_send.py | 0 src/{wormhole/scripts => wormhole_cli}/progress.py | 0 src/{wormhole => wormhole_cli}/public_relay.py | 0 src/{wormhole/scripts => wormhole_cli}/runner.py | 0 7 files changed, 0 insertions(+), 0 deletions(-) rename src/{wormhole/scripts => wormhole_cli}/__init__.py (100%) rename src/{wormhole/scripts => wormhole_cli}/cli_args.py (100%) rename src/{wormhole/scripts => wormhole_cli}/cmd_receive.py (100%) rename src/{wormhole/scripts => wormhole_cli}/cmd_send.py (100%) rename src/{wormhole/scripts => wormhole_cli}/progress.py (100%) rename src/{wormhole => wormhole_cli}/public_relay.py (100%) rename src/{wormhole/scripts => wormhole_cli}/runner.py (100%) diff --git a/src/wormhole/scripts/__init__.py b/src/wormhole_cli/__init__.py similarity index 100% rename from src/wormhole/scripts/__init__.py rename to src/wormhole_cli/__init__.py diff --git a/src/wormhole/scripts/cli_args.py b/src/wormhole_cli/cli_args.py similarity index 100% rename from src/wormhole/scripts/cli_args.py rename to src/wormhole_cli/cli_args.py diff --git a/src/wormhole/scripts/cmd_receive.py b/src/wormhole_cli/cmd_receive.py similarity index 100% rename from src/wormhole/scripts/cmd_receive.py rename to src/wormhole_cli/cmd_receive.py diff --git a/src/wormhole/scripts/cmd_send.py b/src/wormhole_cli/cmd_send.py similarity index 100% rename from src/wormhole/scripts/cmd_send.py rename to src/wormhole_cli/cmd_send.py diff --git a/src/wormhole/scripts/progress.py b/src/wormhole_cli/progress.py similarity index 100% rename from src/wormhole/scripts/progress.py rename to src/wormhole_cli/progress.py diff --git a/src/wormhole/public_relay.py b/src/wormhole_cli/public_relay.py similarity index 100% rename from src/wormhole/public_relay.py rename to src/wormhole_cli/public_relay.py diff --git a/src/wormhole/scripts/runner.py b/src/wormhole_cli/runner.py similarity index 100% rename from src/wormhole/scripts/runner.py rename to src/wormhole_cli/runner.py From 36e63e23479cc193d425cfa9b2061c5601c7da4d Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Fri, 15 Apr 2016 17:57:11 -0700 Subject: [PATCH 2/2] split wormhole_cli step 2: fix imports, setup.py --- setup.py | 5 +++-- src/wormhole/test/test_load.py | 2 ++ src/wormhole/test/test_progress.py | 2 +- src/wormhole/test/test_scripts.py | 4 ++-- src/wormhole_cli/__init__.py | 2 ++ src/wormhole_cli/cli_args.py | 4 ++-- src/wormhole_cli/cmd_receive.py | 2 +- src/wormhole_cli/cmd_send.py | 2 +- src/wormhole_cli/runner.py | 4 ++-- 9 files changed, 16 insertions(+), 11 deletions(-) diff --git a/setup.py b/setup.py index 286d283..9124ef9 100644 --- a/setup.py +++ b/setup.py @@ -16,11 +16,12 @@ setup(name="magic-wormhole", packages=["wormhole", "wormhole.blocking", "txwormhole", - "wormhole.scripts", "wormhole.test", "wormhole.util", + "wormhole_cli", + "wormhole.test", "wormhole.util", "wormhole_server"], package_data={"wormhole_server": ["db-schemas/*.sql"]}, entry_points={"console_scripts": - ["wormhole = wormhole.scripts.runner:entry", + ["wormhole = wormhole_cli.runner:entry", "wormhole-server = wormhole_server.runner:entry", ]}, install_requires=["spake2==0.3", "pynacl", "requests", "argparse", diff --git a/src/wormhole/test/test_load.py b/src/wormhole/test/test_load.py index d56160a..6902a3a 100644 --- a/src/wormhole/test/test_load.py +++ b/src/wormhole/test/test_load.py @@ -8,3 +8,5 @@ class Import(unittest.TestCase): self.assertTrue(len(wormhole_server.__version__)) import txwormhole self.assertTrue(len(txwormhole.__version__)) + import wormhole_cli + self.assertTrue(len(wormhole_cli.__version__)) diff --git a/src/wormhole/test/test_progress.py b/src/wormhole/test/test_progress.py index 879f93f..511c173 100644 --- a/src/wormhole/test/test_progress.py +++ b/src/wormhole/test/test_progress.py @@ -1,7 +1,7 @@ from __future__ import print_function import io, time from twisted.trial import unittest -from ..scripts import progress +from wormhole_cli import progress class Progress(unittest.TestCase): def test_time(self): diff --git a/src/wormhole/test/test_scripts.py b/src/wormhole/test/test_scripts.py index e5c0847..89bf214 100644 --- a/src/wormhole/test/test_scripts.py +++ b/src/wormhole/test/test_scripts.py @@ -6,8 +6,8 @@ from twisted.internet.utils import getProcessOutputAndValue from twisted.internet.defer import inlineCallbacks from .. import __version__ from .common import ServerBase -from ..scripts import runner, cmd_send, cmd_receive -from ..scripts.cmd_send import build_phase1_data +from wormhole_cli import runner, cmd_send, cmd_receive +from wormhole_cli.cmd_send import build_phase1_data from ..errors import TransferError from ..timing import DebugTiming diff --git a/src/wormhole_cli/__init__.py b/src/wormhole_cli/__init__.py index e69de29..0ff5129 100644 --- a/src/wormhole_cli/__init__.py +++ b/src/wormhole_cli/__init__.py @@ -0,0 +1,2 @@ +from wormhole import __version__ +__version__ # hush pyflakes diff --git a/src/wormhole_cli/cli_args.py b/src/wormhole_cli/cli_args.py index c650768..cd22452 100644 --- a/src/wormhole_cli/cli_args.py +++ b/src/wormhole_cli/cli_args.py @@ -1,7 +1,7 @@ import argparse from textwrap import dedent -from .. import public_relay -from .. import __version__ +from . import public_relay +from wormhole import __version__ parser = argparse.ArgumentParser( usage="wormhole SUBCOMMAND (subcommand-options)", diff --git a/src/wormhole_cli/cmd_receive.py b/src/wormhole_cli/cmd_receive.py index d016e34..1e0e1bc 100644 --- a/src/wormhole_cli/cmd_receive.py +++ b/src/wormhole_cli/cmd_receive.py @@ -4,7 +4,7 @@ from twisted.internet import reactor, defer from twisted.internet.defer import inlineCallbacks, returnValue from txwormhole.transcribe import Wormhole, WrongPasswordError from txwormhole.transit import TransitReceiver -from ..errors import TransferError +from wormhole.errors import TransferError from .progress import ProgressPrinter diff --git a/src/wormhole_cli/cmd_send.py b/src/wormhole_cli/cmd_send.py index d8e9524..dc93ecd 100644 --- a/src/wormhole_cli/cmd_send.py +++ b/src/wormhole_cli/cmd_send.py @@ -3,7 +3,7 @@ import os, sys, io, json, binascii, six, tempfile, zipfile from twisted.protocols import basic from twisted.internet import reactor, defer from twisted.internet.defer import inlineCallbacks, returnValue -from ..errors import TransferError +from wormhole.errors import TransferError from .progress import ProgressPrinter from txwormhole.transcribe import Wormhole, WrongPasswordError from txwormhole.transit import TransitSender diff --git a/src/wormhole_cli/runner.py b/src/wormhole_cli/runner.py index b4fbd3f..e15b37e 100644 --- a/src/wormhole_cli/runner.py +++ b/src/wormhole_cli/runner.py @@ -1,7 +1,7 @@ from __future__ import print_function import os, sys -from ..errors import TransferError -from ..timing import DebugTiming +from wormhole.errors import TransferError +from wormhole.timing import DebugTiming from .cli_args import parser def dispatch(args):