From a363ad4a2665ae558176607cecda89e2953cdc99 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 29 Dec 2014 21:37:12 +0800 Subject: [PATCH] gui: fix periodic schedule sorting --- frontend/artiq_gui.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/artiq_gui.py b/frontend/artiq_gui.py index 5ad88a6a4..422dd3f03 100755 --- a/frontend/artiq_gui.py +++ b/frontend/artiq_gui.py @@ -66,11 +66,14 @@ class PeriodicStoreSyncer: else: del self.periodic_store[i] del self.order[i] + ord_el = (x[0], prid) + j = len(self.order) for i, o in enumerate(self.order): - if o > (x[0], prid): + if o > ord_el: + j = i break - self.periodic_store.insert(i, self._convert(prid, x)) - self.order.insert(i, (x[0], prid)) + self.periodic_store.insert(j, self._convert(prid, x)) + self.order.insert(j, ord_el) def __delitem__(self, key): i = self._find_index(key)