From 7eb31bc7d290fcd09e53524ebbb11e59110df6a0 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Fri, 9 Apr 2021 19:55:03 -0700 Subject: [PATCH] update airport_s docs --- docs/parsers/airport_s.md | 49 ++++++++++++++------------------------ jc/man/jc.1.gz | Bin 2041 -> 2041 bytes jc/parsers/airport_s.py | 38 ++++++++++++++++------------- man/jc.1.gz | Bin 2041 -> 2041 bytes 4 files changed, 39 insertions(+), 48 deletions(-) diff --git a/docs/parsers/airport_s.md b/docs/parsers/airport_s.md index a36e34d2..7ce6792d 100644 --- a/docs/parsers/airport_s.md +++ b/docs/parsers/airport_s.md @@ -18,6 +18,22 @@ Usage (module): import jc.parsers.airport_s result = jc.parsers.airport_s.parse(airport_s_command_output) +Schema: + + [ + { + "ssid": string, + "bssid": string, + "rssi": integer, + "channel": string, + "ht": boolean, + "cc": string, + "security": [ + string, + ] + } + ] + Examples: $ airport -s | jc --airport-s -p @@ -95,36 +111,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - [ - { - "ssid": string, - "bssid": string, - "rssi": integer, - "channel": string, - "ht": boolean, - "cc": string, - "security": [ - string, - ] - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -146,4 +133,4 @@ Returns: ## Parser Information Compatibility: darwin -Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com) +Version 1.3 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/jc/man/jc.1.gz b/jc/man/jc.1.gz index 99ca2d02a202b90dfd2aa65e59522be4a1f53d7c..333ed4bc2d7184ae0d43bcf6a4d332a19f7019f1 100644 GIT binary patch delta 16 Xcmey#|C66xzMF%?P`Gd-`zLk)FGB@5 delta 16 Xcmey#|C66xzMF&N-n4>^?4Q^HHwy-5 diff --git a/jc/parsers/airport_s.py b/jc/parsers/airport_s.py index a1e5f29b..4158f398 100644 --- a/jc/parsers/airport_s.py +++ b/jc/parsers/airport_s.py @@ -15,6 +15,22 @@ Usage (module): import jc.parsers.airport_s result = jc.parsers.airport_s.parse(airport_s_command_output) +Schema: + + [ + { + "ssid": string, + "bssid": string, + "rssi": integer, + "channel": string, + "ht": boolean, + "cc": string, + "security": [ + string, + ] + } + ] + Examples: $ airport -s | jc --airport-s -p @@ -92,7 +108,8 @@ import jc.parsers.universal class info(): - version = '1.2' + """Provides parser metadata (version, author, etc.)""" + version = '1.3' description = '`airport -s` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -106,7 +123,7 @@ class info(): __version__ = info.version -def process(proc_data): +def _process(proc_data): """ Final processing to conform to the schema. @@ -116,20 +133,7 @@ def process(proc_data): Returns: - List of Dictionaries. Structured data with the following schema: - [ - { - "ssid": string, - "bssid": string, - "rssi": integer, - "channel": string, - "ht": boolean, - "cc": string, - "security": [ - string, - ] - } - ] + List of Dictionaries. Structured data to conform to the schema. """ for entry in proc_data: @@ -189,4 +193,4 @@ def parse(data, raw=False, quiet=False): if raw: return raw_output else: - return process(raw_output) + return _process(raw_output) diff --git a/man/jc.1.gz b/man/jc.1.gz index 99ca2d02a202b90dfd2aa65e59522be4a1f53d7c..333ed4bc2d7184ae0d43bcf6a4d332a19f7019f1 100644 GIT binary patch delta 16 Xcmey#|C66xzMF%?P`Gd-`zLk)FGB@5 delta 16 Xcmey#|C66xzMF&N-n4>^?4Q^HHwy-5