Merge branch 'master' into pr296

This commit is contained in:
Brian Warner 2018-06-16 16:09:38 -07:00
commit b5b8cd1260
6 changed files with 68 additions and 13 deletions

6
.gitignore vendored
View File

@ -24,12 +24,6 @@ var/
MANIFEST MANIFEST
.eggs .eggs
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs # Installer logs
pip-log.txt pip-log.txt
pip-delete-this-directory.txt pip-delete-this-directory.txt

View File

@ -141,10 +141,10 @@ optional arguments:
## Code Management ## Code Management
Each wormhole connection is defined by a shared secret "wormhole code". These Each wormhole connection is defined by a shared secret "wormhole code". These
codes can be generated offline (by picking a unique number and some secret codes can be created by humans offline (by picking a unique number and some
words), but are more commonly generated by whoever creates the first secret words), but are more commonly generated by asking the library to make
wormhole. In the "bin/wormhole" file-transfer tool, the default behavior is one. In the "bin/wormhole" file-transfer tool, the default behavior is for
for the sender to create the code, and for the receiver to type it in. the sender's program to create the code, and for the receiver to type it in.
The code is a (unicode) string in the form `NNN-code-words`. The numeric The code is a (unicode) string in the form `NNN-code-words`. The numeric
"NNN" prefix is the "channel id" or "nameplate", and is a short integer "NNN" prefix is the "channel id" or "nameplate", and is a short integer
@ -161,7 +161,7 @@ The Wormhole object has three APIs for generating or accepting a code:
* `w.allocate_code(length=2)`: this contacts the Rendezvous Server, allocates * `w.allocate_code(length=2)`: this contacts the Rendezvous Server, allocates
a short numeric nameplate, chooses a configurable number of random words, a short numeric nameplate, chooses a configurable number of random words,
then assembles them into the code then assembles them into the code
* `w.set_code(code)`: this accepts the code as an argument * `w.set_code(code)`: this accepts the complete code as an argument
* `helper = w.input_code()`: this facilitates interactive entry of the code, * `helper = w.input_code()`: this facilitates interactive entry of the code,
with tab-completion. The helper object has methods to return a list of with tab-completion. The helper object has methods to return a list of
viable completions for whatever portion of the code has been entered so viable completions for whatever portion of the code has been entered so

17
pyi/build-exe Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh
# use pyinstaller to build a single-file "fat binary" called wormhole.exe.
#
# the .exe here does NOT mean a windows executable, but an executable in general.
#
# "fat binary" means it includes the python interpreter, the python source code
# and libs, compiled code parts and externally needed (C/compiled) libraries.
# it does NOT include the (g)libc though as this needs to be provided by the
# target platform and needs to match the kernel there. thus, it is a good idea
# to run the build on an old, but still security-supported linux (or other posix
# OS) to keep the minimum (g)libc requirement low.
pyinstaller --clean --distpath=dist wormhole.exe.spec
# result will be in dist/wormhole.exe

43
pyi/wormhole.exe.spec Normal file
View File

@ -0,0 +1,43 @@
# -*- mode: python -*-
# this pyinstaller spec file is used to build wormhole binaries on posix platforms
import os, sys
# your cwd should be in the same dir as this file, so .. is the project directory:
basepath = os.path.realpath('..')
a = Analysis([os.path.join(basepath, 'src/wormhole/__main__.py'), ],
pathex=[basepath, ],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=None)
pyz = PYZ(a.pure, a.zipped_data, cipher=None)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='wormhole.exe',
debug=False,
strip=False,
upx=True,
console=True)
if False:
# Enable this block to build a directory-based binary instead of
# a packed single file.
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
name='wormhole-dir')

View File

@ -18,6 +18,7 @@ setup(name="magic-wormhole",
version=versioneer.get_version(), version=versioneer.get_version(),
description="Securely transfer data between computers", description="Securely transfer data between computers",
long_description=open('README.md', 'rU').read(), long_description=open('README.md', 'rU').read(),
long_description_content_type='text/markdown',
author="Brian Warner", author="Brian Warner",
author_email="warner-magic-wormhole@lothar.com", author_email="warner-magic-wormhole@lothar.com",
license="MIT", license="MIT",
@ -49,7 +50,7 @@ setup(name="magic-wormhole",
"txtorcon >= 0.19.3", "txtorcon >= 0.19.3",
], ],
extras_require={ extras_require={
':sys_platform=="win32"': ["pypiwin32"], ':sys_platform=="win32"': ["pywin32"],
"dev": ["mock", "tox", "pyflakes", "dev": ["mock", "tox", "pyflakes",
"magic-wormhole-transit-relay==0.1.1", "magic-wormhole-transit-relay==0.1.1",
"magic-wormhole-mailbox-server==0.1.0"], "magic-wormhole-mailbox-server==0.1.0"],

View File

@ -1,4 +1,4 @@
from .cli import cli from wormhole.cli import cli
if __name__ != "__main__": if __name__ != "__main__":
raise ImportError('this module should not be imported') raise ImportError('this module should not be imported')