From 7e21ac0eb8c584527761b84af99974dd74f5c263 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Thu, 14 Jul 2011 16:54:04 +1200 Subject: [PATCH] Refine path completion somewhat. Make it match the behaviour of vim and mutt more closely --- libmproxy/console.py | 4 ---- test/test_console.py | 3 ++- todo | 4 ---- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/libmproxy/console.py b/libmproxy/console.py index ffe37fc31..e4d3057de 100644 --- a/libmproxy/console.py +++ b/libmproxy/console.py @@ -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) diff --git a/test/test_console.py b/test/test_console.py index 15a2d299b..6040763a3 100644 --- a/test/test_console.py +++ b/test/test_console.py @@ -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): diff --git a/todo b/todo index 2a69291a7..d8b122f91 100644 --- a/todo +++ b/todo @@ -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.