comparison frontends/src/jp/cmd_pubsub.py @ 2239:17502e74c046

jp (pubsub/uri): fixed URI generation
author Goffi <goffi@goffi.org>
date Fri, 19 May 2017 12:33:54 +0200
parents 4db836386641
children 27f469d40a83
comparison
equal deleted inserted replaced
2238:228d208fb5db 2239:17502e74c046
330 def add_parser_options(self): 330 def add_parser_options(self):
331 self.parser.add_argument("-i", "--item", type=base.unicode_decoder, help=_(u"item to link")) 331 self.parser.add_argument("-i", "--item", type=base.unicode_decoder, help=_(u"item to link"))
332 self.parser.add_argument("-p", "--profile", type=base.unicode_decoder, default=C.PROF_KEY_DEFAULT, help=_(u"profile (used when no server is specified)")) 332 self.parser.add_argument("-p", "--profile", type=base.unicode_decoder, default=C.PROF_KEY_DEFAULT, help=_(u"profile (used when no server is specified)"))
333 333
334 def display_uri(self, jid_): 334 def display_uri(self, jid_):
335 uri_args = {u'type': 'pubsub'} 335 uri_args = {}
336 if not self.args.service: 336 if not self.args.service:
337 self.args.service = jid.JID(jid_).bare 337 self.args.service = jid.JID(jid_).bare
338 338
339 for key in ('node', 'service', 'item'): 339 for key in ('node', 'service', 'item'):
340 value = getattr(self.args, key) 340 value = getattr(self.args, key)
341 if key == 'service': 341 if key == 'service':
342 key = 'path' 342 key = 'path'
343 if value: 343 if value:
344 uri_args[key] = value 344 uri_args[key] = value
345 self.disp(uri.buildXMPPUri(**uri_args)) 345 self.disp(uri.buildXMPPUri(u'pubsub', **uri_args))
346 self.host.quit() 346 self.host.quit()
347 347
348 def start(self): 348 def start(self):
349 if not self.args.service: 349 if not self.args.service:
350 self.host.bridge.asyncGetParamA( 350 self.host.bridge.asyncGetParamA(