mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-07-15 01:24:29 +02:00
update airport_s docs
This commit is contained in:
@ -18,6 +18,22 @@ Usage (module):
|
|||||||
import jc.parsers.airport_s
|
import jc.parsers.airport_s
|
||||||
result = jc.parsers.airport_s.parse(airport_s_command_output)
|
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:
|
Examples:
|
||||||
|
|
||||||
$ airport -s | jc --airport-s -p
|
$ airport -s | jc --airport-s -p
|
||||||
@ -95,36 +111,7 @@ Examples:
|
|||||||
```python
|
```python
|
||||||
info()
|
info()
|
||||||
```
|
```
|
||||||
|
Provides parser metadata (version, author, etc.)
|
||||||
|
|
||||||
## 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,
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
## parse
|
## parse
|
||||||
```python
|
```python
|
||||||
@ -146,4 +133,4 @@ Returns:
|
|||||||
## Parser Information
|
## Parser Information
|
||||||
Compatibility: darwin
|
Compatibility: darwin
|
||||||
|
|
||||||
Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
Version 1.3 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||||
|
BIN
jc/man/jc.1.gz
BIN
jc/man/jc.1.gz
Binary file not shown.
@ -15,6 +15,22 @@ Usage (module):
|
|||||||
import jc.parsers.airport_s
|
import jc.parsers.airport_s
|
||||||
result = jc.parsers.airport_s.parse(airport_s_command_output)
|
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:
|
Examples:
|
||||||
|
|
||||||
$ airport -s | jc --airport-s -p
|
$ airport -s | jc --airport-s -p
|
||||||
@ -92,7 +108,8 @@ import jc.parsers.universal
|
|||||||
|
|
||||||
|
|
||||||
class info():
|
class info():
|
||||||
version = '1.2'
|
"""Provides parser metadata (version, author, etc.)"""
|
||||||
|
version = '1.3'
|
||||||
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'
|
||||||
@ -106,7 +123,7 @@ class info():
|
|||||||
__version__ = info.version
|
__version__ = info.version
|
||||||
|
|
||||||
|
|
||||||
def process(proc_data):
|
def _process(proc_data):
|
||||||
"""
|
"""
|
||||||
Final processing to conform to the schema.
|
Final processing to conform to the schema.
|
||||||
|
|
||||||
@ -116,20 +133,7 @@ def process(proc_data):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
List of Dictionaries. Structured data with the following schema:
|
List of Dictionaries. Structured data to conform to the schema.
|
||||||
[
|
|
||||||
{
|
|
||||||
"ssid": string,
|
|
||||||
"bssid": string,
|
|
||||||
"rssi": integer,
|
|
||||||
"channel": string,
|
|
||||||
"ht": boolean,
|
|
||||||
"cc": string,
|
|
||||||
"security": [
|
|
||||||
string,
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
"""
|
"""
|
||||||
for entry in proc_data:
|
for entry in proc_data:
|
||||||
|
|
||||||
@ -189,4 +193,4 @@ def parse(data, raw=False, quiet=False):
|
|||||||
if raw:
|
if raw:
|
||||||
return raw_output
|
return raw_output
|
||||||
else:
|
else:
|
||||||
return process(raw_output)
|
return _process(raw_output)
|
||||||
|
BIN
man/jc.1.gz
BIN
man/jc.1.gz
Binary file not shown.
Reference in New Issue
Block a user