mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-12-24 00:31:11 +02:00
use jc.utils for conversions
This commit is contained in:
@@ -133,7 +133,7 @@ import jc.utils
|
||||
|
||||
class info():
|
||||
"""Provides parser metadata (version, author, etc.)"""
|
||||
version = '1.3'
|
||||
version = '1.4'
|
||||
description = '`who` command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@@ -161,13 +161,9 @@ def _process(proc_data):
|
||||
"""
|
||||
for entry in proc_data:
|
||||
int_list = ['pid']
|
||||
for key in int_list:
|
||||
if key in entry:
|
||||
try:
|
||||
key_int = int(entry[key])
|
||||
entry[key] = key_int
|
||||
except (ValueError):
|
||||
entry[key] = None
|
||||
for key in entry:
|
||||
if key in int_list:
|
||||
entry[key] = jc.utils.convert_to_int(entry[key])
|
||||
|
||||
if 'time' in entry:
|
||||
ts = jc.utils.timestamp(entry['time'])
|
||||
|
||||
Reference in New Issue
Block a user