comparison frontends/src/jp/cmd_event.py @ 2283:5b04fc0c663d

jp (pubsub/get): renamed --id option to --item for consistency with other commands
author Goffi <goffi@goffi.org>
date Thu, 29 Jun 2017 20:35:07 +0200
parents 0f3bfe89999e
children 4fd010f29f99
comparison
equal deleted inserted replaced
2282:d8e48c850ad2 2283:5b04fc0c663d
42 use_verbose=True, 42 use_verbose=True,
43 help=_(u'get event data')) 43 help=_(u'get event data'))
44 self.need_loop=True 44 self.need_loop=True
45 45
46 def add_parser_options(self): 46 def add_parser_options(self):
47 self.parser.add_argument("-i", "--id", type=base.unicode_decoder, default=u'', help=_(u"ID of the PubSub Item")) 47 self.parser.add_argument("-i", "--item", type=base.unicode_decoder, default=u'', help=_(u"ID of the PubSub Item"))
48 48
49 def eventInviteeGetCb(self, result): 49 def eventInviteeGetCb(self, result):
50 event_date, event_data = result 50 event_date, event_data = result
51 event_data['date'] = event_date 51 event_data['date'] = event_date
52 self.output(event_data) 52 self.output(event_data)
54 54
55 def start(self): 55 def start(self):
56 self.host.bridge.eventGet( 56 self.host.bridge.eventGet(
57 self.args.service, 57 self.args.service,
58 self.args.node, 58 self.args.node,
59 self.args.id, 59 self.args.item,
60 self.profile, 60 self.profile,
61 callback=self.eventInviteeGetCb, 61 callback=self.eventInviteeGetCb,
62 errback=partial(self.errback, 62 errback=partial(self.errback,
63 msg=_(u"can't get event data: {}"), 63 msg=_(u"can't get event data: {}"),
64 exit_code=C.EXIT_BRIDGE_ERRBACK)) 64 exit_code=C.EXIT_BRIDGE_ERRBACK))