Ensure 0%-100% spoolup is sorted properly

This commit is contained in:
DarkPhoenix
2019-12-07 03:07:49 +03:00
parent 0063d2955e
commit 2962ce1945
4 changed files with 19 additions and 3 deletions

13
gui/utils/sorter.py Normal file
View File

@@ -0,0 +1,13 @@
"""
Taken from https://stackoverflow.com/questions/2669059/how-to-sort-alpha-numeric-set-in-python
"""
import re
def _convert(text):
return int(text) if text.isdigit() else text
def smartSort(key):
return [_convert(c) for c in re.split('([0-9]+)', key)]