fix: use task.config.path
This commit is contained in:
		
							parent
							
								
									9c20c6b377
								
							
						
					
					
						commit
						275f9f981c
					
				|  | @ -1,6 +1,8 @@ | ||||||
| import re | import re | ||||||
| import shlex | import shlex | ||||||
| from typing import List, Set | from typing import Callable, Dict, List, Set, Tuple | ||||||
|  | 
 | ||||||
|  | from pydantic import BaseModel | ||||||
| 
 | 
 | ||||||
| from joj3_config_generator.models import result, task | from joj3_config_generator.models import result, task | ||||||
| from joj3_config_generator.models.const import JOJ3_CONFIG_ROOT | from joj3_config_generator.models.const import JOJ3_CONFIG_ROOT | ||||||
|  | @ -48,6 +50,21 @@ def get_conf_stage( | ||||||
|     return conf_stage |     return conf_stage | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | # def get_processed_dict(task_stage: task.Stagew) -> Dict[str, Tuple[Callable[[task.Stage, BaseModel], None], BaseModel]]: | ||||||
|  | #     processed_dict: Dict[str, Tuple[Callable[[task.Stage, task.StageDetail], None], BaseModel]] = { | ||||||
|  | #         "clang-tidy": (fix_keyword, result.clang-tidy), | ||||||
|  | #         "keyword": (fix_keyword, result.KeywordConfig), | ||||||
|  | #         "cppcheck": (fix_keyword, result.KeywordConfig), | ||||||
|  | #         "cpplint": (fix_keyword, result.KeywordConfig), | ||||||
|  | #         "result-detail": (fix_result_detail, result.ResultDetailConfig), | ||||||
|  | #         "dummy": (fix_dummy, result.DummyConfig), | ||||||
|  | #         "result-status": (fix_dummy, result.DummyConfig), | ||||||
|  | #         "file": (fix_file, result.FileConfig), | ||||||
|  | #         "diff": (fix_diff, result.DiffConfig), | ||||||
|  | #     } | ||||||
|  | #     return processed_dict | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| def get_executor_with(task_stage: task.Stage, cached: Set[str]) -> result.ExecutorWith: | def get_executor_with(task_stage: task.Stage, cached: Set[str]) -> result.ExecutorWith: | ||||||
|     file_import = task_stage.files.import_ |     file_import = task_stage.files.import_ | ||||||
|     copy_in_files = [file for file in file_import if file not in cached] |     copy_in_files = [file for file in file_import if file not in cached] | ||||||
|  | @ -183,7 +200,7 @@ def fix_diff( | ||||||
|         stage_cases.append( |         stage_cases.append( | ||||||
|             result.OptionalCmd( |             result.OptionalCmd( | ||||||
|                 stdin=result.LocalFile( |                 stdin=result.LocalFile( | ||||||
|                     src=str(JOJ3_CONFIG_ROOT / task_conf.task.type_ / stdin), |                     src=str(JOJ3_CONFIG_ROOT / task_conf.path.parent / stdin), | ||||||
|                 ), |                 ), | ||||||
|                 args=shlex.split(command) if command else None, |                 args=shlex.split(command) if command else None, | ||||||
|                 cpu_limit=cpu_limit, |                 cpu_limit=cpu_limit, | ||||||
|  | @ -207,7 +224,7 @@ def fix_diff( | ||||||
|                             score=diff_output.score, |                             score=diff_output.score, | ||||||
|                             file_name="stdout", |                             file_name="stdout", | ||||||
|                             answer_path=str( |                             answer_path=str( | ||||||
|                                 JOJ3_CONFIG_ROOT / task_conf.task.type_ / stdout |                                 JOJ3_CONFIG_ROOT / task_conf.path.parent / stdout | ||||||
|                             ), |                             ), | ||||||
|                             force_quit_on_diff=diff_output.force_quit, |                             force_quit_on_diff=diff_output.force_quit, | ||||||
|                             always_hide=diff_output.hide, |                             always_hide=diff_output.hide, | ||||||
|  |  | ||||||
|  | @ -223,10 +223,10 @@ | ||||||
|                             }, |                             }, | ||||||
|                             "copyInCached": { |                             "copyInCached": { | ||||||
|                                 "h7/build/compile_commands.json": "h7/build/compile_commands.json", |                                 "h7/build/compile_commands.json": "h7/build/compile_commands.json", | ||||||
|                                 "h7/build/ex2-msan": "h7/build/ex2-msan", |                                 "h7/build/ex2-asan": "h7/build/ex2-asan", | ||||||
|                                 "h7/build/ex2": "h7/build/ex2", |  | ||||||
|                                 "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", |                                 "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", | ||||||
|                                 "h7/build/ex2-asan": "h7/build/ex2-asan" |                                 "h7/build/ex2-msan": "h7/build/ex2-msan", | ||||||
|  |                                 "h7/build/ex2": "h7/build/ex2" | ||||||
|                             }, |                             }, | ||||||
|                             "copyInDir": ".", |                             "copyInDir": ".", | ||||||
|                             "copyOut": [ |                             "copyOut": [ | ||||||
|  | @ -323,10 +323,10 @@ | ||||||
|                             }, |                             }, | ||||||
|                             "copyInCached": { |                             "copyInCached": { | ||||||
|                                 "h7/build/compile_commands.json": "h7/build/compile_commands.json", |                                 "h7/build/compile_commands.json": "h7/build/compile_commands.json", | ||||||
|                                 "h7/build/ex2-msan": "h7/build/ex2-msan", |                                 "h7/build/ex2-asan": "h7/build/ex2-asan", | ||||||
|                                 "h7/build/ex2": "h7/build/ex2", |  | ||||||
|                                 "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", |                                 "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", | ||||||
|                                 "h7/build/ex2-asan": "h7/build/ex2-asan" |                                 "h7/build/ex2-msan": "h7/build/ex2-msan", | ||||||
|  |                                 "h7/build/ex2": "h7/build/ex2" | ||||||
|                             }, |                             }, | ||||||
|                             "copyInDir": ".", |                             "copyInDir": ".", | ||||||
|                             "copyOut": [ |                             "copyOut": [ | ||||||
|  | @ -445,10 +445,10 @@ | ||||||
|                             "copyIn": {}, |                             "copyIn": {}, | ||||||
|                             "copyInCached": { |                             "copyInCached": { | ||||||
|                                 "h7/build/compile_commands.json": "h7/build/compile_commands.json", |                                 "h7/build/compile_commands.json": "h7/build/compile_commands.json", | ||||||
|                                 "h7/build/ex2-msan": "h7/build/ex2-msan", |                                 "h7/build/ex2-asan": "h7/build/ex2-asan", | ||||||
|                                 "h7/build/ex2": "h7/build/ex2", |  | ||||||
|                                 "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", |                                 "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", | ||||||
|                                 "h7/build/ex2-asan": "h7/build/ex2-asan" |                                 "h7/build/ex2-msan": "h7/build/ex2-msan", | ||||||
|  |                                 "h7/build/ex2": "h7/build/ex2" | ||||||
|                             }, |                             }, | ||||||
|                             "copyInDir": ".", |                             "copyInDir": ".", | ||||||
|                             "copyOut": [ |                             "copyOut": [ | ||||||
|  | @ -588,10 +588,10 @@ | ||||||
|                             "copyIn": {}, |                             "copyIn": {}, | ||||||
|                             "copyInCached": { |                             "copyInCached": { | ||||||
|                                 "h7/build/compile_commands.json": "h7/build/compile_commands.json", |                                 "h7/build/compile_commands.json": "h7/build/compile_commands.json", | ||||||
|                                 "h7/build/ex2-msan": "h7/build/ex2-msan", |                                 "h7/build/ex2-asan": "h7/build/ex2-asan", | ||||||
|                                 "h7/build/ex2": "h7/build/ex2", |  | ||||||
|                                 "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", |                                 "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", | ||||||
|                                 "h7/build/ex2-asan": "h7/build/ex2-asan" |                                 "h7/build/ex2-msan": "h7/build/ex2-msan", | ||||||
|  |                                 "h7/build/ex2": "h7/build/ex2" | ||||||
|                             }, |                             }, | ||||||
|                             "copyInDir": ".", |                             "copyInDir": ".", | ||||||
|                             "copyOut": [ |                             "copyOut": [ | ||||||
|  | @ -685,10 +685,10 @@ | ||||||
|                             "copyIn": {}, |                             "copyIn": {}, | ||||||
|                             "copyInCached": { |                             "copyInCached": { | ||||||
|                                 "h7/build/compile_commands.json": "h7/build/compile_commands.json", |                                 "h7/build/compile_commands.json": "h7/build/compile_commands.json", | ||||||
|                                 "h7/build/ex2-msan": "h7/build/ex2-msan", |                                 "h7/build/ex2-asan": "h7/build/ex2-asan", | ||||||
|                                 "h7/build/ex2": "h7/build/ex2", |  | ||||||
|                                 "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", |                                 "h7/build/ex2-ubsan": "h7/build/ex2-ubsan", | ||||||
|                                 "h7/build/ex2-asan": "h7/build/ex2-asan" |                                 "h7/build/ex2-msan": "h7/build/ex2-msan", | ||||||
|  |                                 "h7/build/ex2": "h7/build/ex2" | ||||||
|                             }, |                             }, | ||||||
|                             "copyInDir": ".", |                             "copyInDir": ".", | ||||||
|                             "copyOut": [ |                             "copyOut": [ | ||||||
|  | @ -706,7 +706,7 @@ | ||||||
|                         "cases": [ |                         "cases": [ | ||||||
|                             { |                             { | ||||||
|                                 "stdin": { |                                 "stdin": { | ||||||
|                                     "src": "/home/tt/.config/joj/homework/h7/e2/case0.in" |                                     "src": "/home/tt/.config/joj/case0.in" | ||||||
|                                 }, |                                 }, | ||||||
|                                 "cpuLimit": 500000000, |                                 "cpuLimit": 500000000, | ||||||
|                                 "clockLimit": 1000000000, |                                 "clockLimit": 1000000000, | ||||||
|  | @ -715,7 +715,7 @@ | ||||||
|                             }, |                             }, | ||||||
|                             { |                             { | ||||||
|                                 "stdin": { |                                 "stdin": { | ||||||
|                                     "src": "/home/tt/.config/joj/homework/h7/e2/case1.in" |                                     "src": "/home/tt/.config/joj/case1.in" | ||||||
|                                 }, |                                 }, | ||||||
|                                 "cpuLimit": 1234567890, |                                 "cpuLimit": 1234567890, | ||||||
|                                 "clockLimit": 2469135780, |                                 "clockLimit": 2469135780, | ||||||
|  | @ -736,7 +736,7 @@ | ||||||
|                                         { |                                         { | ||||||
|                                             "score": 5, |                                             "score": 5, | ||||||
|                                             "fileName": "stdout", |                                             "fileName": "stdout", | ||||||
|                                             "answerPath": "/home/tt/.config/joj/homework/h7/e2/case0.out", |                                             "answerPath": "/home/tt/.config/joj/case0.out", | ||||||
|                                             "forceQuitOnDiff": false, |                                             "forceQuitOnDiff": false, | ||||||
|                                             "alwaysHide": false, |                                             "alwaysHide": false, | ||||||
|                                             "compareSpace": false |                                             "compareSpace": false | ||||||
|  | @ -748,7 +748,7 @@ | ||||||
|                                         { |                                         { | ||||||
|                                             "score": 5, |                                             "score": 5, | ||||||
|                                             "fileName": "stdout", |                                             "fileName": "stdout", | ||||||
|                                             "answerPath": "/home/tt/.config/joj/homework/h7/e2/case1.out", |                                             "answerPath": "/home/tt/.config/joj/case1.out", | ||||||
|                                             "forceQuitOnDiff": false, |                                             "forceQuitOnDiff": false, | ||||||
|                                             "alwaysHide": false, |                                             "alwaysHide": false, | ||||||
|                                             "compareSpace": false |                                             "compareSpace": false | ||||||
|  |  | ||||||
|  | @ -64,7 +64,7 @@ | ||||||
|                         "cases": [ |                         "cases": [ | ||||||
|                             { |                             { | ||||||
|                                 "stdin": { |                                 "stdin": { | ||||||
|                                     "src": "/home/tt/.config/joj/homework/h7/e2/case0.in" |                                     "src": "/home/tt/.config/joj/case0.in" | ||||||
|                                 }, |                                 }, | ||||||
|                                 "cpuLimit": 1000000000, |                                 "cpuLimit": 1000000000, | ||||||
|                                 "clockLimit": 2000000000, |                                 "clockLimit": 2000000000, | ||||||
|  | @ -73,7 +73,7 @@ | ||||||
|                             }, |                             }, | ||||||
|                             { |                             { | ||||||
|                                 "stdin": { |                                 "stdin": { | ||||||
|                                     "src": "/home/tt/.config/joj/homework/h7/e2/case1.in" |                                     "src": "/home/tt/.config/joj/case1.in" | ||||||
|                                 }, |                                 }, | ||||||
|                                 "cpuLimit": 2000000000, |                                 "cpuLimit": 2000000000, | ||||||
|                                 "clockLimit": 4000000000, |                                 "clockLimit": 4000000000, | ||||||
|  | @ -94,7 +94,7 @@ | ||||||
|                                         { |                                         { | ||||||
|                                             "score": 5, |                                             "score": 5, | ||||||
|                                             "fileName": "stdout", |                                             "fileName": "stdout", | ||||||
|                                             "answerPath": "/home/tt/.config/joj/homework/h7/e2/case0.out", |                                             "answerPath": "/home/tt/.config/joj/case0.out", | ||||||
|                                             "forceQuitOnDiff": false, |                                             "forceQuitOnDiff": false, | ||||||
|                                             "alwaysHide": false, |                                             "alwaysHide": false, | ||||||
|                                             "compareSpace": false |                                             "compareSpace": false | ||||||
|  | @ -106,7 +106,7 @@ | ||||||
|                                         { |                                         { | ||||||
|                                             "score": 5, |                                             "score": 5, | ||||||
|                                             "fileName": "stdout", |                                             "fileName": "stdout", | ||||||
|                                             "answerPath": "/home/tt/.config/joj/homework/h7/e2/case1.out", |                                             "answerPath": "/home/tt/.config/joj/case1.out", | ||||||
|                                             "forceQuitOnDiff": false, |                                             "forceQuitOnDiff": false, | ||||||
|                                             "alwaysHide": false, |                                             "alwaysHide": false, | ||||||
|                                             "compareSpace": false |                                             "compareSpace": false | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user