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

only add description if it exists

This commit is contained in:
Kelly Brazil
2021-04-06 14:46:27 -07:00
parent 0548263e89
commit 753cac25fb

View File

@ -229,7 +229,8 @@ def parse(data, raw=False, quiet=False):
if this_entry != last_entry:
if entry_obj:
entry_obj['description'] = ' '.join(description)
if description:
entry_obj['description'] = ' '.join(description)
raw_output.append(entry_obj)
entry_obj = {}
last_entry = this_entry
@ -246,8 +247,10 @@ def parse(data, raw=False, quiet=False):
if desc_entry:
description.append(line)
entry_obj['description'] = ' '.join(description)
raw_output.append(entry_obj)
if entry_obj:
if description:
entry_obj['description'] = ' '.join(description)
raw_output.append(entry_obj)
if raw:
return raw_output