mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-08-08 22:36:48 +02:00
process ps data
This commit is contained in:
@ -67,6 +67,7 @@ $ ps -ef | jc --ps -p
|
||||
"""
|
||||
import jc.utils
|
||||
|
||||
|
||||
def process(proc_data):
|
||||
'''schema:
|
||||
[
|
||||
@ -82,6 +83,16 @@ def process(proc_data):
|
||||
}
|
||||
]
|
||||
'''
|
||||
for entry in proc_data:
|
||||
int_list = ['pid', 'ppid', 'c']
|
||||
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 proc_data
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user