From f12672ca9c4b18bcb839799247854c89efe73df5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <h.tomwoerden@indiscale.com> Date: Thu, 29 Aug 2024 11:04:28 +0200 Subject: [PATCH] DOC: explain run_server_side_script --- README_SETUP.md | 1 + src/linkahead/utils/server_side_scripting.py | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/README_SETUP.md b/README_SETUP.md index b05eff87..8a32fbfa 100644 --- a/README_SETUP.md +++ b/README_SETUP.md @@ -119,6 +119,7 @@ Build documentation in `build/` with `make doc`. - `sphinx` - `sphinx-autoapi` - `recommonmark` +- `sphinx_rtd_theme` ### How to contribute ### diff --git a/src/linkahead/utils/server_side_scripting.py b/src/linkahead/utils/server_side_scripting.py index 06caa3d9..f97f1c41 100644 --- a/src/linkahead/utils/server_side_scripting.py +++ b/src/linkahead/utils/server_side_scripting.py @@ -99,6 +99,19 @@ def _make_request(call, pos_args, opts, files=None): def run_server_side_script(call, *args, files=None, **kwargs): """ + Parameters + ---------- + call : str + name of the script to be called, potentially with path prefix (e.g. `management/update.py`) + *args : list(str) + list of positional arguments + files : dict + dictionary with where keys are the argument names with prefix (e.g. `-p1` or `-Ofile`) and + the values are the paths to the files to be uploaded. Note, that only the base name will be + used when uploaded. Files will be placed in the `.upload_files` folder. Thus, the script + will be called with the argument `<key>=.upload_files/<basename>`. + **kwargs : dict + kwargs will be passed to `_make_request` Return ------ -- GitLab