diff --git a/setup.py b/setup.py
index e998449..6514503 100644
--- a/setup.py
+++ b/setup.py
@@ -29,7 +29,7 @@ setup(
keywords="cable connector hardware harness wiring wiring-diagram wiring-harness",
url=APP_URL,
package_dir={"": "src"},
- package_data={CMD_NAME: ["templates/*.html"]},
+ package_data={CMD_NAME: ["templates/*.html", "*.gvpr"]},
packages=find_packages("src"),
entry_points={
"console_scripts": [
diff --git a/src/wireviz/wv_output.py b/src/wireviz/wv_output.py
index 803d886..b9cfd78 100644
--- a/src/wireviz/wv_output.py
+++ b/src/wireviz/wv_output.py
@@ -107,32 +107,36 @@ def generate_html_output(
)
# generate BOM table
- # generate BOM header (may be at the top or bottom of the table)
- bom_header_html = "
\n"
- for item in bom[0]:
- th_class = f"bom_col_{item.lower()}"
- bom_header_html = f'{bom_header_html} | {item} | \n'
- bom_header_html = f"{bom_header_html}
\n"
+ if bom:
+ # generate BOM header (may be at the top or bottom of the table)
+ bom_header_html = " \n"
+ for item in bom[0]:
+ th_class = f"bom_col_{item.lower()}"
+ bom_header_html = f'{bom_header_html} | {item} | \n'
+ bom_header_html = f"{bom_header_html}
\n"
- # generate BOM contents
- bom_contents = []
- for row in bom[1:]:
- row_html = " \n"
- for i, item in enumerate(row):
- td_class = f"bom_col_{bom[0][i].lower()}"
- row_html = f'{row_html} | {item if item is not None else ""} | \n'
- row_html = f"{row_html}
\n"
- bom_contents.append(row_html)
+ # generate BOM contents
+ bom_contents = []
+ for row in bom[1:]:
+ row_html = " \n"
+ for i, item in enumerate(row):
+ td_class = f"bom_col_{bom[0][i].lower()}"
+ row_html = f'{row_html} | {item if item is not None else ""} | \n'
+ row_html = f"{row_html}
\n"
+ bom_contents.append(row_html)
- bom_html = (
- '\n' + bom_header_html + "".join(bom_contents) + "
\n"
- )
- bom_html_reversed = (
- '\n'
- + "".join(list(reversed(bom_contents)))
- + bom_header_html
- + "
\n"
- )
+ bom_html = (
+ '\n' + bom_header_html + "".join(bom_contents) + "
\n"
+ )
+ bom_html_reversed = (
+ '\n'
+ + "".join(list(reversed(bom_contents)))
+ + bom_header_html
+ + "
\n"
+ )
+ else:
+ bom_html = ""
+ bom_html_reversed = ""
# prepare simple replacements
replacements = {