hildogjr / KiCost

Build cost spreadsheet for a KiCad project.
MIT License
494 stars 97 forks source link

No support for non-numeric references #489

Closed set-soft closed 3 years ago

set-soft commented 3 years ago

A reference like the one described in the code: TEST+SUPPLY is not supported.

KiCost crashes with:

               File ".../kicost/edas/tools.py", line 695, in order_refs
                 prefix_nums[prefix] = convert_to_ranges(prefix_nums[prefix])
               File ".../kicost/edas/tools.py", line 644, in convert_to_ranges
                 nums.sort(key=get_refnum)  # Sort all the numbers.
               File ".../kicost/edas/tools.py", line 636, in get_refnum
                 return int(re.match(r'\d+', refnum).group(0))
             AttributeError: 'NoneType' object has no attribute 'group'
set-soft commented 3 years ago

I added a test case in 49d876217c1f9decb6bb6c2424e9e0835134b3e8