To call BIMTester language examples from Pyhton I use the code attached.
Ist it possible to retrieve the args dictionary from the cli.py module by Python? I would just need to set the ifc and feature afterwards.
from os.path import join
ifcos_main_path = join("the_path_to_ifcos_repo")
ifcbimtester_path = join(ifcos_main_path, "src", "ifcbimtester")
examples_path = join(ifcbimtester_path, "examples", "01_ifcschema_translated")
#feature_file_name = "de_grundlagen"
#feature_file_name = "en_base"
#feature_file_name = "fr_fondamentaux"
feature_file_name = "it_fondamento"
#feature_file_name = "nl_grondslag"
args = {
"action": "",
"advanced_arguments": "",
"console": True,
"feature": join(examples_path, "features", feature_file_name + ".feature"),
"ifc": join(examples_path, "IFC2X3_col.ifc"),
"path": "",
"report": "",
"steps": "",
"schema_file": "",
"schema_name": "",
"lang": "",
}
import sys
sys.path.append(ifcbimtester_path)
import bimtester.run
import bimtester.reports
report_json = bimtester.run.TestRunner(args["ifc"], args["schema_file"]).run(args)
# bimtester.reports.ReportGenerator().generate(report_json, join(ifcos_main_path, "report.html"))
might be related:
https://stackoverflow.com/questions/31090479/python-argparse-pass-values-without-command-line