comparison sat_frontends/jp/cmd_blog.py @ 3858:6e785662dd7d

cli (blog/get): verbose level of 2 now shows `extra` field
author Goffi <goffi@goffi.org>
date Thu, 14 Jul 2022 12:55:30 +0200
parents 7d11e42b150e
children 915fb230cb28
comparison
equal deleted inserted replaced
3857:7d11e42b150e 3858:6e785662dd7d
79 "author_jid_verified", 79 "author_jid_verified",
80 "content", 80 "content",
81 "content_xhtml", 81 "content_xhtml",
82 "title", 82 "title",
83 "title_xhtml", 83 "title_xhtml",
84 "extra"
84 ) 85 )
85 OUTPUT_OPT_NO_HEADER = "no-header" 86 OUTPUT_OPT_NO_HEADER = "no-header"
86 87
87 88
88 async def guessSyntaxFromPath(host, sat_conf, path): 89 async def guessSyntaxFromPath(host, sat_conf, path):
364 sep="\n" if "content" in k else "", 365 sep="\n" if "content" in k else "",
365 ) 366 )
366 value = k_cb[k](item, keys) if k in k_cb else item[k] 367 value = k_cb[k](item, keys) if k in k_cb else item[k]
367 if isinstance(value, bool): 368 if isinstance(value, bool):
368 value = str(value).lower() 369 value = str(value).lower()
370 elif isinstance(value, dict):
371 value = repr(value)
369 self.disp(header + (value or "")) 372 self.disp(header + (value or ""))
370 # we want a separation line after each item but the last one 373 # we want a separation line after each item but the last one
371 if idx < len(items) - 1: 374 if idx < len(items) - 1:
372 print("") 375 print("")
373 376