From 2fd2b12853be4322186d5f9ca6618391e6b47eeb Mon Sep 17 00:00:00 2001 From: Ryan Rawdon Date: Mon, 18 Sep 2023 03:51:21 -0400 Subject: [PATCH] Proposed option for #13795, adding module option to hide scripts from user display, documentation adjustment --- docs/customization/custom-scripts.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/customization/custom-scripts.md b/docs/customization/custom-scripts.md index b2112fee7..b209b8115 100644 --- a/docs/customization/custom-scripts.md +++ b/docs/customization/custom-scripts.md @@ -42,7 +42,7 @@ Defining script variables is optional: You may create a script with only a `run( Any output generated by the script during its execution will be displayed under the "output" tab in the UI. -By default, scripts within a module are ordered alphabetically in the scripts list page. To return scripts in a specific order, you can define the `script_order` variable at the end of your module. The `script_order` variable is a tuple which contains each Script class in the desired order. Any scripts that are omitted from this list will be listed last. To omit scripts from display entirely, define the `script_hide` variable at the end of your module. Scripts listed in this tuple will be ommitted from the unordered script listing. +By default, scripts within a module are ordered alphabetically in the scripts list page. To return scripts in a specific order, you can define the `script_order` variable at the end of your module. The `script_order` variable is a tuple which contains each Script class in the desired order. Any scripts that are omitted from this list will be listed last. To omit scripts from display entirely, define the `script_hide` variable at the end of your module. Scripts listed in this tuple will be ommitted from the unordered script listing. This is useful for hiding intermediate subclasses of Script, for example. ```python from extras.scripts import Script @@ -53,8 +53,14 @@ class MyCustomScript(Script): class AnotherCustomScript(Script): ... -script_order = (MyCustomScript, AnotherCustomScript) -script_hide = (MyHiddenScript,) +class MyScriptClass(Script): + ... + +class MyScriptSubclass(MyScriptSubclass): + ... + +script_order = (MyCustomScript, AnotherCustomScript, MyScriptSubclass) +script_hide = (MyScriptClass,) ``` ## Module Attributes