From 17ab611e9ce393723fef9c8747aa666d585bbd11 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Thu, 22 Sep 2022 16:11:26 -0400 Subject: [PATCH] Rename .html files to .jinja2. Add to main page. Small style tweaks. --- flaskr/templates/{_formhelpers.html => _formhelpers.jinja2} | 0 flaskr/templates/{writing.html => writing.jinja2} | 5 +++-- latty.py | 6 +++--- start | 4 ++-- writing.py | 6 +++--- 5 files changed, 11 insertions(+), 10 deletions(-) rename flaskr/templates/{_formhelpers.html => _formhelpers.jinja2} (100%) rename flaskr/templates/{writing.html => writing.jinja2} (91%) diff --git a/flaskr/templates/_formhelpers.html b/flaskr/templates/_formhelpers.jinja2 similarity index 100% rename from flaskr/templates/_formhelpers.html rename to flaskr/templates/_formhelpers.jinja2 diff --git a/flaskr/templates/writing.html b/flaskr/templates/writing.jinja2 similarity index 91% rename from flaskr/templates/writing.html rename to flaskr/templates/writing.jinja2 index 7b6db52..1cd7737 100644 --- a/flaskr/templates/writing.html +++ b/flaskr/templates/writing.jinja2 @@ -2,6 +2,7 @@ <html lang="en"> <head> + <title>UnderCover @@ -28,7 +29,7 @@

The secret cover letter generator

- {% from "_formhelpers.html" import render_field %} + {% from "_formhelpers.jinja2" import render_field %}
{{ render_field(form.username) }} @@ -54,7 +55,7 @@ {% endif %} diff --git a/latty.py b/latty.py index 408bfc1..e9e6366 100644 --- a/latty.py +++ b/latty.py @@ -25,7 +25,7 @@ base_tex_text = open(proj_dir + "/writing_templates/base.tex", "r").read() @dataclass -class CLData(): +class CLData: username: str company: str jobandpronoun: str @@ -55,7 +55,7 @@ class CLData(): f.write(base_tex_text) f.close() - output_arg="-jobname=outputs/" + unique_id + " " + unique_file + output_arg = "-jobname=outputs/" + unique_id + " " + unique_file com = "pdflatex -halt-on-error " + output_arg build_text = "[" + get_datetime() + "] Building for " + unique_id + " " result = subprocess.run( @@ -94,7 +94,7 @@ class CLData(): errors = list(map(str.strip, result.stdout.split("\n"))) del errors[:13] del errors[-2:] - return (None, errors) + return None, errors def cleanup(unique): diff --git a/start b/start index dcda877..8f5cf27 100755 --- a/start +++ b/start @@ -2,14 +2,14 @@ SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" if ! test -f "$SCRIPT_DIR/.undercover_init_successful"; then - if ! $SCRIPT_DIR/init; then + if ! "$SCRIPT_DIR/init"; then exit 1 fi fi if ! pip3 -V | grep "$SCRIPT_DIR/.venv"; then echo "Entering virtual environment..." - source $SCRIPT_DIR/.venv/bin/activate + source "$SCRIPT_DIR/.venv/bin/activate" fi if [[ "$1" == "prod" ]]; then diff --git a/writing.py b/writing.py index 2b8c0d8..b1d6a1f 100644 --- a/writing.py +++ b/writing.py @@ -66,7 +66,7 @@ class CLForm(Form): def index_get(): if flaskr.INDEX is None: flaskr.INDEX = render_template( - 'writing.html', + 'writing.jinja2', form=CLForm() ) return flaskr.INDEX @@ -115,7 +115,7 @@ def index_post(): (resp, errors) = data.generate_pdf() if errors: resp = make_response(render_template( - 'writing.html', + 'writing.jinja2', form=form, errors=errors, )) @@ -125,6 +125,6 @@ def index_post(): return resp return render_template( - 'writing.html', + 'writing.jinja2', form=form, )