本文整理汇总了Python中pygments.token.Token.Number方法的典型用法代码示例。如果您正苦于以下问题:Python Token.Number方法的具体用法?Python Token.Number怎么用?Python Token.Number使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pygments.token.Token
的用法示例。
在下文中一共展示了Token.Number方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: color_mapping
# 需要导入模块: from pygments.token import Token [as 别名]
# 或者: from pygments.token.Token import Number [as 别名]
def color_mapping(curr_completion, completion, prompt, command, subcommand,
param, text, line, example, toolbar):
return style_from_dict({
# Completion colors
Token.Menu.Completions.Completion.Current: curr_completion,
Token.Menu.Completions.Completion: completion,
Token.Menu.Completions.ProgressButton: 'bg:#b78991',
Token.Menu.Completions.ProgressBar: 'bg:#ffc0cb',
Token.Az: prompt,
Token.Prompt.Arg: prompt,
# Pretty Words
Token.Keyword: command,
Token.Keyword.Declaration: subcommand,
Token.Name.Class: param,
Token.Text: text,
Token.Line: line,
Token.Number: example,
# toolbar
Token.Operator: toolbar,
Token.Toolbar: toolbar
})
示例2: test_http_status_line
# 需要导入模块: from pygments.token import Token [as 别名]
# 或者: from pygments.token.Token import Number [as 别名]
def test_http_status_line(lexer):
fragment = u'HTTP/1.1 200 OK\n'
tokens = [
(Token.Keyword.Reserved, u'HTTP'),
(Token.Operator, u'/'),
(Token.Number, u'1.1'),
(Token.Text, u' '),
(Token.Number, u'200'),
(Token.Text, u' '),
(Token.Name.Exception, u'OK'),
(Token.Text, u'\n'),
]
assert list(lexer.get_tokens(fragment)) == tokens
示例3: test_http_status_line_without_reason_phrase
# 需要导入模块: from pygments.token import Token [as 别名]
# 或者: from pygments.token.Token import Number [as 别名]
def test_http_status_line_without_reason_phrase(lexer):
fragment = u'HTTP/1.1 200\n'
tokens = [
(Token.Keyword.Reserved, u'HTTP'),
(Token.Operator, u'/'),
(Token.Number, u'1.1'),
(Token.Text, u' '),
(Token.Number, u'200'),
(Token.Text, u'\n'),
]
assert list(lexer.get_tokens(fragment)) == tokens
示例4: test_http_status_line_without_reason_phrase_rfc_7230
# 需要导入模块: from pygments.token import Token [as 别名]
# 或者: from pygments.token.Token import Number [as 别名]
def test_http_status_line_without_reason_phrase_rfc_7230(lexer):
fragment = u'HTTP/1.1 200 \n'
tokens = [
(Token.Keyword.Reserved, u'HTTP'),
(Token.Operator, u'/'),
(Token.Number, u'1.1'),
(Token.Text, u' '),
(Token.Number, u'200'),
(Token.Text, u' '),
(Token.Text, u'\n'),
]
assert list(lexer.get_tokens(fragment)) == tokens