mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-19 00:17:51 +02:00
clean up trailing spaces on entries
This commit is contained in:
@ -92,11 +92,17 @@ def parse_post(raw_data):
|
|||||||
# post process to split pid and program name and ip addresses and ports
|
# post process to split pid and program name and ip addresses and ports
|
||||||
|
|
||||||
for entry in raw_data:
|
for entry in raw_data:
|
||||||
|
for item in entry:
|
||||||
|
try:
|
||||||
|
entry[item] = entry[item].rstrip()
|
||||||
|
except (AttributeError):
|
||||||
|
# skips trying to rstrip Null entries
|
||||||
|
pass
|
||||||
|
|
||||||
if 'flags' in entry:
|
if 'flags' in entry:
|
||||||
if entry['flags'] == '---':
|
if entry['flags'] == '---':
|
||||||
entry['flags'] = None
|
entry['flags'] = None
|
||||||
if 'program_name' in entry:
|
if 'program_name' in entry:
|
||||||
entry['program_name'] = entry['program_name'].rstrip()
|
|
||||||
if entry['program_name'] == '-':
|
if entry['program_name'] == '-':
|
||||||
entry['program_name'] = None
|
entry['program_name'] = None
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user