(script_obj)
| 201 | |
| 202 | def _load_configs(self, config_path, script_root_dir=".") -> List[JudgeConfig]: |
| 203 | def load_script(script_obj): |
| 204 | if script_obj is None: |
| 205 | return None |
| 206 | if type(script_obj) is str: |
| 207 | return "bash", script_obj |
| 208 | if "language" not in script_obj: |
| 209 | language = "bash" |
| 210 | else: |
| 211 | language = script_obj["language"] |
| 212 | if "file" in script_obj: |
| 213 | with open( |
| 214 | os.path.join(script_root_dir, script_obj["file"]), encoding="utf-8" |
| 215 | ) as f: |
| 216 | return language, f.read() |
| 217 | elif "code" in script_obj: |
| 218 | return language, script_obj["code"] |
| 219 | else: |
| 220 | raise ValueError("Invalid Script Object") |
| 221 | |
| 222 | # 1. handle input file: |
| 223 | logging.info(f"Loading config from: {config_path}") |
nothing calls this directly
no outgoing calls
no test coverage detected