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


Python LOG_LEVELS.items方法代码示例

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


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

示例1: OrderedDict

# 需要导入模块: from sentry.constants import LOG_LEVELS [as 别名]
# 或者: from sentry.constants.LOG_LEVELS import items [as 别名]
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""

from __future__ import absolute_import

from collections import OrderedDict

from django import forms
from sentry.constants import LOG_LEVELS, LOG_LEVELS_MAP

from sentry.rules.conditions.base import EventCondition

LEVEL_CHOICES = OrderedDict(
    [("{0}".format(k), v) for k, v in sorted(LOG_LEVELS.items(), key=lambda x: x[0], reverse=True)]
)


class MatchType(object):
    EQUAL = "eq"
    LESS_OR_EQUAL = "lte"
    GREATER_OR_EQUAL = "gte"


MATCH_CHOICES = OrderedDict(
    [
        (MatchType.EQUAL, "equal to"),
        (MatchType.LESS_OR_EQUAL, "less than or equal to"),
        (MatchType.GREATER_OR_EQUAL, "greater than or equal to"),
    ]
开发者ID:ForkRepo,项目名称:sentry,代码行数:32,代码来源:level.py

示例2: OrderedDict

# 需要导入模块: from sentry.constants import LOG_LEVELS [as 别名]
# 或者: from sentry.constants.LOG_LEVELS import items [as 别名]
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""

from __future__ import absolute_import

from collections import OrderedDict

from django import forms
from sentry.constants import LOG_LEVELS, LOG_LEVELS_MAP

from sentry.rules.conditions.base import EventCondition

LEVEL_CHOICES = OrderedDict([
    ("{0}".format(k), "{0}".format(v.capitalize()))
    for k, v in sorted(LOG_LEVELS.items(), key=lambda x: x[0], reverse=True)
])


class LevelMatchType(object):
    EQUAL = 'eq'
    LESS_OR_EQUAL = 'lte'
    GREATER_OR_EQUAL = 'gte'


class LevelEventForm(forms.Form):
    level = forms.ChoiceField(
        choices=LEVEL_CHOICES.items(),
        initial=30)
    match = forms.ChoiceField(
        choices=(
开发者ID:BrunoAsato,项目名称:sentry,代码行数:33,代码来源:level.py


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