FileChooser.set_files Sets the value of the file input this chooser is associated with. If some of the `filePaths` are relative paths, then they are resolved relative to the current working directory. For empty array, clears the selected files. Parameters ----------
(
self,
files: typing.Union[
str,
pathlib.Path,
FilePayload,
typing.Sequence[typing.Union[str, pathlib.Path]],
typing.Sequence[FilePayload],
],
*,
timeout: typing.Optional[typing.Union[float, datetime.timedelta]] = None,
no_wait_after: typing.Optional[bool] = None,
)
| 3402 | return mapping.from_maybe_impl(self._impl_obj.is_multiple()) |
| 3403 | |
| 3404 | def set_files( |
| 3405 | self, |
| 3406 | files: typing.Union[ |
| 3407 | str, |
| 3408 | pathlib.Path, |
| 3409 | FilePayload, |
| 3410 | typing.Sequence[typing.Union[str, pathlib.Path]], |
| 3411 | typing.Sequence[FilePayload], |
| 3412 | ], |
| 3413 | *, |
| 3414 | timeout: typing.Optional[typing.Union[float, datetime.timedelta]] = None, |
| 3415 | no_wait_after: typing.Optional[bool] = None, |
| 3416 | ) -> None: |
| 3417 | """FileChooser.set_files |
| 3418 | |
| 3419 | Sets the value of the file input this chooser is associated with. If some of the `filePaths` are relative paths, |
| 3420 | then they are resolved relative to the current working directory. For empty array, clears the selected files. |
| 3421 | |
| 3422 | Parameters |
| 3423 | ---------- |
| 3424 | files : Union[Sequence[Union[pathlib.Path, str]], Sequence[{name: str, mimeType: str, buffer: bytes}], pathlib.Path, str, {name: str, mimeType: str, buffer: bytes}] |
| 3425 | timeout : Union[float, None] |
| 3426 | Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can |
| 3427 | be changed by using the `browser_context.set_default_timeout()` or `page.set_default_timeout()` methods. |
| 3428 | no_wait_after : Union[bool, None] |
| 3429 | This option has no effect. |
| 3430 | Deprecated: This option has no effect. |
| 3431 | """ |
| 3432 | |
| 3433 | return mapping.from_maybe_impl( |
| 3434 | self._sync( |
| 3435 | self._impl_obj.set_files( |
| 3436 | files=mapping.to_impl(files), |
| 3437 | timeout=to_milliseconds(timeout), |
| 3438 | noWaitAfter=no_wait_after, |
| 3439 | ) |
| 3440 | ) |
| 3441 | ) |
| 3442 | |
| 3443 | |
| 3444 | mapping.register(FileChooserImpl, FileChooser) |