comparison sat_frontends/jp/cmd_blog.py @ 3857:7d11e42b150e

cli (blog/set): show ID of published item
author Goffi <goffi@goffi.org>
date Thu, 14 Jul 2022 12:55:30 +0200
parents b337d7da72e5
children 6e785662dd7d
comparison
equal deleted inserted replaced
3856:bc7f9d0a404f 3857:7d11e42b150e
223 mb_data["id"] = self.pubsub_item 223 mb_data["id"] = self.pubsub_item
224 content = sys.stdin.read() 224 content = sys.stdin.read()
225 await self.setMbDataContent(content, mb_data) 225 await self.setMbDataContent(content, mb_data)
226 226
227 try: 227 try:
228 await self.host.bridge.mbSend( 228 item_id = await self.host.bridge.mbSend(
229 self.args.service, 229 self.args.service,
230 self.args.node, 230 self.args.node,
231 data_format.serialise(mb_data), 231 data_format.serialise(mb_data),
232 self.profile, 232 self.profile,
233 ) 233 )
234 except Exception as e: 234 except Exception as e:
235 self.disp(f"can't send item: {e}", error=True) 235 self.disp(f"can't send item: {e}", error=True)
236 self.host.quit(C.EXIT_BRIDGE_ERRBACK) 236 self.host.quit(C.EXIT_BRIDGE_ERRBACK)
237 else: 237 else:
238 self.disp("Item published") 238 self.disp(f"Item published with ID {item_id}")
239 self.host.quit(C.EXIT_OK) 239 self.host.quit(C.EXIT_OK)
240 240
241 241
242 class Get(base.CommandBase): 242 class Get(base.CommandBase):
243 TEMPLATE = "blog/articles.html" 243 TEMPLATE = "blog/articles.html"