Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Original Python script used in parsing log
- def read_log(fname):
- try:
- with open(fname, 'r') as f:
- raw = f.read().splitlines()
- ns = [s.split() for s in raw if 'SOC_NOT_PUSHED' in s]
- ss = [w.split("SYNC_PUSH:")[1].strip() for w in raw if 'SYNC_PUSH:' in w]
- not_pushed = [[s[2]+s[3], int(s[-1]), s[-2]] for s in ns]
- ww = [(int(e.split(' at ')[0]), e.split(' at ')[1].split(' in ')[0], int(e.split(' at ')[1].split(' in ')[1].split(' ms ')[0]), set(e.split(' at ')[1].split(' in ')[1].split(' ms ')[1].split())) for e in ss]
- pushed = [[w[0], w[1], w[2], 1 if 'PA-SOC_POP' in w[3] else 0, 1 if 'CU-SOC_POP' in w[3] else 0] for w in ww]
- return not_pushed, pushed
- except:
- return []
Add Comment
Please, Sign In to add comment