comparison frontends/src/jp/common.py @ 2334:ca14e1ced3b5

jp (common): fixed decode error when item is not specified
author Goffi <goffi@goffi.org>
date Fri, 14 Jul 2017 09:06:03 +0200
parents f15b428852a0
children 78ffb9ce57a4
comparison
equal deleted inserted replaced
2333:a21b3b31086d 2334:ca14e1ced3b5
423 try: 423 try:
424 pubsub_node = pubsub_data['node'][0].decode('utf-8') 424 pubsub_node = pubsub_data['node'][0].decode('utf-8')
425 except KeyError: 425 except KeyError:
426 self.disp(u'No node found in xmpp: URI, can\'t retrieve item', error=True) 426 self.disp(u'No node found in xmpp: URI, can\'t retrieve item', error=True)
427 self.host.quit(1) 427 self.host.quit(1)
428 pubsub_item = pubsub_data.get('item',[None])[0].decode('utf-8') 428 pubsub_item = pubsub_data.get('item',[None])[0]
429 if pubsub_item is not None:
430 pubsub_item = pubsub_item.decode('utf-8')
429 if pubsub_item is None and self.args.last_item: 431 if pubsub_item is None and self.args.last_item:
430 command = 'last' 432 command = 'last'
431 elif pubsub_item is not None: 433 elif pubsub_item is not None:
432 command = 'edit' # XXX: edit command is only used internaly, it similar to last, but with the item given in the URL 434 command = 'edit' # XXX: edit command is only used internaly, it similar to last, but with the item given in the URL
433 else: 435 else: