Skip to content
6 changes: 5 additions & 1 deletion bin/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,18 @@
# fmt: on


def set_default_args() -> None:
def set_default_args() -> list[str]:
# Set default argument values.
missing = []
for arg in ARGS_LIST:
if not hasattr(args, arg):
setattr(args, arg, None)
missing.append(arg)
for arg, value in DEFAULT_ARGS.items():
if not hasattr(args, arg):
setattr(args, arg, value)
missing.append(arg)
return missing


level: Optional[Literal["problem", "problemset"]] = None
Expand Down
5 changes: 5 additions & 0 deletions bin/contest.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ def problems_yaml() -> Optional[list[dict[str, Any]]]:
_problems_yaml = False
return None
_problems_yaml = read_yaml(problemsyaml_path)
if _problems_yaml is None:
_problems_yaml = False
return None
if not isinstance(_problems_yaml, list):
fatal("problems.yaml must contain a list of problems")
return cast(list[dict[str, Any]], _problems_yaml)


Expand Down
2 changes: 1 addition & 1 deletion bin/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def get_submissions_row(
values = []
for problem in problems:
directory = (
Path().cwd() / "submissions" / problem.name
Path.cwd() / "submissions" / problem.name
if team_submissions
else problem.path / "submissions"
)
Expand Down
Loading
Loading