From 57f228a978b0262925c1c908c21da42bf22e0431 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Sun, 21 Jun 2015 14:05:07 +0200 Subject: format_field: Make value optional, allow bigger indents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johannes Löthberg --- fingerchange.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fingerchange.py b/fingerchange.py index 25f4e93..96e37d9 100644 --- a/fingerchange.py +++ b/fingerchange.py @@ -34,8 +34,11 @@ def format_url(url): return '<{}>'.format(url) -def format_field(key, value): - return ' :: {} {}\n'.format(key, value) +def format_field(key, value=None, indent=1): + if not value: + return '{}:: {}\n'.format(' '*indent, key) + + return '{}:: {} {}\n'.format(' '*indent, key, value) def format_header(header, filler): -- cgit v1.2.3-70-g09d2