mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-19 00:17:51 +02:00
linting
This commit is contained in:
@ -99,6 +99,8 @@ def parse(data, raw=False, quiet=False, ignore_exceptions=False):
|
|||||||
|
|
||||||
for line in data:
|
for line in data:
|
||||||
try:
|
try:
|
||||||
|
output_line = {}
|
||||||
|
|
||||||
#
|
#
|
||||||
# parse the input here
|
# parse the input here
|
||||||
#
|
#
|
||||||
|
@ -195,12 +195,12 @@ def parse(data, raw=False, quiet=False):
|
|||||||
# detect output type
|
# detect output type
|
||||||
if not procs and not disk and line.startswith('procs'):
|
if not procs and not disk and line.startswith('procs'):
|
||||||
procs = True
|
procs = True
|
||||||
tstamp = True if '-timestamp-' in line else False
|
tstamp = '-timestamp-' in line
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if not procs and not disk and line.startswith('disk'):
|
if not procs and not disk and line.startswith('disk'):
|
||||||
disk = True
|
disk = True
|
||||||
tstamp = True if '-timestamp-' in line else False
|
tstamp = '-timestamp-' in line
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
||||||
@ -210,7 +210,7 @@ def parse(data, raw=False, quiet=False):
|
|||||||
tz = line.strip().split()[-1] if tstamp else None
|
tz = line.strip().split()[-1] if tstamp else None
|
||||||
continue
|
continue
|
||||||
|
|
||||||
elif 'swpd' in line and 'free' in line and 'inact' in line and 'active' in line:
|
if 'swpd' in line and 'free' in line and 'inact' in line and 'active' in line:
|
||||||
buff_cache = False
|
buff_cache = False
|
||||||
tz = line.strip().split()[-1] if tstamp else None
|
tz = line.strip().split()[-1] if tstamp else None
|
||||||
continue
|
continue
|
||||||
|
Reference in New Issue
Block a user