Mercurial > libervia-backend
comparison src/tools/utils.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 | 1128feb54180 |
children | 968b0d13bcc7 |
comparison
equal
deleted
inserted
replaced
2088:c02f96756d5c | 2089:0931b5a6213c |
---|---|
23 import os.path | 23 import os.path |
24 from sat.core.log import getLogger | 24 from sat.core.log import getLogger |
25 log = getLogger(__name__) | 25 log = getLogger(__name__) |
26 import datetime | 26 import datetime |
27 import time | 27 import time |
28 import sys | |
28 | 29 |
29 | 30 |
30 def clean_ustr(ustr): | 31 def clean_ustr(ustr): |
31 """Clean unicode string | 32 """Clean unicode string |
32 | 33 |
76 - node: full revision number (40 bits) | 77 - node: full revision number (40 bits) |
77 - branch: branch name | 78 - branch: branch name |
78 - date: ISO 8601 format date | 79 - date: ISO 8601 format date |
79 - tag: latest tag used in hierarchie | 80 - tag: latest tag used in hierarchie |
80 """ | 81 """ |
82 if sys.platform == "android": | |
83 #Â FIXME: workaround to avoid trouble on android, need to be fixed properly | |
84 return u"Cagou android build" | |
81 from distutils.spawn import find_executable | 85 from distutils.spawn import find_executable |
82 import subprocess | 86 import subprocess |
83 KEYS=("node", "node_short", "branch", "date", "tag") | 87 KEYS=("node", "node_short", "branch", "date", "tag") |
84 ori_cwd = os.getcwd() | 88 ori_cwd = os.getcwd() |
85 | 89 |