diff 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
line wrap: on
line diff
--- a/frontends/src/quick_frontend/quick_app.py	Sun Dec 04 18:16:37 2016 +0100
+++ b/frontends/src/quick_frontend/quick_app.py	Sun Dec 04 18:16:48 2016 +0100
@@ -402,10 +402,22 @@
         if not errback:
             def errback(failure):
                 log.error(_(u"Can't connect profile [%s]") % failure)
-                if failure.module.startswith('twisted.words.protocols.jabber') and failure.condition == "not-authorized":
+                try:
+                    module = failure.module
+                except AttributeError:
+                    module = ''
+                try:
+                    message = failure.message
+                except AttributeError:
+                    message = 'error'
+                try:
+                    fullname = failure.fullname
+                except AttributeError:
+                    fullname = 'error'
+                if module.startswith('twisted.words.protocols.jabber') and failure.condition == "not-authorized":
                     self.launchAction(C.CHANGE_XMPP_PASSWD_ID, {}, profile=profile)
                 else:
-                    self.showDialog(failure.message, failure.fullname, 'error')
+                    self.showDialog(message, fullname, 'error')
         self.bridge.asyncConnect(profile, callback=callback, errback=errback)
 
     def plug_profiles(self, profiles):