MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / AsyncAlert

Class AsyncAlert

cmd2/cmd2.py:307–320  ·  view source on GitHub ↗

Contents of an asynchronous alert which display while user is at prompt. :param msg: an optional message to be printed above the prompt. :param prompt: an optional string to dynamically replace the current prompt. :ivar timestamp: monotonic creation time of the alert. If an alert was c

Source from the content-addressed store, hash-verified

305
306@dataclass(kw_only=True)
307class AsyncAlert:
308 """Contents of an asynchronous alert which display while user is at prompt.
309
310 :param msg: an optional message to be printed above the prompt.
311 :param prompt: an optional string to dynamically replace the current prompt.
312
313 :ivar timestamp: monotonic creation time of the alert. If an alert was created
314 before the current prompt was rendered, its prompt data is ignored
315 to avoid a stale display, but its msg data will still be displayed.
316 """
317
318 msg: str | None = None
319 prompt: str | None = None
320 timestamp: float = field(default_factory=time.monotonic, init=False)
321
322
323@dataclass

Callers 1

add_alertMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…