crossbar.shell.repl¶
Attributes¶
Exceptions¶
Common base class for all non-exit exceptions. |
|
Common base class for all non-exit exceptions. |
Classes¶
Base class for completer implementations. |
Functions¶
|
|
|
|
|
The continuation: display dots before all the following lines. |
|
Execute system commands entered in the repl. |
|
Run repl-internal commands. |
|
Register |
|
Start an interactive shell. All subcommands are available in it. |
Module Contents¶
- class ClickCompleter(cli)[source]¶
Bases:
prompt_toolkit.completion.CompleterBase class for completer implementations.
- get_completions(document, complete_event=None)[source]¶
This should be a generator that yields
Completioninstances.If the generation of completions is something expensive (that takes a lot of time), consider wrapping this Completer class in a ThreadedCompleter. In that case, the completer algorithm runs in a background thread and completions will be displayed as soon as they arrive.
- Parameters:
document –
Documentinstance.complete_event –
CompleteEventinstance.
- exception ExitReplException[source]¶
Bases:
InternalCommandExceptionCommon base class for all non-exit exceptions.
- exception InternalCommandException[source]¶
Bases:
ExceptionCommon base class for all non-exit exceptions.
- continuation_tokens(cli, width)[source]¶
The continuation: display dots before all the following lines.
- dispatch_repl_commands(command)[source]¶
Execute system commands entered in the repl.
System commands are all commands starting with “!”.
- handle_internal_commands(command)[source]¶
Run repl-internal commands.
Repl-internal commands are all commands starting with “:”.
- async repl(old_ctx, prompt_kwargs=None, allow_system_commands=True, allow_internal_commands=True, once=False, get_bottom_toolbar_tokens=_get_bottom_toolbar_tokens, get_prompt_tokens=None, style=_style)[source]¶
Start an interactive shell. All subcommands are available in it.
- Parameters:
old_ctx – The current Click context.
prompt_kwargs – Parameters passed to
prompt_toolkit.shortcuts.prompt().
If stdin is not a TTY, no prompt will be printed, but only commands read from stdin.