Package ssh :: Module server :: Class InteractiveQuery
[frames] | no frames]

Class InteractiveQuery

source code

object --+
         |
        InteractiveQuery

A query (set of prompts) for a user during interactive authentication.

Instance Methods
 
__init__(self, name='', instructions='', *prompts)
Create a new interactive query to send to the client.
source code
 
add_prompt(self, prompt, echo=True)
Add a prompt to this query.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Method Details

__init__(self, name='', instructions='', *prompts)
(Constructor)

source code 

Create a new interactive query to send to the client. The name and instructions are optional, but are generally displayed to the end user. A list of prompts may be included, or they may be added via the add_prompt method.

Parameters:
  • name (str) - name of this query
  • instructions (str) - user instructions (usually short) about this query
  • prompts (str) - one or more authentication prompts
Overrides: object.__init__

add_prompt(self, prompt, echo=True)

source code 

Add a prompt to this query. The prompt should be a (reasonably short) string. Multiple prompts can be added to the same query.

Parameters:
  • prompt (str) - the user prompt
  • echo (bool) - True (default) if the user's response should be echoed; False if not (for a password or similar)