comparison frontends/src/quick_frontend/quick_app.py @ 2089:0931b5a6213c

core, quick_frontends: android compatibility hacks: a couple of hacks have been used so backend can be launched on android using kivy - config file (sat.conf) is been read on a specific dir, using a detection of Cagou domains in constants.py - fixed crash when using sys.stdout.isatty in log_config.py - Q&D fix for logging encoding issue on android - when android is detected, the path/pattern to load plugins is modified - SRV is not working at the moment on android. If the platform is detected, the host is used directly with default port. A hosts_dir configuration can be used in [android] section to map a specific ip to a host - getRepositoryData in tools/utils return constant string on android. Proper repository data need to be copied during package building. - [quick app] more robust failure handling on asyncConnect error - [quick chat] default to utf-8 when getlocale doesn't return the actual locale.
author Goffi <goffi@goffi.org>
date Sun, 04 Dec 2016 18:16:48 +0100
parents 4633cfcbcccb
children f413bfc24458
comparison
equal deleted inserted replaced
2088:c02f96756d5c 2089:0931b5a6213c
400 if not callback: 400 if not callback:
401 callback = lambda dummy: None 401 callback = lambda dummy: None
402 if not errback: 402 if not errback:
403 def errback(failure): 403 def errback(failure):
404 log.error(_(u"Can't connect profile [%s]") % failure) 404 log.error(_(u"Can't connect profile [%s]") % failure)
405 if failure.module.startswith('twisted.words.protocols.jabber') and failure.condition == "not-authorized": 405 try:
406 module = failure.module
407 except AttributeError:
408 module = ''
409 try:
410 message = failure.message
411 except AttributeError:
412 message = 'error'
413 try:
414 fullname = failure.fullname
415 except AttributeError:
416 fullname = 'error'
417 if module.startswith('twisted.words.protocols.jabber') and failure.condition == "not-authorized":
406 self.launchAction(C.CHANGE_XMPP_PASSWD_ID, {}, profile=profile) 418 self.launchAction(C.CHANGE_XMPP_PASSWD_ID, {}, profile=profile)
407 else: 419 else:
408 self.showDialog(failure.message, failure.fullname, 'error') 420 self.showDialog(message, fullname, 'error')
409 self.bridge.asyncConnect(profile, callback=callback, errback=errback) 421 self.bridge.asyncConnect(profile, callback=callback, errback=errback)
410 422
411 def plug_profiles(self, profiles): 423 def plug_profiles(self, profiles):
412 """Tell application which profiles must be used 424 """Tell application which profiles must be used
413 425