|
9 | 9 | import shutil |
10 | 10 | import platform |
11 | 11 | import traceback |
12 | | -from typing import Dict, List, Optional |
| 12 | +from typing import List, Optional |
13 | 13 | from datetime import datetime |
14 | 14 |
|
15 | 15 | try: |
@@ -413,20 +413,23 @@ def stage_input_files(yml_inputs: Yaml, root_yml_dir_abs: Path, |
413 | 413 | FileNotFoundError: If throw and it any of the input files do not exist. |
414 | 414 | """ |
415 | 415 | for key, val in yml_inputs.items(): |
416 | | - if isinstance(val, Dict) and val.get('class', '') == 'File': |
417 | | - path = root_yml_dir_abs / Path(val['path']) |
418 | | - if not path.exists() and throw: |
419 | | - # raise FileNotFoundError(f'Error! {path} does not exist!') |
420 | | - print(f'Error! {path} does not exist!') |
421 | | - sys.exit(1) |
422 | | - |
423 | | - relpath = Path('autogenerated/') if relative_run_path else Path('.') |
424 | | - pathauto = relpath / Path(val['path']) # .name # NOTE: Use .name ? |
425 | | - pathauto.parent.mkdir(parents=True, exist_ok=True) |
426 | | - |
427 | | - if path != pathauto: |
428 | | - cmd = ['cp', str(path), str(pathauto)] |
429 | | - proc = sub.run(cmd, check=False) |
| 416 | + match val: |
| 417 | + case {'class': 'File', **rest_of_val}: |
| 418 | + path = root_yml_dir_abs / Path(val['path']) |
| 419 | + if not path.exists() and throw: |
| 420 | + # raise FileNotFoundError(f'Error! {path} does not exist!') |
| 421 | + print(f'Error! {path} does not exist!') |
| 422 | + sys.exit(1) |
| 423 | + |
| 424 | + relpath = Path('autogenerated/') if relative_run_path else Path('.') |
| 425 | + pathauto = relpath / Path(val['path']) # .name # NOTE: Use .name ? |
| 426 | + pathauto.parent.mkdir(parents=True, exist_ok=True) |
| 427 | + |
| 428 | + if path != pathauto: |
| 429 | + cmd = ['cp', str(path), str(pathauto)] |
| 430 | + _ = sub.run(cmd, check=False) |
| 431 | + case _: |
| 432 | + pass |
430 | 433 |
|
431 | 434 |
|
432 | 435 | def cwltool_main() -> int: |
|
0 commit comments