python: Return copy of netclasses not reference
Fix Board.GetAllNetClasses() so it no longer creates a duplicate of the Default netclass in the design rules net classes list. Fixes: lp:1803623 * https://bugs.launchpad.net/kicad/+bug/1803623
This commit is contained in:
parent
3d8d852990
commit
44734dc059
|
@ -173,11 +173,10 @@ HANDLE_EXCEPTIONS(BOARD::TracksInNetBetweenPoints)
|
||||||
GetNetClasses(BOARD self) -> { wxString net_class_name : NETCLASSPTR }
|
GetNetClasses(BOARD self) -> { wxString net_class_name : NETCLASSPTR }
|
||||||
Include the "Default" netclass also.
|
Include the "Default" netclass also.
|
||||||
"""
|
"""
|
||||||
netclassmap = self.GetNetClasses().NetClasses()
|
|
||||||
|
|
||||||
# Add the Default one too, but this is probably modifying the NETCLASS_MAP
|
# Copy the NETCLASS_MAP so the one in the BOARD isn't modified
|
||||||
# in the BOARD. If that causes trouble, could make a deepcopy() here first.
|
# when we add the Default net class.
|
||||||
# netclassmap = deepcopy(netclassmap)
|
netclassmap = {k:v for k,v in self.GetNetClasses().NetClasses().items()}
|
||||||
netclassmap['Default'] = self.GetNetClasses().GetDefault()
|
netclassmap['Default'] = self.GetNetClasses().GetDefault()
|
||||||
return netclassmap
|
return netclassmap
|
||||||
%}
|
%}
|
||||||
|
|
Loading…
Reference in New Issue