edouard@3924: edouard@3924: edouard@3924: edouard@3924: edouard@3924: edouard@3924: edouard@3924: edouard@3924: edouard@3924: edouard@3924: 0 and extra[0] != "": edouard@3924: fAlarms = [alrm for alrm in Alarms if alrm[1].find(extra[0])!=-1] edouard@3924: else: edouard@3924: fAlarms = Alarms[:] edouard@3924: fAlarms.reverse() edouard@3924: new_range = len(fAlarms) edouard@3924: delta = new_range - visible edouard@3924: new_position = 0 if delta <= 0 else delta if old_position > delta else old_position edouard@3924: new_visible = new_range if delta <= 0 else visible edouard@3924: edouard@3924: visible_alarms = [] edouard@3924: for ts, text, status, alarmid in fAlarms[new_position:new_position + new_visible]: edouard@3924: visible_alarms.append({ edouard@3924: "time": time.ctime(ts), edouard@3924: "text": text, # TODO translate text edouard@3924: "status": status, edouard@3924: "alarmid": alarmid edouard@3924: }) edouard@3924: edouard@3924: return new_range, new_position, visible_alarms edouard@3924: edouard@3924: edouard@3924: ]]> edouard@3924: edouard@3924: edouard@3924: edouard@3924: edouard@3924: edouard@3924: edouard@3924: edouard@3924: edouard@3924: edouard@3924: edouard@3924: edouard@3924: edouard@3924: edouard@3924: