From 3eec78957802cdbe463367cb6a30020f2eb38320 Mon Sep 17 00:00:00 2001 From: gopiballava Date: Tue, 9 Mar 2021 01:04:29 -0500 Subject: [PATCH] Correctly check for default of None If `show_wirenumbers` is omitted from a cable section, its value will be `None`. In that case, we want to choose a default based on whether this is a bundle or not. If the user did specify `show_wirenumbers`, then its value will be `True` or `False`, and we want to respect that whether it's a bundle or not. --- src/wireviz/DataClasses.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wireviz/DataClasses.py b/src/wireviz/DataClasses.py index fac6ab58..f3bb3430 100644 --- a/src/wireviz/DataClasses.py +++ b/src/wireviz/DataClasses.py @@ -269,7 +269,7 @@ def __post_init__(self) -> None: raise Exception('lists of part data are only supported for bundles') # by default, show wire numbers for cables, hide for bundles - if not self.show_wirenumbers: + if self.show_wirenumbers is None: self.show_wirenumbers = self.category != 'bundle' for i, item in enumerate(self.additional_components):