Skip to content

TerminalOutput

Base classes

Name Children Inherits
AnnotatedObject
aclientp.schema.v2.base
A v2 object with the ``_meta`` extension point.

⋔ Inheritance diagram

graph TD
  95970867374832["terminals.TerminalOutput"]
  95970868359040["base.AnnotatedObject"]
  95970855946400["base.Schema"]
  95970851503232["main.BaseModel"]
  125067848591872["builtins.object"]
  95970868359040 --> 95970867374832
  95970855946400 --> 95970868359040
  95970851503232 --> 95970855946400
  125067848591872 --> 95970851503232

🛈 DocStrings

Bases: AnnotatedObject

An authoritative replacement snapshot of terminal output bytes.

Source code in src/aclientp/schema/v2/terminals.py
class TerminalOutput(AnnotatedObject):
    """An authoritative replacement snapshot of terminal output bytes."""

    data: str
    """Base64-encoded replacement terminal output bytes."""

    @classmethod
    def from_bytes(cls, data: bytes) -> Self:
        """Create a snapshot from raw output bytes."""
        return cls(data=base64.b64encode(data).decode("ascii"))

    def decode(self) -> bytes:
        """The raw output bytes."""
        return base64.b64decode(self.data)

data instance-attribute

data: str

Base64-encoded replacement terminal output bytes.

decode

decode() -> bytes

The raw output bytes.

Source code in src/aclientp/schema/v2/terminals.py
def decode(self) -> bytes:
    """The raw output bytes."""
    return base64.b64decode(self.data)

from_bytes classmethod

from_bytes(data: bytes) -> Self

Create a snapshot from raw output bytes.

Source code in src/aclientp/schema/v2/terminals.py
@classmethod
def from_bytes(cls, data: bytes) -> Self:
    """Create a snapshot from raw output bytes."""
    return cls(data=base64.b64encode(data).decode("ascii"))

:fa-brands-github: Show source on GitHub