当前位置: 首页>>代码示例>>Python>>正文


Python LOG_LEVELS.get方法代码示例

本文整理汇总了Python中kivy.logger.LOG_LEVELS.get方法的典型用法代码示例。如果您正苦于以下问题:Python LOG_LEVELS.get方法的具体用法?Python LOG_LEVELS.get怎么用?Python LOG_LEVELS.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kivy.logger.LOG_LEVELS的用法示例。


在下文中一共展示了LOG_LEVELS.get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: logger_config_update

# 需要导入模块: from kivy.logger import LOG_LEVELS [as 别名]
# 或者: from kivy.logger.LOG_LEVELS import get [as 别名]
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))
开发者ID:matham,项目名称:moa,代码行数:9,代码来源:logger.py

示例2: module

# 需要导入模块: from kivy.logger import LOG_LEVELS [as 别名]
# 或者: from kivy.logger.LOG_LEVELS import get [as 别名]
            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'), }
开发者ID:RaulSierro,项目名称:Orkiv,代码行数:32,代码来源:__init__.py

示例3: mkdir

# 需要导入模块: from kivy.logger import LOG_LEVELS [as 别名]
# 或者: from kivy.logger.LOG_LEVELS import get [as 别名]
            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='])
开发者ID:krishardy,项目名称:kivy,代码行数:32,代码来源:__init__.py

示例4: module

# 需要导入模块: from kivy.logger import LOG_LEVELS [as 别名]
# 或者: from kivy.logger.LOG_LEVELS import get [as 别名]
            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"),
}
开发者ID:geojeff,项目名称:kivy,代码行数:33,代码来源:__init__.py


注:本文中的kivy.logger.LOG_LEVELS.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。