mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-07-13 01:20:24 +02:00
change history 'line' to integer
This commit is contained in:
@ -70,7 +70,7 @@ def process(proc_data):
|
||||
|
||||
[
|
||||
{
|
||||
"line": string,
|
||||
"line": integer,
|
||||
"command": string
|
||||
}
|
||||
]
|
||||
@ -84,6 +84,16 @@ def process(proc_data):
|
||||
proc_line['command'] = v
|
||||
processed.append(proc_line)
|
||||
|
||||
for entry in processed:
|
||||
int_list = ['line']
|
||||
for key in int_list:
|
||||
if key in entry:
|
||||
try:
|
||||
key_int = int(entry[key])
|
||||
entry[key] = key_int
|
||||
except (ValueError):
|
||||
entry[key] = None
|
||||
|
||||
return processed
|
||||
|
||||
|
||||
|
2
tests/fixtures/centos-7.7/history.json
vendored
2
tests/fixtures/centos-7.7/history.json
vendored
File diff suppressed because one or more lines are too long
2
tests/fixtures/ubuntu-18.04/history.json
vendored
2
tests/fixtures/ubuntu-18.04/history.json
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user