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.
  • Loading branch information
kvid committed Jul 27, 2020
1 parent b9a4783 commit 76d0395
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
Expand Up @@ -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

0 comments on commit 76d0395

Please sign in to comment.