Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated netlist_reader.py to use the natsort library for sorting. #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion kibom/netlist_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import sys
import os.path
import xml.sax as sax
from natsort import natsorted

from .component import Component, ComponentGroup
from .preferences import BomPref
Expand Down Expand Up @@ -358,7 +359,7 @@ def groupComponents(self, components):

# Sort the groups
# First priority is the Type of component (e.g. R?, U?, L?)
groups = sorted(groups, key=lambda g: [g.components[0].getPrefix(), g.components[0].getValueSort()])
groups = natsorted(groups, key=lambda g: [g.components[0].getRef(), g.components[0].getValueSort()])

return groups

Expand Down