1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-17 01:32:37 +02:00

simplify parse code

This commit is contained in:
Kelly Brazil
2022-09-19 17:54:04 -07:00
parent 859bece921
commit e49e6ad179

View File

@ -145,9 +145,7 @@ def parse(
if jc.utils.has_data(data):
for line in filter(None, data.splitlines()):
split_line = line.split(':', maxsplit=1)
key = split_line[0]
val = int(split_line[1].rsplit(maxsplit=1)[0])
raw_output[key] = val
key, val, *_ = line.replace(':', '').split()
raw_output[key] = int(val)
return raw_output if raw else _process(raw_output)