Skip to content
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

a working custom judge implementation #57

Merged
merged 7 commits into from
Mar 20, 2018
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge branch 'master' into custom-judge
# Conflicts:
#	jd4/case.py
  • Loading branch information
iceboy233 committed Mar 18, 2018
commit 2b9ea49e6815702d48aca64b52ae821c0c0c3ccf
6 changes: 3 additions & 3 deletions jd4/case.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import csv
import tarfile
import re
from asyncio import gather, get_event_loop
from functools import partial
from io import BytesIO, TextIOWrapper
Expand Down Expand Up @@ -100,13 +100,13 @@ def __init__(self, open_input, open_output, time_ns, memory_bytes, score):

def do_input(self, input_file):
try:
with self.open_input() as src, open(input_file, 'wb') as dst:
with open(input_file, 'wb') as dst, self.open_input() as src:
dos2unix(src, dst)
except BrokenPipeError:
pass

def do_output(self, output_file):
with self.open_output() as ans, open(output_file, 'rb') as out:
with open(output_file, 'rb') as out, self.open_output() as ans:
return compare_stream(ans, out)

class CustomJudgeCase:
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.