本文整理汇总了Python中kivy.logger.LOG_LEVELS类的典型用法代码示例。如果您正苦于以下问题:Python LOG_LEVELS类的具体用法?Python LOG_LEVELS怎么用?Python LOG_LEVELS使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LOG_LEVELS类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: logger_config_update
def logger_config_update(section, key, value):
'''Callback called when the :attr:`~moa.config.Config` object changes the
`log_level` key value.
'''
if LOG_LEVELS.get(value) is None:
raise AttributeError('Loglevel {0!r} doesn\'t exists'.format(value))
Logger.setLevel(level=LOG_LEVELS.get(value))
示例2: module
Activate a module (use "list" to get a list of available modules).
-r, --rotation
Rotate the window's contents (0, 90, 180, 270).
-s, --save
Save current Kivy configuration.
--size=640x480
Size of window geometry.
--dpi=96
Manually overload the Window DPI (for testing only.)
'''
print(kivy_usage.__doc__ % (basename(sys.argv[0])))
# Start !
if 'vim' in globals():
Logger.setLevel(level=LOG_LEVELS.get('critical'))
else:
Logger.setLevel(level=LOG_LEVELS.get('info'))
Logger.info('Kivy v%s' % (__version__))
#: Global settings options for kivy
kivy_options = {
'window': ('egl_rpi', 'pygame', 'sdl', 'x11'),
'text': ('pil', 'pygame', 'sdlttf'),
'video': ('gstplayer', 'ffmpeg', 'gi', 'pygst', 'pyglet', 'null'),
'audio': ('gstplayer', 'pygame', 'gi', 'pygst', 'sdl'),
'image': ('tex', 'imageio', 'dds', 'gif', 'pil', 'pygame'),
'camera': ('opencv', 'gi', 'pygst', 'videocapture', 'avfoundation'),
'spelling': ('enchant', 'osxappkit', ),
'clipboard': ('android', 'pygame', 'dummy'), }
示例3: mkdir
mkdir(kivy_home_dir)
if not exists(kivy_usermodules_dir):
mkdir(kivy_usermodules_dir)
if not exists(kivy_userexts_dir):
mkdir(kivy_userexts_dir)
if not exists(icon_dir):
try:
shutil.copytree(join(kivy_data_dir, 'logo'), icon_dir)
except:
Logger.exception('Error when copying logo directory')
# configuration
from kivy.config import Config
# Set level of logger
level = LOG_LEVELS.get(Config.get('kivy', 'log_level'))
Logger.setLevel(level=level)
# Can be overrided in command line
if 'KIVY_UNITTEST' not in environ and 'KIVY_PACKAGING' not in environ:
# save sys argv, otherwize, gstreamer use it and display help..
sys_argv = sys.argv
sys.argv = sys.argv[:1]
try:
opts, args = getopt(sys_argv[1:], 'hp:fkawFem:sr:dc:', [
'help', 'fullscreen', 'windowed', 'fps', 'event',
'module=', 'save', 'fake-fullscreen', 'auto-fullscreen',
'display=', 'size=', 'rotate=', 'config=', 'debug',
'dpi='])
示例4: module
Activate a module (use "list" to get a list of available modules).
-r, --rotation
Rotate the window's contents (0, 90, 180, 270).
-s, --save
Save current Kivy configuration.
--size=640x480
Size of window geometry.
--dpi=96
Manually overload the Window DPI (for testing only.)
"""
print(kivy_usage.__doc__ % (basename(sys.argv[0])))
# Start !
if "vim" in globals():
Logger.setLevel(level=LOG_LEVELS.get("critical"))
else:
Logger.setLevel(level=LOG_LEVELS.get("info"))
Logger.info("Kivy v%s" % (__version__))
#: Global settings options for kivy
kivy_options = {
"window": ("egl_rpi", "pygame", "sdl", "x11"),
"text": ("pil", "pygame", "sdlttf"),
"video": ("ffmpeg", "gstreamer", "pyglet", "null"),
"audio": ("pygame", "gstreamer", "sdl"),
"image": ("tex", "imageio", "dds", "gif", "pil", "pygame"),
"camera": ("opencv", "gstreamer", "videocapture"),
"spelling": ("enchant", "osxappkit"),
"clipboard": ("pygame", "dummy"),
}