MCPcopy Create free account
hub / github.com/dbcli/mssql-cli / parse_pygments_style

Function parse_pygments_style

mssqlcli/mssqlstyle.py:47–58  ·  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

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