Module p4lantir.utils

Module content

p4lantir.utils.setup_logger(logger: Logger, level=logging.INFO) → RichLog[source]

Setup the logger for log file, term and app.

Parameters:
  • logger (logging.Logger) – the logger to configure

  • level (int) – the log level

Returns:

the widget where the log stream is redirected to

Return type:

textual.widget.RichLog

p4lantir.utils.setup_parser() → ArgumentParser[source]

Setup the argument parser with all the script’s arguments.

Returns:

the argument parser

Return type:

argparser.ArgumentParser

p4lantir.utils.hexdump_view(message: bytes) → Table[source]

Return a rich Table with a hexdump-like view of the messsage.

Parameters:

message (bytes) – the message to format

Returns:

rich.table.Table