move everything to 'old' directory before merge
This commit is contained in:
11
old/scripts/KiBoM/bomlib/sort.py
Normal file
11
old/scripts/KiBoM/bomlib/sort.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import re
|
||||
|
||||
|
||||
def natural_sort(string):
|
||||
"""
|
||||
Natural sorting function which sorts by numerical value of a string,
|
||||
rather than raw ASCII value.
|
||||
"""
|
||||
return [int(s) if s.isdigit() else s for s in re.split(r'(\d+)', string)]
|
Reference in New Issue
Block a user