Skip to content

Commit 223ba84

Browse files
authored
Merge pull request #195 from alxbilger/scenecheckgen
Generate the list of SceneCheck
2 parents 24b63d3 + e1231c8 commit 223ba84

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

.github/workflows/doc.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@ jobs:
6868
pip install gitpython
6969
pip install requests
7070
python ${{ github.workspace }}/SofaDocGenerator/script/pipeline.py ${{ github.workspace }}/SofaDocGenerator/doc ${{ github.workspace }}/sofa/share/sofa/examples ${{ github.workspace }}/sofa/plugins
71-
71+
7272
python ${{ github.workspace }}/SofaDocGenerator/script/title_metadata.py ${{ github.workspace }}/SofaDocGenerator/doc
73+
74+
python ${{ github.workspace }}/SofaDocGenerator/script/scene_check.py ${{ github.workspace }}/SofaDocGenerator/doc/15_Using_SOFA/10_SceneChecking.md
7375
7476
echo "Starting the export of plugin lists"
7577
# Export plugin lists into the merged doc

script/scene_check.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"""
2+
Append the table composed of the list of SceneCheck to a file
3+
"""
4+
5+
import sys
6+
7+
def main():
8+
9+
if len(sys.argv) < 2:
10+
print('Usage: scene_check.py <output_file>')
11+
exit(1)
12+
13+
import Sofa
14+
import SofaRuntime
15+
16+
SofaRuntime.importPlugin("SceneChecking")
17+
18+
table = "| Name | Description |\n"
19+
table += "| ---- | ----------- |\n"
20+
for scene_check in Sofa.Simulation.SceneCheckMainRegistry.getRegisteredSceneChecks():
21+
table += f"| {scene_check.getName()} | {scene_check.getDesc()} |\n"
22+
23+
with open(sys.argv[1], 'a', encoding="utf-8") as output_file:
24+
output_file.write(table)
25+
26+
if __name__ == '__main__':
27+
main()

0 commit comments

Comments
 (0)