mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 14:23:53 +00:00
bimtester: report generator, add another parameter report file
This commit is contained in:
@@ -11,9 +11,13 @@ def generate_report(
|
|||||||
report_dir=".",
|
report_dir=".",
|
||||||
use_report_folder=True,
|
use_report_folder=True,
|
||||||
report_file_name="report.json",
|
report_file_name="report.json",
|
||||||
html_template_file_path=""
|
html_template_file_path="",
|
||||||
|
report_file=""
|
||||||
):
|
):
|
||||||
|
|
||||||
|
# TODO use far less parameter
|
||||||
|
# to be discussed with other devs
|
||||||
|
|
||||||
print("# Generating HTML reports now.")
|
print("# Generating HTML reports now.")
|
||||||
|
|
||||||
# get locale path
|
# get locale path
|
||||||
@@ -33,9 +37,13 @@ def generate_report(
|
|||||||
report_template_path = html_template_file_path
|
report_template_path = html_template_file_path
|
||||||
|
|
||||||
# get report file and report dir
|
# get report file and report dir
|
||||||
if use_report_folder:
|
if report_file:
|
||||||
report_dir = os.path.join(report_dir, "report")
|
report_file = report_file
|
||||||
report_file = os.path.join(report_dir, report_file_name)
|
report_dir = os.path.dirname(report_file)
|
||||||
|
else:
|
||||||
|
if use_report_folder:
|
||||||
|
report_dir = os.path.join(report_dir, "report")
|
||||||
|
report_file = os.path.join(report_dir, report_file_name)
|
||||||
# print(report_file)
|
# print(report_file)
|
||||||
if not os.path.isdir(report_dir):
|
if not os.path.isdir(report_dir):
|
||||||
return print("Report directory does not exist.")
|
return print("Report directory does not exist.")
|
||||||
|
|||||||
Reference in New Issue
Block a user