comparison frontends/src/jp/cmd_pubsub.py @ 2274:27f469d40a83

jp (pubsub): psItemGet has been renamed to psItemsGet as several items are gotten
author Goffi <goffi@goffi.org>
date Tue, 27 Jun 2017 19:38:22 +0200
parents 17502e74c046
children 64e99bf0dfa2
comparison
equal deleted inserted replaced
2273:5f0dbf42aa9c 2274:27f469d40a83
270 self.parser.add_argument("-m", "--max", type=int, default=10, help=_(u"maximum number of items to get ({} to get all items)".format(C.NO_LIMIT))) 270 self.parser.add_argument("-m", "--max", type=int, default=10, help=_(u"maximum number of items to get ({} to get all items)".format(C.NO_LIMIT)))
271 # TODO: a key(s) argument to select keys to display 271 # TODO: a key(s) argument to select keys to display
272 # TODO: add MAM filters 272 # TODO: add MAM filters
273 273
274 274
275 def psItemGetCb(self, ps_result): 275 def psItemsGetCb(self, ps_result):
276 self.output(ps_result[0]) 276 self.output(ps_result[0])
277 self.host.quit(C.EXIT_OK) 277 self.host.quit(C.EXIT_OK)
278 278
279 def psItemGetEb(self, failure_): 279 def psItemsGetEb(self, failure_):
280 self.disp(u"can't get pubsub items: {reason}".format( 280 self.disp(u"can't get pubsub items: {reason}".format(
281 reason=failure_), error=True) 281 reason=failure_), error=True)
282 self.host.quit(C.EXIT_BRIDGE_ERRBACK) 282 self.host.quit(C.EXIT_BRIDGE_ERRBACK)
283 283
284 def start(self): 284 def start(self):
285 self.host.bridge.psItemGet( 285 self.host.bridge.psItemsGet(
286 self.args.service, 286 self.args.service,
287 self.args.node, 287 self.args.node,
288 self.args.max, 288 self.args.max,
289 self.args.items, 289 self.args.items,
290 self.args.sub_id, 290 self.args.sub_id,
291 {}, 291 {},
292 self.profile, 292 self.profile,
293 callback=self.psItemGetCb, 293 callback=self.psItemsGetCb,
294 errback=self.psItemGetEb) 294 errback=self.psItemsGetEb)
295 295
296 296
297 class Affiliations(base.CommandBase): 297 class Affiliations(base.CommandBase):
298 298
299 def __init__(self, host): 299 def __init__(self, host):