1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-25 00:37:31 +02:00

use jc.utils for conversions

This commit is contained in:
Kelly Brazil
2021-04-18 13:01:25 -07:00
parent 246c707c98
commit 1f034826f6
42 changed files with 93 additions and 184 deletions

View File

@ -156,7 +156,7 @@ import jc.utils
class info():
"""Provides parser metadata (version, author, etc.)"""
version = '1.2'
version = '1.3'
description = '`rpm -qi` command parser'
author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com'
@ -183,14 +183,11 @@ def _process(proc_data):
List of Dictionaries. Structured data to conform to the schema.
"""
for entry in proc_data:
int_list = ['epoch', 'size']
for key in int_list:
if key in entry:
try:
entry[key] = int(entry[key])
except (ValueError):
entry[key] = None
entry[key] = jc.utils.convert_to_int(entry[key])
if 'build_date' in entry:
timestamp = jc.utils.timestamp(entry['build_date'])