Add json import/export

This commit is contained in:
evilchili
2024-06-30 23:21:23 -07:00
parent 68251ff4e9
commit 551140b5bc
9 changed files with 334 additions and 49 deletions
+4 -4
View File
@@ -80,11 +80,11 @@ def serve(
"""
# delay loading the app until we have configured our environment
from ttfrog.db.bootstrap import bootstrap
from ttfrog.db.bootstrap import loader
from ttfrog.webserver import application
print("Starting TableTop Frog server...")
bootstrap()
loader.load()
application.start(host=host, port=port, debug=debug)
@@ -93,13 +93,13 @@ def setup(context: typer.Context):
"""
(Re)Initialize TableTop Frog. Idempotent; will preserve any existing configuration.
"""
from ttfrog.db.bootstrap import bootstrap
from ttfrog.db.bootstrap import loader
if not os.path.exists(app_state["env"]):
app_state["env"].parent.mkdir(parents=True, exist_ok=True)
app_state["env"].write_text(dedent(SETUP_HELP))
print(f"Wrote defaults file {app_state['env']}.")
bootstrap()
loader.load()
@db_app.command()