1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-13 01:20:24 +02:00

update airport_s docs

This commit is contained in:
Kelly Brazil
2021-04-09 19:55:03 -07:00
parent 6a06a39142
commit 7eb31bc7d2
4 changed files with 39 additions and 48 deletions

View File

@ -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)

Binary file not shown.

View File

@ -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)

Binary file not shown.