From be8804cf75cca6081f79922bdf6b5286a07c7fe7 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 77309e50..37584175 100644 --- a/src/wireviz/wv_helper.py +++ b/src/wireviz/wv_helper.py @@ -123,7 +123,7 @@ def open_file_append(filename): return open(filename, 'a', encoding='UTF-8') 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