Interaction#

class cli_interview_kit.Interaction[source]#

Bases: FrozenModel

Whether a run may prompt, and whether it has blanket consent.

Attributes:
can_promptbool

Stdin is a terminal and --yes was not given.

consentbool

--yes was given: every declared consent is granted.

declaredfrozenset[str]

The keys of the consents the running command declares; only these can be asked for.

Methods

resolve(yes[, declared])

Return the interaction for a run, from --yes and the terminal.

classmethod resolve(yes: bool, declared: frozenset[str] = frozenset({})) → Interaction[source]#

Return the interaction for a run, from --yes and the terminal.

Parameters:
yesbool

Whether --yes was given.

declaredfrozenset[str]

The keys of the consents the running command declares.

Returns:
Interaction

The interaction every question and consent of the run follows.