7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-05-29 12:20:49 +00:00
tutor/tutor/commands/ui.py
Régis Behmo 0a670d7ead refactor: add type annotations
Annotations were generated with pyannotate:
https://github.com/dropbox/pyannotate

We are running in strict mode, which is awesome!

This affects a large part of the code base, which might be an issue for
people running a fork of Tutor. Nonetheless, the behavior should not be
affected. If anything, this process has helped find and resolve a few
type-related bugs. Thus, this is not considered as a breaking change.
2021-03-15 21:46:55 +01:00

22 lines
605 B
Python

import click
import click_repl
@click.command(
short_help="Interactive shell",
help="Launch an interactive shell for launching Tutor commands",
)
def ui() -> None:
click.echo(
"""Welcome to the Tutor interactive shell UI!
Type "help" to view all available commands.
Type "local quickstart" to configure and launch a new platform from scratch.
Type <ctrl-d> to exit."""
)
while True:
try:
click_repl.repl(click.get_current_context())
return # this happens on a ctrl+d
except Exception: # pylint: disable=broad-except
pass