|
27 | 27 | "metadata": {},
|
28 | 28 | "outputs": [],
|
29 | 29 | "source": [
|
30 |
| - "judge_env = traopy.PyProcedure()" |
| 30 | + "builder = traopy.PRocedureBuilder()" |
31 | 31 | ]
|
32 | 32 | },
|
33 | 33 | {
|
|
37 | 37 | "outputs": [],
|
38 | 38 | "source": [
|
39 | 39 | "base_path = Path(\".\").resolve()\n",
|
40 |
| - "input_text = traopy.PyResourceKind.TextFile(\n", |
| 40 | + "input_text = traopy.ResourceKind.TextFile(\n", |
41 | 41 | " traopy.PyText(\n",
|
42 | 42 | " \"input\",\n",
|
43 | 43 | " f\"{base_path}/testcases/input.txt\",\n",
|
44 | 44 | " )\n",
|
45 | 45 | ")\n",
|
46 |
| - "output_text = traopy.PyResourceKind.TextFile(\n", |
| 46 | + "output_text = traopy.ResourceKind.TextFile(\n", |
47 | 47 | " traopy.PyText(\n",
|
48 | 48 | " \"output\",\n",
|
49 | 49 | " f\"{base_path}/testcases/output.txt\",\n",
|
50 | 50 | " )\n",
|
51 | 51 | ")\n",
|
52 | 52 | "\n",
|
53 |
| - "input_result = judge_env.add_resource(input_text)\n", |
54 |
| - "output_result = judge_env.add_resource(output_text)" |
| 53 | + "input_result = builder.add_resource(input_text)\n", |
| 54 | + "output_result = builder.add_resource(output_text)" |
55 | 55 | ]
|
56 | 56 | },
|
57 | 57 | {
|
|
60 | 60 | "metadata": {},
|
61 | 61 | "outputs": [],
|
62 | 62 | "source": [
|
63 |
| - "actual_output = traopy.PyResourceKind.RuntimeTextFile(\n", |
| 63 | + "actual_output = traopy.ResourceKind.RuntimeTextFile(\n", |
64 | 64 | " traopy.PyRuntimeText(\n",
|
65 | 65 | " \"actual\",\n",
|
66 | 66 | " \"actual\"\n",
|
67 | 67 | " )\n",
|
68 | 68 | ")\n",
|
69 | 69 | "\n",
|
70 |
| - "actual_result = judge_env.add_resource(actual_output)" |
| 70 | + "actual_result = builder.add_resource(actual_output)" |
71 | 71 | ]
|
72 | 72 | },
|
73 | 73 | {
|
|
76 | 76 | "metadata": {},
|
77 | 77 | "outputs": [],
|
78 | 78 | "source": [
|
79 |
| - "script = traopy.PyText(\n", |
| 79 | + "script = traopy.Text(\n", |
80 | 80 | " \"script\",\n",
|
81 | 81 | " f\"{base_path}/tester.py\",\n",
|
82 | 82 | ")\n",
|
83 | 83 | "\n",
|
84 |
| - "script_result = judge_env.add_script(script)" |
| 84 | + "script_result = builder.add_script(script)" |
85 | 85 | ]
|
86 | 86 | },
|
87 | 87 | {
|
|
90 | 90 | "metadata": {},
|
91 | 91 | "outputs": [],
|
92 | 92 | "source": [
|
93 |
| - "execution = traopy.PyExecution(\n", |
| 93 | + "execution = traopy.Execution(\n", |
94 | 94 | " \"test\",\n",
|
95 | 95 | " script_result,\n",
|
96 | 96 | " [\n",
|
|
105 | 105 | " ],\n",
|
106 | 106 | ")\n",
|
107 | 107 | "\n",
|
108 |
| - "execution_result = judge_env.add_execution(execution)" |
| 108 | + "execution_result = builder.add_execution(execution)" |
109 | 109 | ]
|
110 | 110 | },
|
111 | 111 | {
|
|
114 | 114 | "metadata": {},
|
115 | 115 | "outputs": [],
|
116 | 116 | "source": [
|
117 |
| - "judge_env.write_to(\"judge_procedure.json\")" |
| 117 | + "builder.write_to(\"judge_procedure.json\")" |
118 | 118 | ]
|
119 | 119 | },
|
120 | 120 | {
|
|
124 | 124 | "outputs": [],
|
125 | 125 | "source": [
|
126 | 126 | "local_judge = traopy.LocalJudge(base_path.joinpath(\"tempdir\"))\n",
|
127 |
| - "result = await local_judge.run(judge_env, {\"actual\": \"3\\n\"})\n", |
| 127 | + "result = await local_judge.run(builder, {\"actual\": \"3\\n\"})\n", |
128 | 128 | "import json\n",
|
129 | 129 | "parsed = json.loads(result)\n",
|
130 | 130 | "pretty = json.dumps(parsed, indent=4)\n",
|
|
0 commit comments