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