From 8687a772f53ecaf1a20464429060b94bbf660fe7 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Thu, 12 Dec 2019 15:33:34 -0800 Subject: [PATCH] use universal parser --- jc/parsers/lsof.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/jc/parsers/lsof.py b/jc/parsers/lsof.py index 949ba8a6..76e799c1 100644 --- a/jc/parsers/lsof.py +++ b/jc/parsers/lsof.py @@ -92,8 +92,8 @@ Examples: ... ] """ -import string import jc.utils +import jc.parsers.universal def process(proc_data): @@ -165,7 +165,12 @@ def parse(data, raw=False, quiet=False): cleandata = list(filter(None, linedata)) if cleandata: + cleandata[0] = cleandata[0].lower() + cleandata[0] = cleandata[0].replace('/', '_') + raw_output = jc.parsers.universal.sparse_table_parse(cleandata) + + ''' # find column value of last character of each header header_text = cleandata.pop(0).lower() @@ -204,6 +209,7 @@ def parse(data, raw=False, quiet=False): output_line = dict(zip(headers, fixed_line)) raw_output.append(output_line) + ''' if raw: return raw_output