Skip to content

Commit

Permalink
Improve readability of manufacturer_info_field()
Browse files Browse the repository at this point in the history
Fixes issue wireviz#129, but originally suggested in review of wireviz#121.
kvid committed Jul 28, 2020
1 parent 23c17e6 commit be8804c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/wireviz/wv_helper.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit be8804c

Please sign in to comment.