pmc_parser
Parser for PMC (PTP Management Client) text output.
Classes:
-
ParseError–Represents a parse failure with trace information.
-
Some–Type representing a value in an option-like pattern.
Functions:
-
abbreviate–Abbreviate long text for debug output.
-
consume–Consume and parse a value of the given type from text.
-
indent–Indent a message for debug logging.
-
parse–Parse PMC output text into a list of messages.
-
parse_class_from_regex–Parse a dataclass from string using its
regexattribute. -
parse_float–Parse a float from string, supporting hex and decimal floats.
-
parse_int–Parse an int from string, supporting hex and decimal ints.
ParseError
dataclass
Represents a parse failure with trace information.
Attributes:
-
trace(list[str]) –Stack of parser contexts where the error occurred.
-
rest(str) –Remaining unparsed text.
-
API Reference
pmc_monitorpmc_parserconsume
Some
dataclass
Some(x: Any)
Type representing a value in an option-like pattern.
Example
Attributes:
-
x(Any) –The parsed value.
-
API Reference
pmc_monitorpmc_parserconsume
consume
Consume and parse a value of the given type from text.
parse
parse_class_from_regex
Parse a dataclass from string using its regex attribute.