Skip to content

Commit d88f82e

Browse files
committed
More sorting improvements
1 parent 0796125 commit d88f82e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

InteractiveHtmlBom/generate_interactive_bom.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def natural_sort(l):
7272
# sort table by reference prefix, footprint and quantity
7373
def sort_func(row):
7474
qty, _, fp, rf = row
75-
prefix = re.findall('^[A-Z]+', rf[0])[0]
75+
prefix = re.findall('^[A-Z]*', rf[0])[0]
7676
ref_ord = {
7777
"C": 1,
7878
"R": 2,
@@ -83,10 +83,14 @@ def sort_func(row):
8383
"Y": 7,
8484
"X": 8,
8585
"F": 9,
86-
"S": 10,
86+
"SW": 10,
87+
"A": 11,
88+
"HS": 1996,
8789
"CNN": 1997,
8890
"J": 1998,
89-
"P": 1999
91+
"P": 1999,
92+
"NT": 2000,
93+
"MH": 2001,
9094
}.get(prefix, 1000)
9195
return ref_ord, fp, -qty, alphanum_key(rf[0])
9296

0 commit comments

Comments
 (0)