diff --git a/KiBOM/bom_writer.py b/KiBOM/bom_writer.py
index 37f65875..cba9fb76 100644
--- a/KiBOM/bom_writer.py
+++ b/KiBOM/bom_writer.py
@@ -13,6 +13,14 @@ def TmpFileCopy(filename):
if os.path.exists(filename) and os.path.isfile(filename):
shutil.copyfile(filename, filename + ".tmp")
+def link(text):
+ text = str(text)
+ for t in ["http","https","ftp","www"]:
+ if text.startswith(t):
+ return '{t}'.format(t=text)
+
+ return text
+
def WriteXML(filename, groups, source, version, date, headings = columns.ColumnList._COLUMNS_ALL, ignore=[], ignoreDNF = False):
filename = os.path.abspath(filename)
@@ -55,6 +63,73 @@ def WriteXML(filename, groups, source, version, date, headings = columns.ColumnL
return False
return True
+
+def WriteHTML(filename, groups, net, headings = columns.ColumnList._COLUMNS_ALL, ignore=[], ignoreDNF=False, numberRows=True):
+
+ filename = os.path.abspath(filename)
+
+ headings = [h for h in headings if not h in ignore]
+
+ try:
+ TmpFileCopy(filename)
+
+ with open(filename,"w") as html:
+
+ #header
+ html.write("\n")
+ html.write("
\n")
+
+ #PCB info
+ html.write("PCB Information
\n")
+ html.write("
Source File: {source}\n".format(source=net.getSource()))
+ html.write("
Date: {date}\n".format(date=net.getDate()))
+ html.write("
Version: {version}\n".format(version=net.getVersion()))
+ html.write("
\n")
+ html.write("Component Groups
\n")
+
+ #component groups
+ html.write('\n')
+
+ #row titles:
+ html.write("\n")
+ if numberRows:
+ html.write("\t | \n")
+ for h in headings:
+ html.write("\t{h} | \n".format(h=h))
+ html.write("
\n")
+
+ rowCount = 0
+
+ for i,group in enumerate(groups):
+
+ if ignoreDNF and not group.isFitted(): continue
+
+ row = group.getKicadRow(headings)
+
+ rowCount += 1
+
+ if numberRows:
+ row = [rowCount] + row
+
+ html.write("\n")
+
+ for r in row:
+ html.write("\t| {val} | \n".format(val=link(r)))
+
+
+ html.write("
\n")
+
+ html.write("
\n")
+
+ html.write("")
+
+
+ except BaseException as e:
+ print(str(e))
+ return False
+
+ return True
+
diff --git a/KiBOM/columns.py b/KiBOM/columns.py
index 99bf3865..bd0ddccb 100644
--- a/KiBOM/columns.py
+++ b/KiBOM/columns.py
@@ -45,11 +45,10 @@ class ColumnList:
_COLUMNS_ALL = [
Column.COL_DESCRIPTION,
Column.COL_PART,
- Column.COL_PART_LIB,
Column.COL_REFERENCE,
Column.COL_VALUE,
Column.COL_FP,
- Column.COL_FP_LIB,
+ Column.COL_GRP_QUANTITY,
Column.COL_DATASHEET
]
diff --git a/KiBOM/component.py b/KiBOM/component.py
index cc09bc5a..1d5226f1 100644
--- a/KiBOM/component.py
+++ b/KiBOM/component.py
@@ -24,7 +24,7 @@ class Component():
#simple string comparison
if self.getValue().lower() == other.getValue().lower(): return True
- #otherwise, perform a more complicate value comparison
+ #otherwise, perform a more complicated value comparison
if units.compareValues(self.getValue(), other.getValue()): return True
#no match, return False