summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2015-06-21 14:05:07 +0200
committerJohannes Löthberg <johannes@kyriasis.com>2015-06-21 14:12:50 +0200
commit57f228a978b0262925c1c908c21da42bf22e0431 (patch)
tree98942d21e2277e92391b6ce68e2b98c00aee88f8
parentcf36a3146baa3ee6fc26fabdb312d62755cf4e4c (diff)
downloadfingerchange-57f228a978b0262925c1c908c21da42bf22e0431.tar.xz
format_field: Make value optional, allow bigger indents
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
-rw-r--r--fingerchange.py7
1 files 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):