Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:14:50

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 from __future__ import print_function
0004 import os
0005 import time
0006 
0007 ls=os.listdir(os.getcwd())
0008 TimesLogs=[]
0009 for log in ls:
0010     if "DetVOffReaderSummary__FROM" in log:
0011         (start,end)=log[:-4].split("FROM_")[1].split("_TO_")
0012         CurrentTime=time.mktime(time.strptime(start.replace("__","_0"),"%a_%b_%d_%H_%M_%S_%Y"))
0013         TimesLogs.append((CurrentTime,log))
0014 TimesLogs.sort()
0015 listfile=open("list.txt","w")
0016 for log in TimesLogs:
0017     print(log[1])
0018     listfile.write(log[1]+"\n")