Skip to content

Add contest export script #3039

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions misc-tools/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
/dj_make_chroot_docker
/dj_run_chroot
/dj_judgehost_cleanup
/dj_utils.py
/force-passwords
3 changes: 2 additions & 1 deletion misc-tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ include $(TOPDIR)/Makefile.global
TARGETS =
OBJECTS =

SUBST_DOMSERVER = fix_permissions configure-domjudge import-contest force-passwords
SUBST_DOMSERVER = fix_permissions configure-domjudge dj_utils.py \
import-contest export-contest force-passwords

SUBST_JUDGEHOST = dj_make_chroot dj_run_chroot dj_make_chroot_docker \
dj_judgehost_cleanup
Expand Down
12 changes: 4 additions & 8 deletions misc-tools/configure-domjudge.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ from typing import List, Set
sys.path.append('@domserver_libdir@')
import dj_utils

webappdir = '@domserver_webappdir@'

def usage():
print(f'Usage: {sys.argv[0]} [<domjudge-api-url>]')
exit(1)
Expand Down Expand Up @@ -57,11 +55,9 @@ def _keyify_list(l: List) -> Set:
return { elem['id']: elem for elem in l }


if len(sys.argv) == 1:
dj_utils.domjudge_webapp_folder_or_api_url = webappdir
elif len(sys.argv) == 2:
dj_utils.domjudge_webapp_folder_or_api_url = sys.argv[1]
else:
if len(sys.argv) == 2:
dj_utils.domjudge_api_url = sys.argv[1]
elif len(sys.argv) != 1:
usage()

user_data = dj_utils.do_api_request('user')
Expand All @@ -88,7 +84,7 @@ if os.path.exists('config.json'):
print(f' - missing keys from new config = {missing_keys}')
if diffs or new_keys or missing_keys:
if dj_utils.confirm(' - Upload these configuration changes?', True):
actual_config = dj_utils.do_api_request('config', 'PUT', expected_config)
actual_config = dj_utils.do_api_request('config', 'PUT', jsonData=expected_config)
diffs, new_keys, missing_keys = compare_configs(
actual_config=actual_config,
expected_config=expected_config
Expand Down
189 changes: 0 additions & 189 deletions misc-tools/dj_utils.py

This file was deleted.

Loading
Loading