Refine path completion somewhat.

Make it match the behaviour of vim and mutt more closely
This commit is contained in:
Aldo Cortesi 2011-07-14 16:54:04 +12:00
parent 1c9e7b982a
commit 7e21ac0eb8
3 changed files with 2 additions and 9 deletions

View File

@ -517,7 +517,6 @@ class ConnectionView(WWrap):
class _PathCompleter:
DEFAULTPATH = "/bin:/usr/bin:/usr/local/bin"
def __init__(self, _testing=False):
"""
_testing: disables reloading of the lookup table to make testing possible.
@ -542,9 +541,6 @@ class _PathCompleter:
if os.path.isdir(path):
files = glob.glob(os.path.join(path, "*"))
prefix = txt
elif os.path.isfile(path):
prefix = os.path.dirname(txt)
files = glob.glob(prefix+"/*")
else:
files = glob.glob(path+"*")
prefix = os.path.dirname(txt)

View File

@ -126,9 +126,10 @@ class uPathCompleter(libpry.AutoTree):
c.reset()
assert c.complete("./completion/a") == "./completion/aaa"
assert c.complete("./completion/a") == "./completion/aab"
c.reset()
assert c.complete("./completion/aaa") == "./completion/aaa"
assert c.complete("./completion/aaa") == "./completion/aab"
assert c.complete("./completion/aaa") == "./completion/aaa"
def test_completion(self):

4
todo
View File

@ -17,12 +17,9 @@ Features:
- Post and URL field parsing and editing.
- We need a built-in graphical editor for these, that knows how to
break fields up and present them for modificatio individually.
- No-proxy mode, for when we want to just replay without serving as a proxy ourselves.
- Upstream proxy support.
- Strings view for binary responses.
- Support HTTP Digest authentication through the stickyauth option. We'll
have to save the server nonce, and recalculate the hashes for each request.
- Chunked encoding support for requests (we already support it for responses).
- Better manipulation of flows in mitmproxy: copying flows, adding
comments.
@ -30,4 +27,3 @@ Features:
Bugs:
- In some circumstances, long URLs in list view are line-broken oddly.
- When a bug in mitmproxy causes a stack trace, we hang on exit.