mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-17 00:07:37 +02:00
doc update
This commit is contained in:
@ -13,6 +13,17 @@ Usage (module):
|
||||
import jc.parsers.wc
|
||||
result = jc.parsers.wc.parse(wc_command_output)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"filename": string,
|
||||
"lines": integer,
|
||||
"words": integer,
|
||||
"characters": integer
|
||||
}
|
||||
]
|
||||
|
||||
Compatibility:
|
||||
|
||||
'linux', 'darwin', 'cygwin', 'aix', 'freebsd'
|
||||
@ -46,7 +57,8 @@ import jc.utils
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.0'
|
||||
"""Provides parser metadata (version, author, etc.)"""
|
||||
version = '1.1'
|
||||
description = '`wc` command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@ -59,7 +71,7 @@ class info():
|
||||
__version__ = info.version
|
||||
|
||||
|
||||
def process(proc_data):
|
||||
def _process(proc_data):
|
||||
"""
|
||||
Final processing to conform to the schema.
|
||||
|
||||
@ -69,16 +81,7 @@ def process(proc_data):
|
||||
|
||||
Returns:
|
||||
|
||||
List of Dictionaries. Structured data with the following schema:
|
||||
|
||||
[
|
||||
{
|
||||
"filename": string,
|
||||
"lines": integer,
|
||||
"words": integer,
|
||||
"characters": integer
|
||||
}
|
||||
]
|
||||
List of Dictionaries. Structured data to conform to the schema.
|
||||
"""
|
||||
|
||||
for entry in proc_data:
|
||||
@ -126,4 +129,4 @@ def parse(data, raw=False, quiet=False):
|
||||
if raw:
|
||||
return raw_output
|
||||
else:
|
||||
return process(raw_output)
|
||||
return _process(raw_output)
|
||||
|
Reference in New Issue
Block a user