From e1231c855eba2e2cfa3aa91cdf6835d0f17a7b69 Mon Sep 17 00:00:00 2001 From: Alex Bilger Date: Fri, 27 Jun 2025 13:36:56 +0200 Subject: [PATCH] Generate the list of SceneCheck --- .github/workflows/doc.yml | 4 +++- script/scene_check.py | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 script/scene_check.py diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 53f08868d..99ed5225b 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -68,8 +68,10 @@ jobs: pip install gitpython pip install requests python ${{ github.workspace }}/SofaDocGenerator/script/pipeline.py ${{ github.workspace }}/SofaDocGenerator/doc ${{ github.workspace }}/sofa/share/sofa/examples ${{ github.workspace }}/sofa/plugins - + python ${{ github.workspace }}/SofaDocGenerator/script/title_metadata.py ${{ github.workspace }}/SofaDocGenerator/doc + + python ${{ github.workspace }}/SofaDocGenerator/script/scene_check.py ${{ github.workspace }}/SofaDocGenerator/doc/15_Using_SOFA/10_SceneChecking.md echo "Starting the export of plugin lists" # Export plugin lists into the merged doc diff --git a/script/scene_check.py b/script/scene_check.py new file mode 100644 index 000000000..1c53a5c9d --- /dev/null +++ b/script/scene_check.py @@ -0,0 +1,27 @@ +""" +Append the table composed of the list of SceneCheck to a file +""" + +import sys + +def main(): + + if len(sys.argv) < 2: + print('Usage: scene_check.py ') + exit(1) + + import Sofa + import SofaRuntime + + SofaRuntime.importPlugin("SceneChecking") + + table = "| Name | Description |\n" + table += "| ---- | ----------- |\n" + for scene_check in Sofa.Simulation.SceneCheckMainRegistry.getRegisteredSceneChecks(): + table += f"| {scene_check.getName()} | {scene_check.getDesc()} |\n" + + with open(sys.argv[1], 'a', encoding="utf-8") as output_file: + output_file.write(table) + +if __name__ == '__main__': + main()