From 3787f8befb3d0ec35a9359d76f86e0db0e5ad2b0 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 19 Aug 2012 13:15:54 +1200 Subject: Add a graphical editor for path components (e -> p shortcut from request view screen). --- libmproxy/console/grideditor.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'libmproxy/console/grideditor.py') diff --git a/libmproxy/console/grideditor.py b/libmproxy/console/grideditor.py index d62cb206..138ca12e 100644 --- a/libmproxy/console/grideditor.py +++ b/libmproxy/console/grideditor.py @@ -95,7 +95,8 @@ class GridRow(common.WWrap): ) fspecs = self.fields[:] - fspecs[0] = ("fixed", self.editor.first_width + 2, fspecs[0]) + if len(self.fields) > 1: + fspecs[0] = ("fixed", self.editor.first_width + 2, fspecs[0]) w = urwid.Columns( fspecs, dividechars = 2 @@ -252,7 +253,7 @@ class GridEditor(common.WWrap): headings = [] for i, h in enumerate(self.headings): c = urwid.Text(h) - if i == 0: + if i == 0 and len(self.headings) > 1: headings.append(("fixed", first_width + 2, c)) else: headings.append(c) @@ -384,3 +385,10 @@ class SetHeadersEditor(GridEditor): return True return False + +class PathEditor(GridEditor): + title = "Editing URL path components" + columns = 1 + headings = ("Component",) + encoding = "ascii" + -- cgit v1.2.3