From 9e7906c4a1f85a99f9bd8576536e34775aa9b9b9 Mon Sep 17 00:00:00 2001 From: Deimos Date: Fri, 9 Oct 2020 17:52:13 -0600 Subject: [PATCH] Add invoke task to start an IPython shell --- tildes/tasks.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tildes/tasks.py b/tildes/tasks.py index e97350e..9ef9577 100644 --- a/tildes/tasks.py +++ b/tildes/tasks.py @@ -79,6 +79,19 @@ def test(context, quiet=False, webtests=False, html_validation=False): context.run("pytest " + " ".join(pytest_args), pty=True) +@task +def shell(context): + """Start an IPython shell inside the app environment. + + Will use the settings in production.ini if that file exists, otherwise will fall + back to using development.ini. + """ + if Path("production.ini").exists(): + context.run("pshell production.ini", pty=True) + else: + context.run("pshell development.ini", pty=True) + + @task def type_checking(context): """Run static type checking on the Python code."""