comparison cagou/core/cagou_main.py @ 190:33ac2d2ce5d7

core: new errback method which can be use as a generic way to show error as notes
author Goffi <goffi@goffi.org>
date Tue, 22 May 2018 19:25:23 +0200
parents a91abcd6d9a5
children c5c1dd7f88e1
comparison
equal deleted inserted replaced
189:a91abcd6d9a5 190:33ac2d2ce5d7
706 self.bridge.menusGet("", C.NO_SECURITY_LIMIT, callback=self._menusGetCb) 706 self.bridge.menusGet("", C.NO_SECURITY_LIMIT, callback=self._menusGetCb)
707 707
708 def setPresenceStatus(self, show='', status=None, profile=C.PROF_KEY_NONE): 708 def setPresenceStatus(self, show='', status=None, profile=C.PROF_KEY_NONE):
709 log.info(u"Profile presence status set to {show}/{status}".format(show=show, status=status)) 709 log.info(u"Profile presence status set to {show}/{status}".format(show=show, status=status))
710 710
711 def errback(self, failure_, title=_('error'), message=_(u'error while processing: {msg}')):
712 self.addNote(title, message.format(msg=failure_), level=C.XMLUI_DATA_LVL_WARNING)
713
711 def addNote(self, title, message, level=C.XMLUI_DATA_LVL_INFO): 714 def addNote(self, title, message, level=C.XMLUI_DATA_LVL_INFO):
712 """add a note (message which disappear) to root widget's header""" 715 """add a note (message which disappear) to root widget's header"""
713 self.app.root.addNote(title, message, level) 716 self.app.root.addNote(title, message, level)
714 717
715 def addNotifUI(self, ui): 718 def addNotifUI(self, ui):