MCPcopy Index your code
hub / github.com/dbcli/pgcli / parse_pygments_style

Function parse_pygments_style

pgcli/pgstyle.py:49–62  ·  view source on GitHub ↗

Parse token type and style string. :param token_name: str name of Pygments token. Example: "Token.String" :param style_object: pygments.style.Style instance to use as base :param style_dict: dict of token names and their styles, customized to this cli

(token_name, style_object, style_dict)

Source from the content-addressed store, hash-verified

47
48
49def parse_pygments_style(token_name, style_object, style_dict):
50 """Parse token type and style string.
51
52 :param token_name: str name of Pygments token. Example: "Token.String"
53 :param style_object: pygments.style.Style instance to use as base
54 :param style_dict: dict of token names and their styles, customized to this cli
55
56 """
57 token_type = string_to_tokentype(token_name)
58 try:
59 other_token_type = string_to_tokentype(style_dict[token_name])
60 return token_type, style_object.styles[other_token_type]
61 except AttributeError:
62 return token_type, style_dict[token_name]
63
64
65def style_factory(name, cli_style):

Callers 2

style_factoryFunction · 0.85
style_factory_outputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected