# HG changeset patch # User Goffi # Date 1619887138 -7200 # Node ID 8acaf857cd0a8d7c06c8f2829720ddd08ed21a19 # Parent 02eec2a5b5f9b514793fa4e318e176f6f032edfe jp (blog/get): fix comments node parsing diff -r 02eec2a5b5f9 -r 8acaf857cd0a sat_frontends/jp/cmd_blog.py --- a/sat_frontends/jp/cmd_blog.py Sat May 01 18:37:57 2021 +0200 +++ b/sat_frontends/jp/cmd_blog.py Sat May 01 18:38:58 2021 +0200 @@ -265,17 +265,14 @@ 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)