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

add nodata fix

This commit is contained in:
Kelly Brazil
2020-06-10 16:39:49 -07:00
parent 07b179cd7f
commit bb07d78c78

View File

@ -88,7 +88,7 @@ import jc.parsers.universal
class info(): class info():
version = '1.0' version = '1.1'
description = 'airport -s command parser' description = 'airport -s command parser'
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
@ -170,8 +170,10 @@ def parse(data, raw=False, quiet=False):
if not quiet: if not quiet:
jc.utils.compatibility(__name__, info.compatible) jc.utils.compatibility(__name__, info.compatible)
cleandata = data.splitlines() raw_output = []
cleandata = list(filter(None, data.splitlines()))
if cleandata:
# fix headers # fix headers
cleandata[0] = cleandata[0].lower() cleandata[0] = cleandata[0].lower()
cleandata[0] = cleandata[0].replace('-', '_') cleandata[0] = cleandata[0].replace('-', '_')