pex.post.tools

Module Contents

class pex.post.tools.PostTools

Bases: object

Subclass of pex.post module.

This subclass of pex.post module is intended for providing implementations of some helpful tools for pex.post.

static bytes_to_octal(bytes_obj: bytes, extra_zero: bool = False) str

Convert bytes to their octal representation.

Parameters:
  • bytes_obj (bytes) – bytes to convert

  • extra_zero (bool) – add extra_zero to the result

Return str:

octal representation of bytes

static post_payload(sender: Callable[Ellipsis, str], payload: str | bytes) str

Post command to sender and receive the result.

Parameters:
  • sender (Callable[..., Any]) – sender function

  • payload (Union[str, bytes]) – command to post

Return str:

post command result