mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-17 00:07:37 +02:00
update docstrings for new help functionality
This commit is contained in:
@ -11,6 +11,38 @@ Usage (module):
|
||||
import jc.parsers.crontab_u
|
||||
result = jc.parsers.crontab_u.parse(crontab_u_output)
|
||||
|
||||
Schema:
|
||||
|
||||
{
|
||||
"variables": [
|
||||
"name": string,
|
||||
"value": string
|
||||
],
|
||||
"schedule": [
|
||||
{
|
||||
"occurrence" string,
|
||||
"minute": [
|
||||
string
|
||||
],
|
||||
"hour": [
|
||||
string
|
||||
],
|
||||
"day_of_month": [
|
||||
string
|
||||
],
|
||||
"month": [
|
||||
string
|
||||
],
|
||||
"day_of_week": [
|
||||
string
|
||||
],
|
||||
"occurrence": string,
|
||||
"user": string,
|
||||
"command": string
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Compatibility:
|
||||
|
||||
'linux', 'darwin', 'aix', 'freebsd'
|
||||
@ -132,15 +164,14 @@ Examples:
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
"""
|
||||
import jc.utils
|
||||
import jc.parsers.universal
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.5'
|
||||
"""Provides parser metadata (version, author, etc.)"""
|
||||
version = '1.6'
|
||||
description = '`crontab` file parser with user support'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@ -153,7 +184,7 @@ class info():
|
||||
__version__ = info.version
|
||||
|
||||
|
||||
def process(proc_data):
|
||||
def _process(proc_data):
|
||||
"""
|
||||
Final processing to conform to the schema.
|
||||
|
||||
@ -163,38 +194,7 @@ def process(proc_data):
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Structured data with the following schema:
|
||||
|
||||
{
|
||||
"variables": [
|
||||
"name": string,
|
||||
"value": string
|
||||
],
|
||||
"schedule": [
|
||||
{
|
||||
"occurrence" string,
|
||||
"minute": [
|
||||
string
|
||||
],
|
||||
"hour": [
|
||||
string
|
||||
],
|
||||
"day_of_month": [
|
||||
string
|
||||
],
|
||||
"month": [
|
||||
string
|
||||
],
|
||||
"day_of_week": [
|
||||
string
|
||||
],
|
||||
"occurrence": string,
|
||||
"user": string,
|
||||
"command": string
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Dictionary. Structured data to conform to the schema.
|
||||
"""
|
||||
# put itmes in lists
|
||||
try:
|
||||
@ -279,4 +279,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