1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-09 01:05:53 +02:00

add support for down in addition to crash

This commit is contained in:
Kelly Brazil
2021-01-05 21:51:30 -08:00
parent f78fe771e1
commit 4fb6f3ea59

View File

@ -194,10 +194,10 @@ def parse(data, raw=False, quiet=False):
if re.match(r'\d\d:\d\d:\d\d \d\d\d\d', ' '.join(linedata[6:8])):
output_line['login'] = ' '.join(linedata[3:8])
if len(linedata) > 9 and linedata[9] != 'crash':
if len(linedata) > 9 and linedata[9] != 'crash' and linedata[9] != 'down':
output_line['logout'] = ' '.join(linedata[9:14])
if len(linedata) > 9 and linedata[9] == 'crash':
if len(linedata) > 9 and (linedata[9] == 'crash' or linedata[9] == 'down'):
output_line['logout'] = linedata[9]
# add more items to the list to line up duration
linedata.insert(10, '-')