Skip to content

Commit 301dfd8

Browse files
authored
Merge pull request #61 from Kitware/doc-update-for-handler
docs(handler): docker information
2 parents 5e37837 + 707995f commit 301dfd8

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

examples/handler/README_DOCKER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ This can work out of the box with the default docker bundle.
33
All you have to do is updating the `setup/initialize.sh` script to run the app once so that asset collection can occur.
44
Example:
55
```bash
6-
uv run your-trame-app-entrypoint --timeout 1
6+
python -m your-trame-app-entrypoint --timeout 1 --server
77
```

trame_client/widgets/trame.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ def register_external_script(
375375
Args:
376376
script_file_path (Path | str):
377377
The local of the script you want to register. Can be either a local or a remote script. Accepts:
378+
378379
- `Path`: local path to your script on the filesystem
379380
- `str`: an valid URL to the script
380381
function_names (list[str]): public API of your script that you want to expose to the Handler widget.
@@ -414,13 +415,15 @@ class Handler(AbstractElement):
414415
It manages the execution flow between the Python state and JavaScript functions,
415416
providing events to monitor execution status.
416417
418+
For usage with the docker setup, please see `README_DOCKER.md <https://github.com/Kitware/trame-client/blob/master/examples/handler/README_DOCKER.md>`_.
419+
417420
Args:
418421
function (UserDefinedFunction | tuple[str, str] | ExternalScript | str):
419422
The JavaScript function to execute. Accepts:
423+
420424
- `UserDefinedFunction`: Obtained from `ExternalScript.function`.
421425
- `tuple[str, str]`: A `(module_name, function_name)` pair.
422-
- `ExternalScript`: An object from `register_external_script` (must
423-
contain exactly one function).
426+
- `ExternalScript`: An object from `register_external_script` (must contain exactly one function).
424427
- `str`: The registration identifier of an external script.
425428
variable (str): The name of the state variable to be passed as the
426429
primary input to the function.
@@ -430,10 +433,11 @@ class Handler(AbstractElement):
430433
to be passed as arguments to the function. Defaults to None.
431434
432435
Events:
433-
completed: A generic event emitted regardless of the execution outcome.
434-
success: Emitted when the function executes and returns successfully.
435-
failure: Emitted when the function reports a handled error.
436-
error: Emitted when an unhandled exception occurs during execution.
436+
437+
- completed: A generic event emitted regardless of the execution outcome.
438+
- success: Emitted when the function executes and returns successfully.
439+
- failure: Emitted when the function reports a handled error.
440+
- error: Emitted when an unhandled exception occurs during execution.
437441
"""
438442

439443
def __init__(

0 commit comments

Comments
 (0)