class documentation
class PyvalColorizer: (source)
Constructor: PyvalColorizer(linelen, maxlines, linebreakok, refmap, is_annotation)
Syntax highlighter for Python AST (and some builtins types).
Method | __init__ |
Undocumented |
Method | colorize |
Entry Point. |
Constant | COLON |
Undocumented |
Constant | COMMA |
Undocumented |
Constant | CONST |
Undocumented |
Constant | ELLIPSIS |
Undocumented |
Constant | ELLIPSIS |
Undocumented |
Constant | GENERIC |
Undocumented |
Constant | GROUP |
Undocumented |
Constant | LINEWRAP |
Undocumented |
Constant | LINEWRAP |
Undocumented |
Constant | LINK |
Undocumented |
Constant | NEWLINE |
Undocumented |
Constant | NUMBER |
Undocumented |
Constant | QUOTE |
Undocumented |
Constant | RE |
Undocumented |
Constant | RE |
Undocumented |
Constant | RE |
Undocumented |
Constant | RE |
Undocumented |
Constant | RE |
Undocumented |
Constant | RE |
Undocumented |
Constant | STRING |
Undocumented |
Constant | UNKNOWN |
Undocumented |
Constant | UNKNOWN |
Undocumented |
Constant | WORD |
Undocumented |
Instance Variable | explicit |
Undocumented |
Instance Variable | is |
Undocumented |
Instance Variable | linebreakok |
Undocumented |
Instance Variable | linelen |
Undocumented |
Instance Variable | maxlines |
Undocumented |
Instance Variable | refmap |
Undocumented |
Method | _colorize |
Undocumented |
Method | _colorize |
Undocumented |
Method | _colorize |
Undocumented |
Method | _colorize |
Undocumented |
Method | _colorize |
Undocumented |
Method | _colorize |
Undocumented |
Method | _colorize |
Undocumented |
Method | _colorize |
Undocumented |
Method | _colorize |
Undocumented |
Method | _colorize |
Undocumented |
Method | _colorize |
Undocumented |
Method | _colorize |
Undocumented |
Method | _colorize |
Undocumented |
Method | _colorize |
Undocumented |
Method | _colorize |
Undocumented |
Method | _colorize |
Undocumented |
Method | _colorize |
Undocumented |
Method | _colorize |
Undocumented |
Method | _colorize |
Undocumented |
Method | _colorize |
Undocumented |
Method | _insert |
Undocumented |
Method | _multiline |
Helper for container-type colorizers. First, try calling func(pyval, state, **kwargs) with linebreakok set to false; and if that fails, then try again with it set to true. |
Method | _output |
Add the string s to the result list, tagging its contents with the specified css_class. Any lines that go beyond PyvalColorizer.linelen will be line-wrapped. If the total number of lines exceeds PyvalColorizer.maxlines ... |
Method | _set |
Undocumented |
Method | _trim |
Undocumented |
def __init__(self, linelen:
int | None
, maxlines: int
, linebreakok: bool
= True, refmap: dict[ str, str] | None
= None, is_annotation: bool
= False):
(source)
¶
Undocumented
def _colorize_ast_dict(self, items:
Iterable[ tuple[ ast.AST | None, ast.AST]]
, state: _ColorizerState
, prefix: str
, suffix: str
):
(source)
¶
Undocumented
def _colorize_iter(self, pyval:
Iterable[ Any]
, state: _ColorizerState
, prefix: AnyStr | None
= None, suffix: AnyStr | None
= None):
(source)
¶
Undocumented
def _colorize_re_tree(self, tree:
Sequence[ tuple[ sre_constants._NamedIntConstant, Any]]
, state: _ColorizerState
, noparen: bool
, groups: dict[ int, str]
):
(source)
¶
Undocumented
def _colorize_str(self, pyval:
AnyStr
, state: _ColorizerState
, prefix: AnyStr
, escape_fcn: Callable[ [ AnyStr], str]
):
(source)
¶
Undocumented
def _multiline(self, func:
Callable[ ..., None]
, pyval: Iterable[ Any]
, state: _ColorizerState
, **kwargs: Any
):
(source)
¶
Helper for container-type colorizers. First, try calling func(pyval, state, **kwargs) with linebreakok set to false; and if that fails, then try again with it set to true.
def _output(self, s:
AnyStr
, css_class: str | None
, state: _ColorizerState
, link: bool
= False):
(source)
¶
Add the string s to the result list, tagging its contents with the specified css_class. Any lines that go beyond PyvalColorizer.linelen
will be line-wrapped. If the total number of lines exceeds PyvalColorizer.maxlines
, then raise a _Maxlines
exception.