From 81ec20092825878a255db4ab0f321878616adbcb Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Thu, 2 Jan 2020 08:17:58 -0800 Subject: [PATCH] Add skeleton run command --- amanuensis/app.py | 7 +++++++ amanuensis/cli.py | 7 +++++++ amanuensis/templates/admin.html | 6 ++++++ 3 files changed, 20 insertions(+) create mode 100644 amanuensis/app.py create mode 100644 amanuensis/templates/admin.html diff --git a/amanuensis/app.py b/amanuensis/app.py new file mode 100644 index 0000000..0c87e9c --- /dev/null +++ b/amanuensis/app.py @@ -0,0 +1,7 @@ +from flask import Flask, render_template + +app = Flask(__name__) + +@app.route("/") +def root(): + return render_template("admin.html", username="guest") diff --git a/amanuensis/cli.py b/amanuensis/cli.py index 32e6cb2..b314e03 100644 --- a/amanuensis/cli.py +++ b/amanuensis/cli.py @@ -65,6 +65,13 @@ def command_init(args): os.mkdir(os.path.join(cfd, "lexicon")) os.mkdir(os.path.join(cfd, "user")) +@add_argument("-a", "--address", default="127.0.0.1") +@add_argument("-p", "--port", default="5000") +def command_run(args): + """Runs the default Flask development server""" + from app import app + app.run(host=args.address, port=args.port) + @add_argument("--foo", action="store_true") def command_dump(args): """Dumps the global config or the config for the given lexicon""" diff --git a/amanuensis/templates/admin.html b/amanuensis/templates/admin.html new file mode 100644 index 0000000..1db858a --- /dev/null +++ b/amanuensis/templates/admin.html @@ -0,0 +1,6 @@ + + + +

Hello, {{username}}

+ +