feat: make convert work on Windows
All checks were successful
build / build (push) Successful in 1m49s

This commit is contained in:
张泊明518370910136 2025-05-30 06:57:05 -04:00
parent dde9ad3dea
commit 1dd3babe70
3 changed files with 9 additions and 7 deletions

View File

@ -82,6 +82,6 @@ def convert(
result_dict = result_model.model_dump(
mode="json", by_alias=True, exclude_none=True
)
with result_json_path.open("w") as result_file:
with result_json_path.open("w", newline="") as result_file:
json.dump(result_dict, result_file, ensure_ascii=False, indent=4)
result_file.write("\n")

View File

@ -1,4 +1,4 @@
from pathlib import Path
from pathlib import PurePosixPath
from joj3_config_generator.models.common import Memory, Time
@ -9,9 +9,9 @@ DEFAULT_CASE_SCORE = 5
DEFAULT_CLOCK_LIMIT_MULTIPLIER = 2
DEFAULT_PROC_LIMIT = 50
JOJ3_CONFIG_ROOT = Path("/home/tt/.config/joj")
TEAPOT_CONFIG_ROOT = Path("/home/tt/.config/teapot")
CACHE_ROOT = Path("/home/tt/.cache")
JOJ3_CONFIG_ROOT = PurePosixPath("/home/tt/.config/joj")
TEAPOT_CONFIG_ROOT = PurePosixPath("/home/tt/.config/teapot")
CACHE_ROOT = PurePosixPath("/home/tt/.cache")
JOJ3_LOG_PATH = CACHE_ROOT / "joj3" / "joj3.log"
TEAPOT_LOG_PATH = CACHE_ROOT / "joint-teapot-debug.log"
ACTOR_CSV_PATH = JOJ3_CONFIG_ROOT / "students.csv"

View File

@ -1,7 +1,7 @@
import re
import shlex
from functools import partial
from pathlib import Path
from pathlib import Path, PurePosixPath
from typing import Any, Callable, Dict, List, Set, Tuple
from joj3_config_generator.models import result, task
@ -262,7 +262,9 @@ def get_testcases(
continue
testcases.add(
str(
PurePosixPath(
testcases_path.relative_to((task_root / task_path).parent)
)
).removesuffix(".in")
)
return testcases