1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-19 00:17:51 +02:00

Improve and standardize empty data check for all parsers

This commit is contained in:
Kelly Brazil
2020-06-14 17:17:40 -07:00
parent 2af61730f0
commit cc0f0971d7
56 changed files with 449 additions and 412 deletions

View File

@ -103,7 +103,7 @@ import jc.utils
class info():
version = '1.0'
version = '1.1'
description = 'who command parser'
author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com'
@ -174,12 +174,12 @@ def parse(data, raw=False, quiet=False):
jc.utils.compatibility(__name__, info.compatible)
raw_output = []
cleandata = data.splitlines()
# Clear any blank lines
cleandata = list(filter(None, cleandata))
cleandata = list(filter(None, data.splitlines()))
if jc.utils.has_data(data):
if cleandata:
for line in cleandata:
output_line = {}
linedata = line.split()