reformatted some more lambdas

This commit is contained in:
gashapwn 2020-11-28 02:01:20 +00:00
parent d74d38a582
commit 2ad636e887

15
app.py
View File

@ -42,7 +42,7 @@ with open(CONF_PATH) as c: conf_json_str = c.read()
conf_obj = json.loads(conf_json_str) conf_obj = json.loads(conf_json_str)
# A list of all the shell enums # A list of all the shell enums
SHELL_TUP_LIST = list(map( conf_obj.shell_tup_list = list(map(
lambda k : ( lambda k : (
k, conf_obj["shell"][k] k, conf_obj["shell"][k]
), ),
@ -98,25 +98,21 @@ def req():
"input", "input",
None None
), ),
"email for account lockout / registration confirmation (optional)": Widg( "email for account lockout / registration confirmation (optional)": Widg(
"email", "email",
"input", "input",
None None
), ),
"SSH public key": Widg( "SSH public key": Widg(
"pub_key", "pub_key",
"textarea", "textarea",
None None
), ),
"shell of choice": Widg( "shell of choice": Widg(
"shell", "shell",
"choice", "choice",
SHELL_TUP_LIST conf_obj.shell_tup_list
), ),
"have you read the rules?": Widg( "have you read the rules?": Widg(
"rule_read", "check", None "rule_read", "check", None
) )
@ -194,8 +190,11 @@ def signup():
new_id = int(INIT_REQ_ID) new_id = int(INIT_REQ_ID)
new_id_str = INIT_REQ_ID new_id_str = INIT_REQ_ID
else: else:
max_id = max(list(map( lambda path : path.split("/")[-1].split(".")[0] , glob.glob(str(ACCOUNT_DIR) + "[0-9]*ident*")))) max_id = max(
# max_id = max(list(map( lambda path : path.split("/")[-1].split(".")[0] , glob.glob("./test/[0-9]*ident*")))) list(map(
lambda path : path.split("/")[-1].split(".")[0],
glob.glob(str(ACCOUNT_DIR) + "[0-9]*ident*")))
)
zpad = len(max_id) zpad = len(max_id)
new_id = int(max_id)+1 new_id = int(max_id)+1
new_id_str = str(new_id).zfill(zpad) new_id_str = str(new_id).zfill(zpad)