mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-17 00:07:37 +02:00
Fix typos (#440)
Found via `codespell -S ./tests/fixtures -L chage,respons,astroid,unx,ist,technik,ans,buildd`
This commit is contained in:
@ -7,7 +7,7 @@ jc - JSON Convert Version string output parser
|
|||||||
|
|
||||||
Best-effort attempt to parse various styles of version numbers. This parser
|
Best-effort attempt to parse various styles of version numbers. This parser
|
||||||
is based off of the version parser included in the CPython distutils
|
is based off of the version parser included in the CPython distutils
|
||||||
libary.
|
library.
|
||||||
|
|
||||||
If the version string conforms to some de facto-standard versioning rules
|
If the version string conforms to some de facto-standard versioning rules
|
||||||
followed by many developers a `strict` key will be present in the output
|
followed by many developers a `strict` key will be present in the output
|
||||||
|
@ -198,7 +198,7 @@ def _process(proc_data):
|
|||||||
|
|
||||||
Dictionary. Structured data to conform to the schema.
|
Dictionary. Structured data to conform to the schema.
|
||||||
"""
|
"""
|
||||||
# put itmes in lists
|
# put items in lists
|
||||||
try:
|
try:
|
||||||
for entry in proc_data['schedule']:
|
for entry in proc_data['schedule']:
|
||||||
entry['minute'] = entry['minute'].split(',')
|
entry['minute'] = entry['minute'].split(',')
|
||||||
|
@ -194,7 +194,7 @@ def _process(proc_data):
|
|||||||
|
|
||||||
Dictionary. Structured data to conform to the schema.
|
Dictionary. Structured data to conform to the schema.
|
||||||
"""
|
"""
|
||||||
# put itmes in lists
|
# put items in lists
|
||||||
try:
|
try:
|
||||||
for entry in proc_data['schedule']:
|
for entry in proc_data['schedule']:
|
||||||
entry['minute'] = entry['minute'].split(',')
|
entry['minute'] = entry['minute'].split(',')
|
||||||
|
@ -160,7 +160,7 @@ def _aix_parse(data):
|
|||||||
|
|
||||||
# AIX mount entries have the remote node as the zeroth element. If the
|
# AIX mount entries have the remote node as the zeroth element. If the
|
||||||
# mount is local, the zeroth element is the filesystem instead. We can
|
# mount is local, the zeroth element is the filesystem instead. We can
|
||||||
# detect this by the lenth of the list. For local mounts, length is 7,
|
# detect this by the length of the list. For local mounts, length is 7,
|
||||||
# and for remote mounts, the length is 8. In the remote case, pop off
|
# and for remote mounts, the length is 8. In the remote case, pop off
|
||||||
# the zeroth element. Then parsed_line has a consistent format.
|
# the zeroth element. Then parsed_line has a consistent format.
|
||||||
if len(parsed_line) == 8:
|
if len(parsed_line) == 8:
|
||||||
|
@ -214,7 +214,7 @@ def parse(data, raw=False, quiet=False):
|
|||||||
|
|
||||||
if jc.utils.has_data(data):
|
if jc.utils.has_data(data):
|
||||||
import jc.parsers.route_windows
|
import jc.parsers.route_windows
|
||||||
if cleandata[0] in jc.parsers.route_windows.SEPERATORS:
|
if cleandata[0] in jc.parsers.route_windows.SEPARATORS:
|
||||||
raw_output = jc.parsers.route_windows.parse(cleandata)
|
raw_output = jc.parsers.route_windows.parse(cleandata)
|
||||||
else:
|
else:
|
||||||
cleandata.pop(0) # Removing "Kernel IP routing table".
|
cleandata.pop(0) # Removing "Kernel IP routing table".
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
import re
|
import re
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
SEPERATORS = (
|
SEPARATORS = (
|
||||||
"===========================================================================",
|
"===========================================================================",
|
||||||
" None"
|
" None"
|
||||||
)
|
)
|
||||||
@ -24,7 +24,7 @@ ROUTE_TYPES = ("Active Routes:", "Persistent Routes:")
|
|||||||
def get_lines_until_seperator(iterator):
|
def get_lines_until_seperator(iterator):
|
||||||
lines = []
|
lines = []
|
||||||
for line in iterator:
|
for line in iterator:
|
||||||
if line in SEPERATORS:
|
if line in SEPARATORS:
|
||||||
break
|
break
|
||||||
lines.append(line)
|
lines.append(line)
|
||||||
return lines
|
return lines
|
||||||
@ -86,7 +86,7 @@ def parse(cleandata: List[str]):
|
|||||||
interfaces = []
|
interfaces = []
|
||||||
for interface_line in data_iterator:
|
for interface_line in data_iterator:
|
||||||
interface_line = interface_line.strip()
|
interface_line = interface_line.strip()
|
||||||
if interface_line in SEPERATORS:
|
if interface_line in SEPARATORS:
|
||||||
break
|
break
|
||||||
|
|
||||||
interface_match = INTERFACE_REGEX.search(interface_line)
|
interface_match = INTERFACE_REGEX.search(interface_line)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Best-effort attempt to parse various styles of version numbers. This parser
|
Best-effort attempt to parse various styles of version numbers. This parser
|
||||||
is based off of the version parser included in the CPython distutils
|
is based off of the version parser included in the CPython distutils
|
||||||
libary.
|
library.
|
||||||
|
|
||||||
If the version string conforms to some de facto-standard versioning rules
|
If the version string conforms to some de facto-standard versioning rules
|
||||||
followed by many developers a `strict` key will be present in the output
|
followed by many developers a `strict` key will be present in the output
|
||||||
|
@ -173,7 +173,7 @@ class MyTests(unittest.TestCase):
|
|||||||
mdadm_examine_json = json.loads(f.read())
|
mdadm_examine_json = json.loads(f.read())
|
||||||
|
|
||||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/mdadm-query-detail.json'), 'r', encoding='utf-8') as f:
|
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/mdadm-query-detail.json'), 'r', encoding='utf-8') as f:
|
||||||
mdadm_query_detial_json = json.loads(f.read())
|
mdadm_query_detail_json = json.loads(f.read())
|
||||||
|
|
||||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/mdadm-query-raid0-ok.json'), 'r', encoding='utf-8') as f:
|
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/mdadm-query-raid0-ok.json'), 'r', encoding='utf-8') as f:
|
||||||
mdadm_query_raid0_ok_json = json.loads(f.read())
|
mdadm_query_raid0_ok_json = json.loads(f.read())
|
||||||
@ -360,7 +360,7 @@ class MyTests(unittest.TestCase):
|
|||||||
"""
|
"""
|
||||||
Test 'mdadm --query --detail'
|
Test 'mdadm --query --detail'
|
||||||
"""
|
"""
|
||||||
self.assertEqual(jc.parsers.mdadm.parse(self.mdadm_query_detail, quiet=True), self.mdadm_query_detial_json)
|
self.assertEqual(jc.parsers.mdadm.parse(self.mdadm_query_detail, quiet=True), self.mdadm_query_detail_json)
|
||||||
|
|
||||||
|
|
||||||
def test_mdadm_query_raid0_ok(self):
|
def test_mdadm_query_raid0_ok(self):
|
||||||
|
Reference in New Issue
Block a user