diff --git a/jc/parsers/foo_s.py b/jc/parsers/foo_s.py index 00a0eefb..88aae251 100644 --- a/jc/parsers/foo_s.py +++ b/jc/parsers/foo_s.py @@ -117,6 +117,10 @@ def parse( streaming_line_input_type_check(line) output_line: Dict = {} + # skip blank lines + if not line.strip(): + continue + # parse the content here # check out helper functions in jc.utils # and jc.parsers.universal diff --git a/jc/parsers/iostat_s.py b/jc/parsers/iostat_s.py index 95850a71..b86e56ed 100644 --- a/jc/parsers/iostat_s.py +++ b/jc/parsers/iostat_s.py @@ -108,7 +108,7 @@ import jc.parsers.universal class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.2' + version = '1.3' description = '`iostat` command streaming parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -196,7 +196,7 @@ def parse(data, raw=False, quiet=False, ignore_exceptions=False): output_line = {} # ignore blank lines and header line - if line == '\n' or line == '' or line.startswith('Linux'): + if not line.strip() or line.startswith('Linux'): continue if line.startswith('avg-cpu:'): diff --git a/jc/parsers/ls_s.py b/jc/parsers/ls_s.py index b768ce76..b000255c 100644 --- a/jc/parsers/ls_s.py +++ b/jc/parsers/ls_s.py @@ -77,7 +77,7 @@ from jc.exceptions import ParseError class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.1' + version = '1.2' description = '`ls` command streaming parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -148,7 +148,7 @@ def parse(data, raw=False, quiet=False, ignore_exceptions=False): continue # skip blank lines - if line.strip() == '': + if not line.strip(): continue # Look for parent line if glob or -R is used diff --git a/jc/parsers/ping_s.py b/jc/parsers/ping_s.py index f9ca0507..e697e737 100644 --- a/jc/parsers/ping_s.py +++ b/jc/parsers/ping_s.py @@ -85,7 +85,7 @@ from jc.exceptions import ParseError class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.1' + version = '1.2' description = '`ping` and `ping6` command streaming parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -492,7 +492,7 @@ def parse(data, raw=False, quiet=False, ignore_exceptions=False): output_line = {} # skip blank lines - if line.strip() == '': + if not line.strip(): continue # skip warning lines diff --git a/jc/parsers/rsync_s.py b/jc/parsers/rsync_s.py index 45d6edf6..07424046 100644 --- a/jc/parsers/rsync_s.py +++ b/jc/parsers/rsync_s.py @@ -88,7 +88,7 @@ from jc.streaming import ( class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.1' + version = '1.2' description = '`rsync` command streaming parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -267,7 +267,7 @@ def parse( output_line: Dict = {} # ignore blank lines - if line == '': + if not line.strip(): continue file_line = file_line_re.match(line) diff --git a/jc/parsers/stat_s.py b/jc/parsers/stat_s.py index 7e3d860f..d74b7a4e 100644 --- a/jc/parsers/stat_s.py +++ b/jc/parsers/stat_s.py @@ -84,7 +84,7 @@ from jc.exceptions import ParseError class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.2' + version = '1.3' description = '`stat` command streaming parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -165,7 +165,7 @@ def parse( line = line.rstrip() # ignore blank lines - if line == '': + if not line.strip(): continue # linux output diff --git a/jc/parsers/vmstat_s.py b/jc/parsers/vmstat_s.py index ca47a9a4..83b83d06 100644 --- a/jc/parsers/vmstat_s.py +++ b/jc/parsers/vmstat_s.py @@ -100,7 +100,7 @@ from jc.exceptions import ParseError class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.1' + version = '1.2' description = '`vmstat` command streaming parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -177,7 +177,7 @@ def parse(data, raw=False, quiet=False, ignore_exceptions=False): output_line = {} # skip blank lines - if line.strip() == '': + if not line.strip(): continue # detect output type