1
0
Fork 0

parse_ports_log.py: python 3 compatibilty

Dieser Commit ist enthalten in:
Ad Schellevis 2020-02-05 19:08:46 +01:00
Ursprung 9f2c1b2c67
Commit fcbc99b41b
1 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -1,12 +1,13 @@
#!/usr/bin/env python2.7
#!/usr/bin/env python3.7
import collections
import argparse
from datetime import datetime
def log_reader(filename):
with open(filename) as f_in:
with open(filename ,'rb') as f_in:
for line in f_in:
line = line.decode()
if len(line) >= 22 and line[0] == '[' and line[15] == ']' and line[1:15].isdigit() \
and line[17:21] == '===>' and line.find(' for ') > -1:
if line.strip().endswith('for building'):