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.
This commit is contained in:
Goffi 2016-12-04 18:16:48 +01:00
commit 2618d48e7b

View file

@ -122,7 +122,7 @@ class Message(object):
# if the message was sent before today, we print the full date
timestamp = time.localtime(self.timestamp)
time_format = u"%c" if timestamp < self.parent.day_change else u"%H:%M"
return time.strftime(time_format, timestamp).decode(getlocale()[1])
return time.strftime(time_format, timestamp).decode(getlocale()[1] or 'utf-8')
@property
def avatar(self):
@ -470,7 +470,7 @@ class QuickChat(quick_widgets.QuickWidget):
self._onHistoryPrinted()
def _historyGetEb(err):
log.error(_(u"Can't get history"))
log.error(_(u"Can't get history: {}").format(err))
self._onHistoryPrinted()
self.host.bridge.historyGet(unicode(self.host.profiles[profile].whoami.bare), unicode(target), size, True, filters, profile, callback=_historyGetCb, errback=_historyGetEb)