/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Mdc/DedxCalibAlg/DedxCalibAlg-00-01-15/share/sub/showlog.py

Go to the documentation of this file.
00001 #!/bes/besd09/zhuk/local/bin/python3.1
00002 #!/usr/bin/python
00003 # this program is used to add the all raw events in the dir you mentioned
00004 import os, string, sys, math, time
00005 if(len(sys.argv)<2):
00006     print("example: showlog.py 20110903 \"all event\"")
00007     sys.exit()
00008 else:
00009     pathname = str(sys.argv[1])
00010     patten = str(sys.argv[2])
00011 #print(pathname)
00012 #print(patten)
00013 pathlist = os.listdir("./")
00014 #print(pathlist)
00015 total = 0
00016 err = 0
00017 errfilelist = ""
00018 for curp in pathlist:
00019     if(pathname in curp):
00020         print("\n path: ", curp, "======================")
00021         os.chdir(curp)
00022         filelist = os.listdir("./")
00023         for file in filelist:
00024             if("log" in file):
00025                 #print("file: ", file)
00026                 input = open(file,"r")
00027                 for line in input:
00028                     if(patten in line):
00029                         total = total + int(line.split(": ")[-1])
00030                         print("\n")
00031                         print(file)
00032                         print(int(line.split(": ")[-1]))
00033                         print(total)
00034         for file in filelist:
00035             if("err" in file):
00036                 input = open(file,"r")
00037                 for line in input:
00038                     if("segmentation violation" in line):
00039                         errfilelist = errfilelist + file + " \n "
00040                         err += 1
00041         os.chdir("../")
00042 
00043 print("\n\n","err file list:\n", errfilelist)
00044 print("num of err: " , err)

Generated on Tue Nov 29 23:12:45 2016 for BOSS_7.0.2 by  doxygen 1.4.7