Commit Graph

16 Commits

Author SHA1 Message Date
laharah
64f7348d05 u"" cleanup on util.py and codes.py 2016-06-04 14:09:19 -07:00
laharah
6a73d50fdd added unicode_literals import to all apropriate modules
bug in twisted serverFromString prevents test.common and transit
from using unicode properly should revisit if twisted gets patched
2016-06-04 12:42:59 -07:00
Brian Warner
7c15cf7353 code input: don't eat "b" under GNU readline
GNU libreadline, and the libedit-based library shipped on stock OS-X
python, require different key-binding syntaxes to enable tab completion.
The previous commit to fix this (0977ef0) added both binding commands
Unfortunately when GNU libreadline is given the libedit-style
command (i.e. "bind ^I rl_complete"), it binds the letter "b" to a
non-existent command "ind", or something, and as a result the letter "b"
doesn't work anymore.

This patch uses the readline docstring to sense which flavor is
installed, and only runs the one binding command that's appropriate.

refs #37
2016-06-04 00:52:27 -07:00
Brian Warner
0977ef02c4 do tab-completion on OS-X stock python too (libedit)
Apple's stock python doesn't use GNU libreadline, instead it uses BSD
libedit with a readline compatibility interface. The syntax to enable
tab completion is different for libedit. By including both bindings,
autocomplete should work on both flavors.

Closes #37. Thanks to @wsanchez for the catch and the fix.
2016-06-02 20:55:02 -07:00
Brian Warner
1198977e06 SCHEMA CHANGE: channelids are now strs, not ints
This will enable the use of large randomly-generated hex or base32
channelids, for post-startup or resumed-connection channels.
2016-05-13 00:37:53 -07:00
Brian Warner
14dcfeed73 tolerate lack of readline at runtime
'readline' is part of the python stdlib, so declaring a dependency on it
doesn't help. It doesn't exist on windows, and the pypi 'readline'
module doesn't work on windows. So instead, just attempt to import
readline, and if that fails, fall back to a non-completion flavor.
2016-02-27 14:16:58 -08:00
Brian Warner
6956f35e9a receive: fetch channel list before completion, to get welcome message 2015-11-15 10:53:13 -08:00
Brian Warner
6e8a1d8adb codes.py: fix input-with-completion on py3
The input() function returns str(bytes) on py2, and str(unicode) on py3.
We want unicode in both cases.
2015-10-06 20:04:56 -07:00
Brian Warner
35768d6738 wormhole/invitation code is now unicode 2015-10-06 19:42:10 -07:00
Brian Warner
8fe41e135d make blocking/send-text work on py3, add dependency on 'six'
* use modern/portable "next(iter)" instead of "iter.next()"
* use six.moves.input() instead of raw_input()
* tell requests' Response.iter_lines that we want str, not bytes
2015-09-28 00:24:36 -07:00
Brian Warner
af1e3c51ec add --code-length, to configure the size of the PAKE code (in bytes/words) 2015-03-23 23:53:28 -07:00
Brian Warner
12414fd8be code-completer: re-fetch channelids upon TAB, if necessary
This fixes the situation where you start the receiver first, then start
the sender, then you hit TAB on the receiver.

This somewhat improves the situation where you start the receiver first,
hit TAB (getting nothing), then start the sender, then hit TAB on the
receiver again. The second TAB will list the channel-ids, but won't
insert the only one as it's supposed to. You must type something (which
you can erase) and then hit TAB again to get a unique channel-id
inserted. But at least you can tell which one to type.

The first TAB runs the completer with readline.get_completion_type()
equal to 9=TAB=try-to-insert. The second (and subsequent) TABs use
63=?=list-matches, and it won't go back to 9 until you type something.
2015-03-13 01:50:21 -07:00
Brian Warner
e2e2206159 use completing-input for wormhole code read, not sys.argv 2015-02-14 17:48:38 -08:00
Brian Warner
e10cd515fe import the PGP wordlist (2*256), use 16-bit codes 2015-02-13 23:37:05 -08:00
Brian Warner
c690e8101c transcribe.Initiator: mostly complete 2015-02-10 21:08:26 -08:00
Brian Warner
f5a0b3e5c6 fill in initiator flow, define relay API 2015-02-10 18:34:13 -08:00