|
2 | 2 |
|
3 | 3 | import sys |
4 | 4 | from pathlib import Path |
5 | | -from typing import Any, Dict, List, Optional |
| 5 | +from typing import Any, Dict, List, Optional, Union |
6 | 6 |
|
7 | 7 | from typeguard import check_argument_types |
8 | 8 |
|
|
11 | 11 | from psij.utils import path_object_to_full_path as o2p |
12 | 12 |
|
13 | 13 |
|
| 14 | +StrOrPath = Union[str, Path] |
14 | 15 | class JobSpec(object): |
15 | 16 | """A class to hold information about the characteristics of a:class:`~psij.Job`.""" |
16 | 17 |
|
17 | 18 | def __init__(self, name: Optional[str] = None, executable: Optional[str] = None, |
18 | | - arguments: Optional[List[str]] = None, directory: Optional[str | Path] = None, |
| 19 | + arguments: Optional[List[str]] = None, directory: Optional[StrOrPath] = None, |
19 | 20 | inherit_environment: bool = True, environment: Optional[Dict[str, str]] = None, |
20 | | - stdin_path: Optional[str | Path] = None, stdout_path: Optional[str | Path] = None, |
21 | | - stderr_path: Optional[str | Path] = None, resources: Optional[ResourceSpec] = None, |
22 | | - attributes: Optional[JobAttributes] = None, pre_launch: Optional[str | Path] = None, |
23 | | - post_launch: Optional[str | Path] = None, launcher: Optional[str] = None): |
| 21 | + stdin_path: Optional[StrOrPath] = None, stdout_path: Optional[StrOrPath] = None, |
| 22 | + stderr_path: Optional[StrOrPath] = None, resources: Optional[ResourceSpec] = None, |
| 23 | + attributes: Optional[JobAttributes] = None, pre_launch: Optional[StrOrPath] = None, |
| 24 | + post_launch: Optional[StrOrPath] = None, launcher: Optional[str] = None): |
24 | 25 | """ |
25 | 26 | Constructs a `JobSpec` object while allowing its properties to be initialized. |
26 | 27 |
|
|
0 commit comments