Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-25 02:29:11

0001 #! /usr/bin/env python
0002 #Quick and dirty script to provide the necessary (ordered by timestamp list of logs in the) list.txt file used by the ExtractTrends.C root macro
0003 import os
0004 import time
0005 
0006 ls=os.listdir(os.getcwd())
0007 TimesLogs=[]
0008 for log in ls:
0009     if "DetVOffReaderSummary__FROM" in log:
0010         (start,end)=log[:-4].split("FROM_")[1].split("_TO_")
0011         CurrentTime=time.mktime(time.strptime(start.replace("__","_0"),"%a_%b_%d_%H_%M_%S_%Y"))
0012         TimesLogs.append((CurrentTime,log))
0013 TimesLogs.sort()
0014 listfile=open("list.txt","w")
0015 for log in TimesLogs:
0016     print(log[1])
0017     listfile.write(log[1]+"\n")