Mercurial > libervia-desktop-kivy
comparison cagou/core/kivy_hack.py @ 312:772c170b47a9
Python3 port:
/!\ Cagou now runs with Python 3.6+
Port has been done in the same way as for backend (check backend commit b2d067339de3
message for details).
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 13 Aug 2019 19:14:22 +0200 |
parents | ca4daced4638 |
children | 4d660b252487 |
comparison
equal
deleted
inserted
replaced
311:a0d978d3ce84 | 312:772c170b47a9 |
---|---|
25 # we remove args so kivy doesn't use them | 25 # we remove args so kivy doesn't use them |
26 # this is need to avoid kivy breaking QuickApp args handling | 26 # this is need to avoid kivy breaking QuickApp args handling |
27 import sys | 27 import sys |
28 ori_argv = sys.argv[:] | 28 ori_argv = sys.argv[:] |
29 sys.argv = sys.argv[:1] | 29 sys.argv = sys.argv[:1] |
30 from constants import Const as C | 30 from .constants import Const as C |
31 from sat.core import log_config | 31 from sat.core import log_config |
32 log_config.satConfigure(C.LOG_BACKEND_STANDARD, C) | 32 log_config.satConfigure(C.LOG_BACKEND_STANDARD, C) |
33 | 33 |
34 import config | 34 from . import config |
35 kivy_level = config.getConfig(C.CONFIG_SECTION, CONF_KIVY_LEVEL, 'follow').upper() | 35 kivy_level = config.getConfig(C.CONFIG_SECTION, CONF_KIVY_LEVEL, 'follow').upper() |
36 | 36 |
37 # kivy handles its own loggers, we don't want that! | 37 # kivy handles its own loggers, we don't want that! |
38 import logging | 38 import logging |
39 root_logger = logging.root | 39 root_logger = logging.root |
49 pass | 49 pass |
50 elif kivy_level in C.LOG_LEVELS: | 50 elif kivy_level in C.LOG_LEVELS: |
51 kivy_logger.setLevel(kivy_level) | 51 kivy_logger.setLevel(kivy_level) |
52 kivy_logger.setLevel = lambda level: None | 52 kivy_logger.setLevel = lambda level: None |
53 else: | 53 else: |
54 raise ValueError(u"Unknown value for {name}: {value}".format(name=CONF_KIVY_LEVEL, value=kivy_level)) | 54 raise ValueError("Unknown value for {name}: {value}".format(name=CONF_KIVY_LEVEL, value=kivy_level)) |
55 | 55 |
56 # during import kivy set its logging stuff | 56 # during import kivy set its logging stuff |
57 import kivy | 57 import kivy |
58 kivy # to avoid pyflakes warning | 58 kivy # to avoid pyflakes warning |
59 | 59 |