comparison sat_frontends/jp/cmd_pubsub.py @ 3938:6939594ba77e

cli (pubsub/get): add `--no-decrypt` flag to disable automatic decryption: rel 380
author Goffi <goffi@goffi.org>
date Sat, 15 Oct 2022 20:37:00 +0200
parents 1ab5fb468a41
children 8ae3e870be94
comparison
equal deleted inserted replaced
3937:5980ea188f87 3938:6939594ba77e
1279 "-S", 1279 "-S",
1280 "--sub-id", 1280 "--sub-id",
1281 default="", 1281 default="",
1282 help=_("subscription id"), 1282 help=_("subscription id"),
1283 ) 1283 )
1284 self.parser.add_argument(
1285 "--no-decrypt",
1286 action="store_true",
1287 help=_("don't do automatic decryption of e2ee items"),
1288 )
1284 #  TODO: a key(s) argument to select keys to display 1289 #  TODO: a key(s) argument to select keys to display
1285 1290
1286 async def start(self): 1291 async def start(self):
1292 extra = {}
1293 if self.args.no_decrypt:
1294 extra["decrypt"] = False
1287 try: 1295 try:
1288 ps_result = data_format.deserialise( 1296 ps_result = data_format.deserialise(
1289 await self.host.bridge.psItemsGet( 1297 await self.host.bridge.psItemsGet(
1290 self.args.service, 1298 self.args.service,
1291 self.args.node, 1299 self.args.node,
1292 self.args.max, 1300 self.args.max,
1293 self.args.items, 1301 self.args.items,
1294 self.args.sub_id, 1302 self.args.sub_id,
1295 self.getPubsubExtra(), 1303 self.getPubsubExtra(extra),
1296 self.profile, 1304 self.profile,
1297 ) 1305 )
1298 ) 1306 )
1299 except BridgeException as e: 1307 except BridgeException as e:
1300 if e.condition == "item-not-found" or e.classname == "NotFound": 1308 if e.condition == "item-not-found" or e.classname == "NotFound":