From f7182f76753f251774ddca4560ce6a3cb1d03913 Mon Sep 17 00:00:00 2001 From: Dup4 Date: Mon, 30 Oct 2023 13:14:04 +0800 Subject: [PATCH] feat: import user Signed-off-by: Dup4 --- importUsers.py | 6 +++++- start.sh | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 start.sh diff --git a/importUsers.py b/importUsers.py index 224227d..44b002c 100644 --- a/importUsers.py +++ b/importUsers.py @@ -38,7 +38,11 @@ def main(): else: item = {} for j in range(len(headers)): - item[headers[j]] = _row[j] + if _row[j] == None: continue + if _row[j] == 1: + item["location"] = headers[j] + else: + item[headers[j]] = _row[j] res["contestUserList"].append(item) i += 1 diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..091833b --- /dev/null +++ b/start.sh @@ -0,0 +1,9 @@ +#! /bin/bash + +python3 importUsers.py --i=/Users/dup4/Desktop/warmup_hznu_1.xlsx --o=/Users/dup4/Desktop/warmup_hznu_1.json --cid=11 +python3 importUsers.py --i=/Users/dup4/Desktop/warmup_hznu_2.xlsx --o=/Users/dup4/Desktop/warmup_hznu_2.json --cid=11 +python3 importUsers.py --i=/Users/dup4/Desktop/warmup_zucc.xlsx --o=/Users/dup4/Desktop/warmup_zucc.json --cid=11 + +python3 importUsers.py --i=/Users/dup4/Desktop/official_hznu_1.xlsx --o=/Users/dup4/Desktop/official_hznu_1.json --cid=12 +python3 importUsers.py --i=/Users/dup4/Desktop/official_hznu_2.xlsx --o=/Users/dup4/Desktop/official_hznu_2.json --cid=13 +python3 importUsers.py --i=/Users/dup4/Desktop/official_zucc.xlsx --o=/Users/dup4/Desktop/official_zucc.json --cid=12 \ No newline at end of file