From 90e1a3a73b92210227a83ed72bbfa0266e06cea4 Mon Sep 17 00:00:00 2001 From: gashapwn Date: Sat, 28 Nov 2020 02:12:02 +0000 Subject: [PATCH] reworded some comments. removed some newlines. --- app.py | 55 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/app.py b/app.py index 78998ce..a940bf5 100644 --- a/app.py +++ b/app.py @@ -29,8 +29,10 @@ ACCOUNT_DIR = "req/"; FULL_PATH = str(WORKING_DIR) + str(ACCOUNT_DIR) CONF_PATH = str(WORKING_DIR) + "lyadmin.conf.json" +# validation stuff MAX_PUB_KEY_LEN = 5000 - +EMAIL_REGEX = "^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,10}$" +KEY_REGEX = "^[ -~]+$" # Account requests are given ID numbers # the first request will have the below @@ -42,7 +44,7 @@ with open(CONF_PATH) as c: conf_json_str = c.read() conf_obj = json.loads(conf_json_str) # A list of all the shell enums -conf_obj.shell_tup_list = list(map( +conf_obj["shell_tup_list"] = list(map( lambda k : ( k, conf_obj["shell"][k] ), @@ -63,22 +65,23 @@ def home(): return render_template("index.html", u_list=u_list, page_name="home") - -# The page with rules +# Generates the page with rule. No logic needed. def rules(): return render_template("rules.html") # Generate HTML for a form widget def widg_fun(widg): if(widg.w_type == "input"): - # Return HTML for a single line input - return "input id=id_%s name=%s type=text>