|
11 | 11 | import json
|
12 | 12 | import logging
|
13 | 13 | import mimetypes
|
14 |
| -import pathlib |
15 | 14 | import multiprocessing.synchronize
|
16 | 15 | import threading
|
17 | 16 | import humanfriendly
|
@@ -610,8 +609,8 @@ def add_process(
|
610 | 609 | identifier: str,
|
611 | 610 | *cmd_args,
|
612 | 611 | executable: typing.Optional[str] = None,
|
613 |
| - script: typing.Optional[typing.Union[str, pathlib.Path]] = None, |
614 |
| - input_file: typing.Optional[typing.Union[str, pathlib.Path]] = None, |
| 612 | + script: typing.Optional[pydantic.FilePath] = None, |
| 613 | + input_file: typing.Optional[pydantic.FilePath] = None, |
615 | 614 | completion_callback: typing.Optional[
|
616 | 615 | typing.Callable[[int, str, str], None]
|
617 | 616 | ] = None,
|
@@ -684,18 +683,6 @@ def callback_function(status_code: int, std_out: str, std_err: str) -> None:
|
684 | 683 | _cmd_list: typing.List[str] = []
|
685 | 684 | _pos_args = list(cmd_args)
|
686 | 685 |
|
687 |
| - if script: |
688 |
| - if isinstance(script, str): |
689 |
| - script = pathlib.Path(script) |
690 |
| - if not script.exists(): |
691 |
| - self._error(f"Script '{script}' not found.") |
692 |
| - |
693 |
| - if input_file: |
694 |
| - if isinstance(input_file, str): |
695 |
| - input_file = pathlib.Path(input_file) |
696 |
| - if not input_file.exists(): |
697 |
| - self._error(f"Script '{input_file}' not found.") |
698 |
| - |
699 | 686 | # Assemble the command for saving to metadata as string
|
700 | 687 | if executable:
|
701 | 688 | _cmd_list += [executable]
|
|
0 commit comments