From f25156a6377b89ea34899fb61a94694361a7e511 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sat, 11 Feb 2012 18:23:07 +1300 Subject: Better formatting for headers, help and other key-value displays. We now use proper Columns, rather than laying it out manually. --- libmproxy/console/kveditor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libmproxy/console/kveditor.py') diff --git a/libmproxy/console/kveditor.py b/libmproxy/console/kveditor.py index 7b1aeb6a..2997cf7f 100644 --- a/libmproxy/console/kveditor.py +++ b/libmproxy/console/kveditor.py @@ -87,10 +87,11 @@ class KVItem(common.WWrap): return True +KEY_MAX = 30 class KVWalker(urwid.ListWalker): def __init__(self, lst, editor): self.lst, self.editor = lst, editor - self.maxk = max(len(v[0]) for v in lst) if lst else 20 + self.maxk = min(max(len(v[0]) for v in lst), KEY_MAX) if lst else 20 if self.maxk < 20: self.maxk = 20 self.focus = 0 -- cgit v1.2.3