keep order

mainly relevant for increments
This commit is contained in:
Martin Diehl 2020-02-25 11:53:02 +01:00
parent d0b966f9e7
commit 1683e18c1f
1 changed files with 6 additions and 3 deletions

View File

@ -111,10 +111,13 @@ class DADF5():
if action == 'set':
self.selection[what] = valid
elif action == 'add':
self.selection[what] = list(existing.union(valid))
add=existing.union(valid)
add_sorted=sorted(add, key=lambda x: int("".join([i for i in x if i.isdigit()])))
self.selection[what] = add_sorted
elif action == 'del':
self.selection[what] = list(existing.difference_update(valid))
diff=existing.difference(valid)
diff_sorted=sorted(diff, key=lambda x: int("".join([i for i in x if i.isdigit()])))
self.selection[what] = diff_sorted
def __time_to_inc(self,start,end):
selected = []