Snapshots and the event log¶
Screen snapshots with refs and the connection's event log, for tools that drive a device over several processes. Guide: Held connections and screen snapshots.
ScreenSnapshot
¶
The visible screen as ref-addressed nodes (Device.screen_snapshot()). removed
lists the previous snapshot's nodes that are gone; their refs no longer resolve.
snapshot_id increases per attached device.
Methods:
| Name | Description |
|---|---|
node |
The node with |
node
¶
node(ref: str) -> ScreenNode | None
The node with ref (with or without the leading @), or None.
ScreenNode
¶
One visible node of a ScreenSnapshot, in dump (pre-order) order.
ref (e<N>) stays the same across snapshots while the node is unchanged and is never
reused for another node. selector is one the daemon found to match only this node in the
dump (None when there is none); by_index marks one that ends in an index pick, which is
right for this dump but fragile if the screen reorders. window_package is the package of
the window the node is in. interactive: clickable, long-clickable, checkable, scrollable
or editable.
candidates
¶
candidates: tuple[SelectorCandidate, ...]
Only from screen_snapshot(selector_candidates=True): every selector that matched only
this node, best first (the first is selector).
showing_hint
¶
showing_hint: bool
The field shows its hint rather than a value (text then holds the hint).
content_invalid
¶
content_invalid: bool
The app marked the node's content invalid, e.g. a field that failed validation.
NodeChange
¶
NodeFlag
¶
SelectorCandidate
¶
One selector that matched only its ScreenNode in the dump, and how it does so.
SelectorKind
¶
Bases: Enum
How a SelectorCandidate singles out its node. PLAIN: one property (resource id,
text, description or hint); COMBINED: two of the node's own properties; ANCESTOR: a
property plus an ancestor it sits under; BY_INDEX: an index pick, right for this dump but
fragile if the screen reorders. UNKNOWN: a kind this client does not know.
EventLog
¶
TapConnection.event_log(): the kept events, oldest first, and how many older ones the
server evicted (it keeps each connection's last 2000).
LoggedEvent
¶
One device call from a connection's event log (TapConnection.event_log()).
The call and its outcome are the server API's own messages in proto3 JSON form with the
.proto field names, so any language's protobuf library can parse them: command is a
tap.v1.Command (for Execute) and app a tap.v1.AppCall (for an app lifecycle call);
exactly one is set. error is the tap.v1.Error the driver returned and failure the
tap.v1.Failure of a call that failed as an RPC; both are None when the call succeeded.
at is when the call started (Unix seconds); duration is in seconds.
Methods:
| Name | Description |
|---|---|
to_dict |
A JSON-ready dict: the fields above with |
to_dict
¶
to_dict() -> dict
A JSON-ready dict: the fields above with at as an ISO 8601 UTC timestamp and
duration_ms; None fields are left out.