from solar import * def process (filename): with open (filename) as stream: last_ops = None for line in stream: stime, event = line.strip().split() tt = str_to_datetime (stime) if event == "SWA_E_DPU_OPS_STATE": print ("%s DPU OPS state" % isotime (tt)) last_ops = tt if event == "DPU_REBOOT": duration = tt - last_ops print ("%s DPU reboot after %s" % (isotime (tt), str(duration))) if __name__ == "__main__": process ("MIXED.list")