本文整理汇总了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"),
]
示例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=(