jp (blog/get): fix comments node parsing
This commit is contained in:
parent
435027c1c9
commit
8f7c74e3b3
1 changed files with 3 additions and 6 deletions
|
|
@ -265,17 +265,14 @@ class Get(base.CommandBase):
|
|||
return {"blog_items": blog_items}
|
||||
|
||||
def format_comments(self, item, keys):
|
||||
comments_data = data_format.dict2iterdict(
|
||||
"comments", item, ("node", "service"), pop=True
|
||||
)
|
||||
lines = []
|
||||
for data in comments_data:
|
||||
lines.append(data["comments"])
|
||||
for data in item.get('comments', []):
|
||||
lines.append(data["uri"])
|
||||
for k in ("node", "service"):
|
||||
if OUTPUT_OPT_NO_HEADER in self.args.output_opts:
|
||||
header = ""
|
||||
else:
|
||||
header = C.A_HEADER + k + ": " + A.RESET
|
||||
header = f"{C.A_HEADER}comments_{k}: {A.RESET}"
|
||||
lines.append(header + data[k])
|
||||
return "\n".join(lines)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue