1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-19 00:17:51 +02:00

fix integer conversion

This commit is contained in:
Kelly Brazil
2021-06-30 14:27:12 -07:00
parent 49267f09ac
commit a452f8252a
4 changed files with 4 additions and 4 deletions

View File

@ -53,7 +53,7 @@ Schema:
Examples: Examples:
$ sfdisk -l | jc --sfdisk -p # sfdisk -l | jc --sfdisk -p
[ [
{ {
"disk": "/dev/sda", "disk": "/dev/sda",
@ -118,7 +118,7 @@ Examples:
} }
] ]
$ sfdisk | jc --sfdisk -p -r # sfdisk | jc --sfdisk -p -r
[ [
{ {
"disk": "/dev/sda", "disk": "/dev/sda",

Binary file not shown.

View File

@ -216,13 +216,13 @@ def _process(proc_data):
for entry in proc_data: for entry in proc_data:
for key in entry: for key in entry:
if key in int_list: if key in int_list:
entry[key] = jc.utils.convert_to_int(entry[key]) entry[key] = jc.utils.convert_to_int(entry[key].replace('-', ''))
if 'partitions' in entry: if 'partitions' in entry:
for tp in entry['partitions']: for tp in entry['partitions']:
for key in tp: for key in tp:
if key in int_list: if key in int_list:
tp[key] = jc.utils.convert_to_int(tp[key]) tp[key] = jc.utils.convert_to_int(tp[key].replace('-', ''))
if key in bool_list: if key in bool_list:
tp[key] = jc.utils.convert_to_bool(tp[key]) tp[key] = jc.utils.convert_to_bool(tp[key])

Binary file not shown.