From 76d0395f58525b2c0f588c1937795c76f10a93ba Mon Sep 17 00:00:00 2001 From: KV Date: Mon, 27 Jul 2020 03:13:35 +0200 Subject: [PATCH] Improve readability of manufacturer_info_field() Fixes issue #129, but originally suggested in review of #121. --- src/wireviz/wv_helper.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wireviz/wv_helper.py b/src/wireviz/wv_helper.py index 13b660c9..72c14514 100644 --- a/src/wireviz/wv_helper.py +++ b/src/wireviz/wv_helper.py @@ -121,7 +121,7 @@ def open_file_write(filename): def manufacturer_info_field(manufacturer, mpn): - if manufacturer or mpn: - return f'{manufacturer if manufacturer else "MPN"}{": " + str(mpn) if mpn else ""}' + if manufacturer: + return f'{manufacturer}: {mpn}' if mpn else manufacturer else: - return None + return f'MPN: {mpn}' if mpn else None