Skip to content

Commit c04874b

Browse files
support judge type and error value on submit command (kyuridenamida#161)
* support judge type and error value on submit command
1 parent 3bf31a8 commit c04874b

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

atcodertools/tools/submit.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import os
55

66
from colorama import Fore
7+
8+
from atcodertools.tools.tester import USER_FACING_JUDGE_TYPE_LIST, DEFAULT_EPS
79
from atcodertools.tools.utils import with_color
810

911
from atcodertools.client.atcoder import AtCoderClient, LoginError
@@ -52,6 +54,19 @@ def main(prog, args, credential_supplier=None, use_local_session_cache=True) ->
5254
" the safety by this option in order to submit codes twice or more.",
5355
default=False)
5456

57+
parser.add_argument('--judge-type', '-j',
58+
help='error type'
59+
' must be one of [{}]'.format(
60+
', '.join(USER_FACING_JUDGE_TYPE_LIST)),
61+
type=str,
62+
default=None)
63+
64+
parser.add_argument('--error-value', '-v',
65+
help='error value for decimal number judge:'
66+
' [Default] ' + str(DEFAULT_EPS),
67+
type=float,
68+
default=None)
69+
5570
args = parser.parse_args(args)
5671

5772
metadata_file = os.path.join(args.dir, "metadata.json")
@@ -79,6 +94,10 @@ def main(prog, args, credential_supplier=None, use_local_session_cache=True) ->
7994
tester_args += ["-d", args.dir]
8095
if args.timeout:
8196
tester_args += ["-t", str(args.timeout)]
97+
if args.judge_type is not None:
98+
tester_args += ["-j", str(args.judge_type)]
99+
if args.error_value is not None:
100+
tester_args += ["-v", str(args.error_value)]
82101

83102
if args.force or tester.main("", tester_args):
84103
submissions = client.download_submission_list(metadata.problem.contest)

atcodertools/tools/tester.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def main(prog, args) -> bool:
279279
parser.add_argument('--judge-type', '-j',
280280
help='error type'
281281
' must be one of [{}]'.format(
282-
", ".join(USER_FACING_JUDGE_TYPE_LIST)),
282+
', '.join(USER_FACING_JUDGE_TYPE_LIST)),
283283
type=str,
284284
default=None)
285285

0 commit comments

Comments
 (0)